aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: add missing formats to driGLFormatToImageFormatTapani Pälli2016-10-251-0/+2
| | | | | | | | | | | Fixes following dEQP tests: dEQP-EGL.functional.image.api.create_image_gles2_tex2d_luminance dEQP-EGL.functional.image.api.create_image_gles2_tex2d_luminance_alpha Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98328
* i965: Drop nir_inputs from fs_visitor.Kenneth Graunke2016-10-241-1/+0
| | | | | | | | It's unused. Cc: [email protected] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965: Don't use nir_assign_var_locations for VS/TES/GS outputs.Kenneth Graunke2016-10-245-62/+12
| | | | | | | | | | | Fixes spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3. v2: Remove nir_outputs field from fs_visitor (caught by Tim and Iago). Cc: [email protected] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965: Make split_virtual_grfs() call compact_virtual_grfs().Kenneth Graunke2016-10-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Post-splitting, VGRFs have a maximum size (MAX_VGRF_SIZE). This is required by the register allocator, as we have to create classes for each size of VGRF. We can (and do) allocate virtual registers larger than MAX_VGRF_SIZE, but we must ensure that they are splittable. split_virtual_grfs() asserts that the post-splitting register size is in range. Unfortunately, these trip for completely dead registers which are too large - we only set split points for live registers. So dead ones are never split, and if they happened to be too large, they'd trip asserts. To fix this, call compact_virtual_grfs() to eliminate dead registers before splitting. v2: Add a comment written by Iago. Cc: [email protected] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965: Drop unnecessary switch statement in nir_setup_outputs()Kenneth Graunke2016-10-241-12/+3
| | | | | | | | | | TCS and FS are skipped above. CS has no output variables. All remaining cases take the same path. Cc: [email protected] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965/gen8: Don't enable alpha test and alpha to coverage if draw bufer zero ↵Anuj Phogat2016-10-241-6/+9
| | | | | | | | | | is integer type We follow this rule at multiple places in i965 driver. This patch doesn't fix any testcase. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen8: Use DrawBuffer->_IntegerBuffers in gen8_upload_ps_blend()Anuj Phogat2016-10-241-5/+2
| | | | | | | No functional changes in this patch. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen8: Use DrawBuffer->_IntegerBuffers in gen8_upload_blend_state()Anuj Phogat2016-10-241-8/+2
| | | | | | | No functional changes in this patch. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: add matrix layout information to interface block typesIago Toral Quiroga2016-10-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | So far we have been checking that interface block definitions had matching matrix layouts by comparing the definitions of their fields, however, this does not cover the case where the interface blocks are defined with mismatching matrix layouts but don't define any field with a matrix type. In this case Mesa will not fail to link because none of the fields will inherit the mismatching layout qualifier. This patch fixes the problem in the same way we fixed it for packing layout information: we add the the layout information to the interface type and then we check it matches during the uniform block linking process. v2: Fix unit tests so they pass the new parameter to glsl_type::get_interface_instance() Fixes: dEQP-GLES31.functional.shaders.linkage.uniform.block.layout_qualifier_mismatch_3 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98245 Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
* st/mesa: cleanup and fix primitive restart for indirect drawsNicolai Hähnle2016-10-241-17/+28
| | | | | | | | | | | | | | | | There are three intended functional changes here: 1. OpenGL 4.5 clarifies that primitive restart should only apply with index buffers, so make that change explicit in the indirect draw path. 2. Make PrimitiveRestartFixedIndex work with indirect draws. 3. The change where primitive_restart is only set when the restart index can actually have an effect (based on the size of indices) is also applied for indirect draws. Cc: 13.0 <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* glsl/mesa: remove unused namespace support from the symbol tableTimothy Arceri2016-10-244-254/+117
| | | | | | | | | | | | | | | | | | Namespace support seems to have been unused for a very long time. Previously the hash table entry was never removed and the symbol name wasn't freed until the symbol table was destroyed. In theory this could reduced the number of times we need to copy a string as duplicate names are reused. However in practice there is likely only a limited number of symbols that are the same and this is likely to cause other less than optimal behaviour such as the hash_table continuously growing. Along with dropping namespace support this change removes entries from the hash table as they become unused. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* gallium: add PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERSIlia Mirkin2016-10-221-1/+1
| | | | | | | | | | | | | | This allows the driver to signal that it can't handle random interleaving of attributes across buffers. This is required for ARB_transform_feedback3, and it's initialized to whatever the previous value of PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME was except for nv50 where it is disabled. Note that the proprietary drivers never expose ARB_transform_feedback3 on any GT21x's (where nouveau previously did), and after some effort I was unable to get it to work. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* vbo: clean up with 'indent', whitespace fixes, etc in vbo_exec_array.cBrian Paul2016-10-201-252/+276
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* vbo: whitespace fixes and reformatting in vbo_exec_api.cBrian Paul2016-10-201-42/+64
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* vbo: minor clean-up in vbo_exec_api.cBrian Paul2016-10-201-5/+2
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* vbo: move attribute type assignmentBrian Paul2016-10-201-1/+2
| | | | | | | | | | If the attribute type is changing, we would have found that earlier in the ATTR_UNION() macro and would have called vbo_exec_fixup_vertex(). So move the assignment into that function so we don't do it every time. No Piglit regressions. Reviewed-by: Charmaine Lee <[email protected]>
* vbo: rename reset_attrfv() to vbo_reset_all_attr()Brian Paul2016-10-201-4/+6
| | | | | | Use a better name. Reviewed-by: Charmaine Lee <[email protected]>
* vbo: make vbo_reset_attr() staticBrian Paul2016-10-202-3/+5
| | | | | | Not called from any other file. Reviewed-by: Charmaine Lee <[email protected]>
* vbo: trivial indentation fix in vbo_exec_api.cBrian Paul2016-10-201-1/+1
|
* st/mesa: only set primitive_restart when the restart index is in rangeNicolai Hähnle2016-10-201-2/+13
| | | | | | | | | | | | | Even when enabled, primitive restart has no effect when the restart index is larger than the representable values in the index buffer. Fixes GL45-CTS.gtf31.GL3Tests.primitive_restart.primitive_restart_upconvert for radeonsi VI. v2: add an explanatory comment Cc: "12.0 13.0" <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (v1)
* st/glsl_to_tgsi: sort input and output decls by TGSI indexNicolai Hähnle2016-10-201-0/+28
| | | | | | | | Fixes a regression introduced by commit 777dcf81b. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98307 Reviewed-by: Marek Olšák <[email protected]> Cc: 13.0 <[email protected]>
* st/glsl_to_tgsi: fix block copies of arrays of structsNicolai Hähnle2016-10-201-2/+4
| | | | | | | | | | Use a full writemask in this case. This is relevant e.g. when a function has an inout argument which is an array of structs. v2: use C-style comment (Timothy Arceri) Reviewed-by: Marek Olšák <[email protected]> (v1) Cc: 13.0 <[email protected]>
* st/glsl_to_tgsi: fix block copies of arrays of doublesNicolai Hähnle2016-10-201-0/+1
| | | | | | | | | Set the type of the left-hand side to the same as the right-hand side, so that when the base type is double, the writemask of the MOV instruction is properly fixed up. Reviewed-by: Marek Olšák <[email protected]> Cc: 13.0 <[email protected]>
* i965/cs: Don't use a thread channel ID for small local sizesJordan Justen2016-10-191-2/+11
| | | | | | | | | | | | | | | | | When the local group size is 8 or less, we will execute the program at most 1 time. Therefore, the local channel ID will always be 0. By using a constant 0 in this case we can prevent using push constant data. This is not expected to be common a occurance in real applications, but it has been seen in tests. We could extend this optimization to 16 and 32 for SIMD16 and SIMD32, but it gets a bit more complicated, because this optimization is currently being done early on, before we have decided the SIMD size. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965/cs: Use udiv/umod for local IDsJordan Justen2016-10-191-1/+1
| | | | | | | This allows for more optimizations relating to power-of-two divisions. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove unused LocalSizeVariableTimothy Arceri2016-10-202-6/+0
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* st/mesa: disable alpha-test, alpha-to-coverage, alpha-to-one for integer FBsMarek Olšák2016-10-192-2/+4
| | | | | | v2: rebased Reviewed-by: Brian Paul <[email protected]>
* mesa: remove gl_shader_compiler_options::EmitNoNoiseMarek Olšák2016-10-195-7/+1
| | | | | | | it's always true Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: remove code for fixing up TGSI labelsMarek Olšák2016-10-191-90/+2
| | | | | | | I don't know what this was supposed to do, but all TGSI labels were always 0. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: remove subroutine supportMarek Olšák2016-10-192-205/+5
| | | | | | | | Never used. The GLSL compiler doesn't even look at EmitNoFunctions. v2: add back "return" support in "main" Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa_to_tgsi: remove remnants of flow control and subroutine supportMarek Olšák2016-10-191-92/+1
| | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa_to_tgsi: drop support for instructions that can't occur hereMarek Olšák2016-10-191-72/+0
| | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: allocate glsl_to_tgsi_instruction::tex_offsets on demandMarek Olšák2016-10-191-1/+4
| | | | | | | sizeof(glsl_to_tgsi_instruction): 384 -> 264 Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: merge buffer and sampler fields in glsl_to_tgsi_instructionMarek Olšák2016-10-191-32/+31
| | | | | | | sizeof(glsl_to_tgsi_instruction): 416 -> 384 Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: reduce the size of glsl_to_tgsi_instruction using bitfieldsMarek Olšák2016-10-191-17/+19
| | | | | | | | sizeof(glsl_to_tgsi_instruction): 464 -> 416 Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: reduce the size of st_dst_reg and st_src_regMarek Olšák2016-10-191-31/+40
| | | | | | | | | I noticed that glsl_to_tgsi_instruction is too huge. sizeof(glsl_to_tgsi_instruction): 752 -> 464 (-38%) Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: remove unused st_translate::tex_offsetsMarek Olšák2016-10-191-1/+0
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: remove unused parameters from calc_deref_offsetsMarek Olšák2016-10-191-9/+5
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: use array_id for temp arrays instead of hacking high bitsMarek Olšák2016-10-191-13/+19
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* i965: fix subnr overflow in suboffset()Iago Toral Quiroga2016-10-191-8/+5
| | | | Reviewed-by: Ian Romanick <[email protected]>
* util: move min/max/clamp macros to util macros.hDave Airlie2016-10-191-13/+0
| | | | | | | | | Although the vulkan drivers include mesa macros.h, for radv I'd like to move away from that. Reviewed-by: Nicolai Hähnle <[email protected]> Acked-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965: Fix gl_InvocationID in dual object GS where invocations == 1.Kenneth Graunke2016-10-171-1/+4
| | | | | | | | | | | | | | | | | | | | dEQP-GLES31.functional.geometry_shading.instanced.geometry_1_invocations draws using a geometry shader that specifies layout(points, invocations = 1) in; and then uses gl_InvocationID. According to the Haswell PRM, the "GS Instance ID 0" (and 1) thread payload fields are undefined in dual object mode: "If 'dispatch mode' is DUAL_OBJECT this field is not valid." But there's no point in using them - if there's only one invocation, the ID will be 0. So just load a constant. Cc: [email protected] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i965: Silence unused parameter warningsIan Romanick2016-10-177-9/+5
| | | | | | | | | | | | | | | | | | | | brw_link.cpp:76:44: warning: unused parameter ‘shader_type’ [-Wunused-parameter] gl_shader_stage shader_type, ^ brw_nir.c: In function ‘brw_nir_lower_vs_inputs’: brw_nir.c:194:55: warning: unused parameter ‘devinfo’ [-Wunused-parameter] const struct gen_device_info *devinfo, ^ brw_vec4_visitor.cpp:914:37: warning: unused parameter ‘sampler’ [-Wunused-parameter] uint32_t sampler, ^ brw_vec4_visitor.cpp:1146:34: warning: unused parameter ‘stream_id’ [-Wunused-parameter] vec4_visitor::gs_emit_vertex(int stream_id) ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* st/glsl_to_tgsi: fix [ui]vec[34] conversion to doubleNicolai Hähnle2016-10-171-2/+3
| | | | | | | | The corresponding opcodes for integers need to be treated the same as F2D. Fixes GL45-CTS.gpu_shader_fp64.conversions. Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: fix atomic counter addressingNicolai Hähnle2016-10-171-6/+9
| | | | | | | | | | | | | When more than one atomic counter buffer is in use, UniformStorage[n].opaque is set up to contain indices that are contiguous across all used buffers. This appears to be used by i965 via NIR, but for TGSI we do not treat atomic counter buffers as opaque, so using the data in the opaque array is incorrect. Fixes GL45-CTS.compute_shader.resource-atomic-counter. Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: fix a corner case of std140 layout in uniform buffersNicolai Hähnle2016-10-171-1/+28
| | | | | | | See the comment in the code for an explanation. This fixes GL45-CTS.buffer_storage.map_persistent_draw. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: fix fragment shader output mappingNicolai Hähnle2016-10-171-4/+13
| | | | | | | | | Properly handle the case where there is a gap in the assigned output locations, e.g. a fragment shader writes to color buffer 2 but not to color buffers 0 & 1. Fixes GL45-CTS.gtf33.GL3Tests.explicit_attrib_location.explicit_attrib_location_pipeline. Reviewed-by: Marek Olšák <[email protected]>
* state_tracker: Fix check for scissor enabled when < 0.Eric Anholt2016-10-161-2/+2
| | | | | | | | | | | | | DEQP's clear tests like to give us x + w < 0 or y + h < 0. Since we were comparing to an unsigned, it would get promoted to unsigned and come out as bignum >= width or height and we would clear the whole fb instead of none of the fb. Fixes 10 tests under deqp-gles2/functional/color_clear. Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965: Enable OpenGL 4.5.Kenneth Graunke2016-10-142-2/+2
| | | | | | | | | Everything is in place. There are still conformance issues to sort out, but we may as well turn it on in master. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* intel/blorp: Add a flag to make blorp not re-emit dept/stencil buffersJason Ekstrand2016-10-141-6/+6
| | | | | | | | | | | In Vulkan, we want to be able to use blorp to perform clears inside of a render pass. If blorp stomps the depth/stencil buffers packets then we'll have to re-emit them. This gets tricky when secondary command buffers get involved. Instead, we'll simply guarantee that the depth and stencil buffers we pass to blorp (if any) match those already set in the hardware. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>