aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_scan.c
Commit message (Collapse)AuthorAgeFilesLines
* tgsi/scan: don't set interp flags for inputs only used by INTERP (v2)Marek Olšák2016-10-051-48/+57
| | | | | | | | | | | | (v1 pushed, then reverted) This fixes 9 randomly failing tests on radeonsi: GL45-CTS.shader_multisample_interpolation.render.interpolate_at_centroid.* v2: use input_interpolate[input] (correct) instead of input_interpolate[index] (incorrect) Reviewed-by: Nicolai Hähnle <[email protected]>
* Revert "tgsi/scan: don't set interp flags for inputs only used by INTERP ↵Marek Olšák2016-09-151-57/+48
| | | | | | | | instructions" This reverts commit 524fd55d2d973f50a5d8bc2255684610f5faae32. Reason: https://bugs.freedesktop.org/show_bug.cgi?id=97808
* tgsi/scan: don't set interp flags for inputs only used by INTERP instructionsMarek Olšák2016-09-131-48/+57
| | | | | | | | | radeonsi depends on the interp flags a little bit too much. This fixes 9 randomly failing tests: GL45-CTS.shader_multisample_interpolation.render.interpolate_at_centroid.* Reviewed-by: Nicolai Hähnle <[email protected]>
* tgsi/scan: remember sampler view typesMarek Olšák2016-08-291-0/+4
| | | | Reviewed-by: Brian Paul <[email protected]>
* tgsi/scan: add tgsi_scan_arraysNicolai Hähnle2016-08-171-0/+76
| | | | Reviewed-by: Marek Olšák <[email protected]>
* tgsi/scan: add uses_derivatives (v2)Nicolai Hähnle2016-06-071-0/+30
| | | | | | | | | | | | v2: - TG4 does not calculate derivatives (Ilia) - also handle SAMPLE* instructions (Roland) Cc: 12.0 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (v1) Reviewed-by: Brian Paul <[email protected]> (v1) Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* draw: stop using CULLDIST semantic.Dave Airlie2016-05-231-2/+1
| | | | | | | | | | | The way the HW works doesn't really fit with having two semantics for this. The GLSL compiler emits 2 vec4s and two properties, this makes draw use those instead of CULLDIST semantics. Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* tgsi: s/Elements/ARRAY_SIZE/Brian Paul2016-04-271-4/+4
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* gallium: use PIPE_SHADER_* everywhere, remove TGSI_PROCESSOR_*Marek Olšák2016-04-221-16/+16
| | | | Acked-by: Jose Fonseca <[email protected]>
* tgsi/scan: add an assert for the size of the samplers_declared bitfieldNicolai Hähnle2016-04-071-1/+2
| | | | | | | The literal 1 is a (signed) int, and shifting into the sign bit is undefined in C, so change occurences of 1 to 1u. Reviewed-by: Brian Paul <[email protected]>
* tgsi: skip texture query opcodes when examining texture targetsBrian Paul2016-03-311-1/+15
| | | | | | | | | | Should fix the assertion in piglit spec@arb_gpu_shader5@texturegather@fs-r-none-shadow-2d when the TXQ instruction specifies a 2D target but the sampler view was declared as SHADOW2D. Reviewed-by: Michel Dänzer <[email protected]> Tested-by: Michel Dänzer <[email protected]>
* tgsi: (trivial) only verify target for is_tex instructionsRoland Scheidegger2016-03-301-8/+7
| | | | | | | | | | | d3d10 state tracker does not encode (valid) target (only offsets are really used from the texture bits), since that information always comes from the sview dcl, and not the instruction (note the meaning of target is actually slightly different between gl and d3d10 in any case, because d3d10 target does never include shadow bit). Also move the msaa sampler identification as well - would need to set that on the sview not sampler, so while this does not fix it make it at least obvious it won't work with sample instructions.
* tgsi: simplify tgsi_shader_info::is_msaa_sampler checkingBrian Paul2016-03-291-3/+2
| | | | | | | | | We assert that fullinst->Instruction.Texture != 0 above so no need to check it in the conditional. We also have the fullinst->Texture.Texture value in a local variable, so use it. Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* tgsi: collect texture sampler target info in tgsi_scan_shader()Brian Paul2016-03-291-2/+36
| | | | | | | | | | | | | | | Texture sample instructions specify a sampler unit and texture target such as "1D", "2D", "CUBE", etc. Sampler view declarations also specify the sampler unit and texture target. This patch checks that the texture instructions agree with the declarations and collects the texture target type for each sampler unit. v2: only compare instruction's texture target to the sampler view declaration target if the instruction is a TEX instruction, not a SAMPLE instruction. Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* tgsi/scan: add writes_memory to flag presence of stores or atomicsNicolai Hähnle2016-03-211-4/+8
| | | | Reviewed-by: Marek Olšák <[email protected]>
* tgsi/scan: track which shader images are really buffersNicolai Hähnle2016-03-211-0/+3
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* tgsi/scan: add images_writemaskNicolai Hähnle2016-03-211-2/+16
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* tgsi/scan: count memory instructionsMarek Olšák2016-03-011-0/+19
| | | | | | for radeonsi Reviewed-by: Brian Paul <[email protected]>
* tgsi/scan: handle holes between VS inputs, assert-fail in other casesMarek Olšák2016-02-231-1/+9
| | | | | | | | | | | | | | | | "st/mesa: overhaul vertex setup for clearing, glDrawPixels, glBitmap" added a vertex shader declaring IN[0] and IN[2], but not IN[1]. Drivers relying on tgsi_shader_info can't handle holes in declarations, because tgsi_shader_info doesn't track that. This is just a quick workaround meant for stable that will work for vertex shaders. This fixes radeonsi DrawPixels and CopyPixels crashes. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* tgsi: minor whitespace fixes in tgsi_scan.cBrian Paul2016-02-081-4/+2
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* tgsi: s/true/TRUE/ in tgsi_scan.cBrian Paul2016-02-081-13/+13
| | | | | | | Just to be consistent. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* tgsi: use switches instead of big if/else ifsBrian Paul2016-02-081-24/+36
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* tgsi: break gigantic tgsi_scan_shader() function into piecesBrian Paul2016-02-081-364/+375
| | | | | | | New functions for examining instructions, declarations, etc. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* tgsi/scan: add tgsi_shader_info::reads_samplemaskMarek Olšák2016-02-021-0/+2
|
* tgsi/scan: update for POSITION and FACE sytem valuesMarek Olšák2016-01-081-1/+4
| | | | | Reviewed-by: Edward O'Callaghan <[email protected] Reviewed-by: Brian Paul <[email protected]>
* tgsi/scan: set which color components are read by a fragment shaderMarek Olšák2016-01-071-8/+22
| | | | | | This will be used by radeonsi. Reviewed-by: Nicolai Hähnle <[email protected]>
* tgsi/scan: fix tgsi_shader_info::reads_zMarek Olšák2016-01-071-2/+3
| | | | | | This has no users in Mesa. Reviewed-by: Nicolai Hähnle <[email protected]>
* tgsi/scan: set if a fragment shader writes sample maskMarek Olšák2016-01-071-0/+2
| | | | | | This will be used by radeonsi. Reviewed-by: Nicolai Hähnle <[email protected]>
* tgsi/scan: add flag colors_writtenMarek Olšák2015-12-111-0/+3
| | | | | | | This is a prerequisite for the following r600g fix. Cc: 11.0 11.1 <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* tgsi/scan: use properties for clip/cull distance writemasksMarek Olšák2015-10-201-14/+14
| | | | | | No changes needed for drivers already relying on tgsi_shader_info. Reviewed-by: Brian Paul <[email protected]>
* tgsi/scan: add info about declared samplers (v2)Marek Olšák2015-10-091-0/+2
| | | | v2: get it from declarations, not instructions
* tgsi: add const qualifier to silence warningBrian Paul2015-10-061-1/+1
| | | | Trivial.
* tgsi/scan: add interpolation info into tgsi_shader_infoMarek Olšák2015-10-031-2/+89
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* tgsi/scan: add support to figure out max nesting depthRob Clark2015-09-131-0/+16
| | | | | | | | | Sometimes a useful thing for compilers (or, for example, tgsi_to_nir) to know. And pretty trivial for scan to figure this out for us. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* tgsi/scan: add uses_doubles to tgsi scannerDave Airlie2015-09-021-0/+4
| | | | | | | This allows drivers to work out if a shader contains any double opcodes easily. Signed-off-by: Dave Airlie <[email protected]>
* draw,tgsi: Assume TGSI_PROPERTY_GS_INVOCATIONS default of 1.Jose Fonseca2015-06-231-0/+1
| | | | | | | | | If the shader doesn't specify number of invocations, assume one. This fixes geometry shaders on state trackers other than Mesa (and probably graw tests too.) Trivial.
* draw/tgsi: implement geom shader invocation support.Dave Airlie2015-06-231-0/+2
| | | | | | | | This is just for softpipe, llvmpipe won't work without some changes. Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* tgsi/scan: get more information about arrays and handle arrays correctly (v2)Marek Olšák2015-06-051-3/+21
| | | | v2: use less memory for the information
* gallium: rename TGSI tessellation processor types to match pipe shader namesMarek Olšák2015-05-261-4/+4
| | | | | | I forgot to do this when pushing the interface changes. Reviewed-by: Ilia Mirkin <[email protected]>
* tgsi/scan: allow scanning tessellation shadersIlia Mirkin2015-05-161-1/+5
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* tgsi: track max array per fileRob Clark2015-01-071-0/+2
| | | | | | | | | | | | NOTE IN[] and OUT[] don't need (have?) ArrayID's.. and TEMP[] can optionally have them. So we implicitly assume that ArrayID==0 always exists for each file. This is why array_max[file] is never less than zero. You can tell from indirect_files(_read/written) if the legacy array- id zero was actually used. Signed-off-by: Rob Clark <[email protected]>
* tgsi: keep track of read vs written indirectsRob Clark2015-01-071-0/+2
| | | | | | | | | | At least temporarily, I need to fallback to old compiler still for relative dest (for freedreno), but I can do relative src temp. Only a temporary situation, but seems easy/reasonable for tgsi-scan to track this. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* tgsi: add uses_centroid into tgsi_shader_infoMarek Olšák2015-01-071-0/+3
|
* gallium: add TGSI_SEMANTIC_VERTEXID_NOBASE and TGSI_SEMANTIC_BASEVERTEXRoland Scheidegger2014-12-161-0/+6
| | | | | | | | | | | | | | | | | | | Plus a new PIPE_CAP_VERTEXID_NOBASE query. The idea is that drivers not supporting vertex ids with base vertex offset applied (so, only support d3d10-style vertex ids) will get such a d3d10-style vertex id instead - with the caveat they'll also need to handle the basevertex system value too (this follows what core mesa already does). Additionally, this is also useful for other state trackers (for instance llvmpipe / draw right now implement the d3d10 behavior on purpose, but with different semantics it can just do both). Doesn't do anything yet. And fix up the docs wrt similar values. v2: incorporate feedback from Brian and others, better names, better docs. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* tgsi: add tgsi_shader_info::writes_clipvertexMarek Olšák2014-12-101-0/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* tgsi: add clip and cull distance writemasks into tgsi_shader_infoMarek Olšák2014-12-101-0/+4
| | | | Reviewed-by: Brian Paul <[email protected]>
* tgsi: add tgsi_shader_info::writes_psizeMarek Olšák2014-12-101-0/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* draw: fixes for vertex shaders outputting layer or viewport indexRoland Scheidegger2014-11-191-9/+6
| | | | | | | | | | Mostly add a couple cases so we don't just check gs for this. There's only one gotcha, the built-in vp transform in the llvm vs can't handle it (this would be fixable though non-trivial due to vp index being non-constant for the SoA outputs, but we don't use it if there's a gs neither - the whole clip/vp transform integration there is suboptimal). Reviewed-by: Jose Fonseca <[email protected]>
* tgsi: change tgsi_shader_info::properties to a one-dimensional arrayMarek Olšák2014-10-041-3/+2
| | | | | | Reviewed-by: Roland Scheidegger <[email protected]> v2: fix svga too
* tgsi: remove some not so useful variables from tgsi_shader_infoMarek Olšák2014-10-041-8/+0
|