aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: switch gs over to shared shader_infoTimothy Arceri2016-10-261-4/+7
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/mesa/st: eliminate gl_tess_eval_programTimothy Arceri2016-10-269-19/+19
| | | | | | We now get all the tes metadata from shader_info. Reviewed-by: Jason Ekstrand <[email protected]>
* st/mesa: switch tes over to shared shader_infoTimothy Arceri2016-10-261-5/+7
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/mesa/st: eliminate gl_tess_ctrl_programTimothy Arceri2016-10-268-16/+16
| | | | | | We now get all the tcs metadata from shader_info. Reviewed-by: Jason Ekstrand <[email protected]>
* st/mesa: switch tcs over to shared shader_infoTimothy Arceri2016-10-261-1/+1
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: add temporary copy_shader_info() functionTimothy Arceri2016-10-262-3/+3
| | | | | | | | | | | | | This function is added here to ease refactoring towards using the new shared shader_info. Once refactoring is complete and values are set directly it will be removed. We call it from _mesa_copy_linked_program_data() rather than glsl_to_nir() so that the values will be set for all drivers. In order to do this some calls need to be moved around so that we make sure to call do_set_program_inouts() before _mesa_copy_linked_program_data() Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: modify _mesa_copy_linked_program_data() to take gl_linked_shaderTimothy Arceri2016-10-262-6/+7
| | | | | | | | | | This allows us to do some small tidy ups, but will also allow us to call a new function that copies values to a shared shader info from here. In order to make this change this function now requires _mesa_reference_program() to have previously been called. Reviewed-by: Jason Ekstrand <[email protected]>
* 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]>
* 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]>
* 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]>
* 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-191-2/+0
| | | | | | | 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]>
* 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]>
* mesa: remove 'params' parameter from ctx->Driver.TexParameter()Brian Paul2016-10-131-2/+1
| | | | | | | | | | | None of the drivers which implement this hook do anything with the texture parameter value. Drivers just look at the pname and set a dirty flag if needed. We were doing some ugly casting and type conversion to setup the argument so that all goes away. Reviewed-by: Marek Olšák <[email protected]>
* gallium: add PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELYMarek Olšák2016-10-131-1/+2
| | | | | | | | | | | | | | For performance tuning in drivers. It filters out window system framebuffers and OpenGL renderbuffers. radeonsi will use this to guess whether a depth buffer will be read by a shader. There is no guarantee about what will actually happen. This is a departure from PIPE_BIND flags which are defined to be strict but they are useless in practice. Acked-by: Roland Scheidegger <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: fix vertex elements setup for doublesNicolai Hähnle2016-10-131-48/+50
| | | | | | | | | | | | Whether one or two slots are taken up by one API array depends on the vertex shader, not on how the array is configured. When an array is set up with fewer components than the shader expects, the high components are undefined. Fixes GL45-CTS.vertex_attrib_binding.basic-inputL-case1. Cc: [email protected] Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: remove unnecessary ir_instruction argument from get_opcodeNicolai Hähnle2016-10-131-3/+3
| | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: fix textureGatherOffset with indirectly loaded offsetsNicolai Hähnle2016-10-131-1/+17
| | | | | | | Cc: [email protected] Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: simplify translate_tex_offsetNicolai Hähnle2016-10-131-50/+14
| | | | | | | | | | | | This fixes a bug with offsets from uniforms which seems to have only been noticed as a crash in piglit's arb_gpu_shader5/compiler/builtin-functions/fs-gatherOffset-uniform-offset.frag on radeonsi. Cc: [email protected] Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: only flip stipple pattern for winsys fbo'sIlia Mirkin2016-10-121-3/+7
| | | | | | | | | | | | | Gallium is completely oblivious to whether the fbo is flipped or not. Only flip the stipple pattern when the fbo is flipped as well. Otherwise the driver has no idea when to unflip the pattern. Fixes bin/gl-2.1-polygon-stipple-fs -fbo Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: enable ARB_enhanced_layouts and turn the cap onNicolai Hähnle2016-10-121-0/+7
| | | | | | | v2: mark llvmpipe & softpipe properly as well (Jason Wood) Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: adjust swizzles and writemasks for explicit componentsNicolai Hähnle2016-10-121-19/+49
| | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: explicitly track all input and output declarationNicolai Hähnle2016-10-121-154/+171
| | | | | | | | | | | | | In order to be able to emit overlapping input and output array declarations, we flip the logic of emitting those declarations on its head: rather than iterating over slots and emitting the corresponding declarations, we iterate over the declarations from GLSL and emit those. v2: fix some regressions related to structs v3: fix a regression in geometry and tessellation shader array handling Acked-by: Edward O'Callaghan <[email protected]> (v2) Reviewed-by: Dave Airlie <[email protected]> (v2)
* st/glsl_to_tgsi: mark "gaps" in input/output arrays as usedNicolai Hähnle2016-10-121-8/+24
| | | | | | | | | | | | | | | | In some cases, a shader may have an input/output array but not use some entries in the middle. This happens with eON games, for example. We emit declarations that cover the entire array range even if there are some unused gaps. This patch now reflects that in the InputsRead etc. fields to ensure the various input/outputMapping arrays are actually correct, which will be important when we re-jiggle the way declarations are emitted. v2: fix a typo (Edward O'Callaghan) Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: disable on-the-fly peephole for 64-bit operationsNicolai Hähnle2016-10-121-0/+4
| | | | | | | | | | | | | | | | | | | | | This optimization is incorrect with 64-bit operations, because the channel-splitting logic in emit_asm ends up being applied twice to the source operands. A lucky coincidence of how the writemask test works resulted in this optimization basically never being applied anyway. As far as I can tell, the only case where it would (incorrectly) have been applied is something like dvec2 d; float x = (float)d.y; which nobody seems to have ever done. But the moral equivalent does occur in one of the component layout piglit test. Cc: [email protected] Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: simpler fixup of empty writemasksNicolai Hähnle2016-10-121-27/+10
| | | | | | | | | Empty writemasks mean "copy everything", so we can always just use the number of vector elements (which uses the GLSL meaning here, i.e. each double is a single element/writemask bit). Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: explicit handling of writemask for depth/stencil exportNicolai Hähnle2016-10-121-8/+17
| | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: expose ARB_compute_variable_group_sizeSamuel Pitoiset2016-10-071-0/+22
| | | | | | | | | | | | | This extension is only exposed if the underlying driver supports ARB_compute_shader and if PIPE_COMPUTE_MAX_VARIABLE_THREADS_PER_BLOCK is set. v3: - initialize max_variable_threads_per_block to 0 v2: - expose the ext based on that new cap Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: add support for dispatching a variable local sizeSamuel Pitoiset2016-10-071-3/+12
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: add mapping for SYSTEM_VALUE_LOCAL_GROUP_SIZESamuel Pitoiset2016-10-071-0/+2
| | | | | | | | | gl_LocalGroupSizeARB can be translated into TGSI_SEMANTIC_BLOCK_SIZE which represents the block size in threads. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: move all sampler view code into new st_sampler_view.[ch] filesBrian Paul2016-10-0612-493/+587
| | | | | | | | | | | | | Previously, the sampler view code was scattered across several different files. Note, the previous REALLOC(), FREE() for st_texture_object::sampler_views are replaced by realloc(), free() to avoid conflicting macros in Mesa vs. Gallium. Reviewed-by: Edward O'Callaghan <[email protected]> Acked-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: optimize pipe_sampler_view validationBrian Paul2016-10-064-30/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, st_get_texture_sampler_view_from_stobj() did a lot of work to check if the texture parameters matched the sampler view (format, swizzle, min/max lod, first/last layer, etc). We did this every time we validated the texture state. Now, we use a ctx->Driver.TexParameter() callback and a couple other checks to proactively release texture views when we know that view-related parameters have changed. Then, the validation step is simplified: - Search the texture's list of sampler views (just match the context). - If found, we're done. - Else, create a new sampler view. There will never be old, out-of-date sampler views attached to texture objects that we have to test. Most apps create textures and set the texture parameters once. This make sampler view validation much cheaper for that case. Note that the old texture/sampler comparison code has been converted into a set of assertions to verify that the sampler view is in fact consistent with the texture parameters. This should help to spot any potential regressions. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>