aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_text.c
Commit message (Collapse)AuthorAgeFilesLines
* gallium: remove support for predicates from TGSI (v2)Marek Olšák2017-04-011-37/+0
| | | | | | | | | | | Neved used. v2: gallivm: rename "pred" -> "exec_mask" etnaviv: remove the cap gallium: fix tgsi_instruction::Padding Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/tgsi: fix oob access in parse instructionLi Qiang2017-02-071-1/+1
| | | | | | | | | | When parsing texture instruction, it doesn't stop if the 'cur' is ',', the loop variable 'i' will also be increased and be used to index the 'inst.TexOffsets' array. This can lead an oob access issue. This patch avoid this. Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Li Qiang <[email protected]>
* gallium/tgsi: fix overflow in parse propertyLi Qiang2017-01-111-3/+6
| | | | | | | | | | | In parse_identifier, it doesn't stop copying '*pcur' untill encounter the NULL. As the 'ret' has a fixed-size buffer, if the '*pcur' has a long string, there will be a buffer overflow. This patch avoid this. Signed-off-by: Li Qiang <[email protected]> Signed-off-by: Marek Olšák <[email protected]> Reviewed-by: Marc-André Lureau <[email protected]>
* tgsi: add Stream{X,Y,Z,W} fields to tgsi_declaration_semanticNicolai Hähnle2016-12-121-0/+48
| | | | | | | | | | | This is for geometry shader outputs. Without it, drivers have no way of knowing which stream each output is intended for, and have to conservatively write all outputs to all streams. Separate stream numbers for each component are required due to output packing. Reviewed-by: Marek Olšák <[email protected]>
* gallium/tgsi: add support for 64-bit integer immediates.Dave Airlie2016-09-211-0/+44
| | | | | | | | | | This adds support to TGSI for 64-bit integer immediates. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* tgsi: fix coverity out-of-bounds warningRob Clark2016-05-261-0/+3
| | | | | | | | | CID 1271532 (#1 of 1): Out-of-bounds read (OVERRUN)34. overrun-local: Overrunning array of 2 16-byte elements at element index 2 (byte offset 32) by dereferencing pointer &inst.Dst[i]. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* tgsi: print TGSI_PROPERTY_NEXT_SHADER value as string, not an integerBrian Paul2016-05-251-0/+22
| | | | | | | | | Print "GEOM" instead of "2", for example. v2: also update the text parsing code, per Ilia. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* tgsi/text: fix parsing of memory instructionsNicolai Hähnle2016-04-291-13/+27
| | | | | | | Properly handle Target and Format parameters when present. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* tgsi/text: add str_match_name_from_arrayNicolai Hähnle2016-04-291-0/+18
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* tgsi/text: add str_match_format helper functionNicolai Hähnle2016-04-291-9/+22
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-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-13/+13
| | | | Acked-by: Jose Fonseca <[email protected]>
* tgsi: Add support for global / private / input MEMORYHans de Goede2016-03-211-2/+12
| | | | | | | | | | | | | | | | Extend the MEMORY file support to differentiate between global, private and shared memory, as well as "input" memory. "MEMORY[x], INPUT" is intended to access OpenCL kernel parameters, a special memory type is added for this, since the actual storage of these (e.g. UBO-s) may differ per implementation. The uploading of kernel parameters is handled by launch_grid, "MEMORY[x], INPUT" allows drivers to use an access mechanism for parameter reads which matches with the upload method. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> (v1) Reviewed-by: Samuel Pitoiset <[email protected]> (v2)
* tgsi: fix parsing of shared memory declarationsSamuel Pitoiset2016-03-071-1/+3
| | | | | | | | | | The SHARED TGSI keyword is only allowed with TGSI_FILE_MEMORY and not with TGSI_FILE_BUFFER. I have found this by using the nouveau_compiler from command line. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Cc: "11.2" <[email protected]>
* tgsi: show textual format representationIlia Mirkin2016-02-151-3/+10
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* tgsi/ureg: add shared variables support for compute shadersSamuel Pitoiset2016-02-131-0/+3
| | | | | | | | | | | This introduces TGSI_FILE_MEMORY for shared, global and local memory. Only shared memory is currently supported. Changes from v2: - introduce TGSI_FILE_MEMORY Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* tgsi: provide a way to encode memory qualifiers for SSBOIlia Mirkin2016-01-081-0/+27
| | | | | | | | | | Each load/store on most hardware can specify what caching to do. Since SSBO allows individual variables to also have separate caching modes, allow loads/stores to have the qualifiers instead of attempting to encode them in declarations. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* ureg: add buffer support to uregIlia Mirkin2016-01-081-0/+5
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* tgsi: add ureg support for image declsIlia Mirkin2016-01-081-4/+6
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* tgsi: add option to dump floats as hex valuesDave Airlie2015-10-231-1/+10
| | | | | | | | | | | This adds support to the parser to accept hex values as floats, and then adds support to the dumper to allow the user to select to dump float as 32-bit hex numbers. This is required to get accurate values for virgl use of TGSI. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* tgsi: fix parsing of tessellation shader inputs/outputsMarcos Paulo de Souza2015-08-171-1/+16
| | | | | | | | | | Tessellation control shaders write to outputs as OUT[ADDR[0].x][0], make sure to parse the indirect dimension on outputs. Also tess control inputs/outputs and tess eval input declarations need to receive the same treatment as geometry shader inputs. Reviewed-by: Ilia Mirkin <[email protected]>
* tgsi: set implicit array size for tess stagesMarcos Paulo de Souza2015-08-171-1/+5
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* tgsi/text: enable parsing tessellation shadersMarek Olšák2015-05-261-0/+4
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* gallium: remove TGSI_SAT_MINUS_PLUS_ONEMarek Olšák2015-05-201-9/+3
| | | | | | | | It's a remnant of some old NV extension. Unused. I also have a patch that removes predicates if anyone is interested. Reviewed-by: Roland Scheidegger <[email protected]>
* tgsi: fix type-mismatch warningMarek Olšák2015-02-211-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* tgsi: add support for flt64 constantsDave Airlie2015-02-201-0/+22
| | | | | | | | | | | | | | These act like flt32 except they take up two slots, and you can only add 2 x flt64 constants in one slot. The main reason they are different is we don't want to match half a flt64 constants against a flt32 constant in the matching code, we need to make sure we treat both parts of the flt64 as an single structure. Cleaned up printing/parsing by Ilia Mirkin <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium: replace pipe_type enum with tgsi_return_type enumBrian Paul2014-09-221-3/+3
| | | | | | | | | | | The only place the enum pipe_type was used is for the TGSI sampler view return type. So make it a TGSI type. Note: it appears this part of TGSI isn't used by anyone so it may be removed in the future. v2: the new name is tgsi_return_type, not tgsi_type. This means we can drop the previously posted tgsi_type -> tgsi_opcode_type patch. Reviewed-by: Roland Scheidegger <[email protected]>
* tgsi: accept offsets for sample opcodes too in the text parserRoland Scheidegger2014-09-161-3/+2
| | | | | | | | | | sample opcodes are a little oddly represented in the opcode_info, since they don't count as texture instructions - they don't have valid target information, but they may have offsets (unlike "ordinary" texture instructions, the texture token may be optional for them). So just make sure with these opcodes the optional offsets are accepted. Reviewed-by: Jose Fonseca <[email protected]>
* tgsi: add interpolation location modifier support to text parserIlia Mirkin2014-07-091-0/+17
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* tgsi: properly parse indirect dimension references (e.g. for UBOs)Ilia Mirkin2014-07-091-0/+7
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* tgsi: support parsing texture offsets from text tgsi shadersIlia Mirkin2014-05-141-5/+48
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/[email protected]/[email protected]/ s/[email protected]/[email protected]/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\[email protected]/[email protected]/g s/keithw\[email protected]/[email protected]/g s/[email protected]/[email protected]/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/[email protected]/[email protected]/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <[email protected]>
* tgsi: text parser: fix parsing of array in declarationDave Airlie2013-06-181-3/+9
| | | | | | | | | | | I noticed this code didn't work as advertised while doing some passing around of TGSI shaders and trying to reparse them, and things failing. This seems to fix it here for at least the small test case I hacked into a graw test. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* tgsi: replace tgsi_file_names tgsi_file_names[] with tgsi_file_name() functionBrian Paul2013-06-071-1/+1
| | | | | | | | | This change came from the discovery that the STATIC_ASSERT to check that the number of register file strings didn't actually work. Similar changes could be made for the other string arrays in tgsi_string.c Reviewed-by: Jose Fonseca <[email protected]>
* gallium/tgsi: fix valgrind warningMarek Olšák2013-03-261-1/+1
| | | | | | "Conditional jump or move depends on uninitialised value(s)" Reviewed-by: Brian Paul <[email protected]>
* tgsi: use separate structure for indirect address v2Christian König2013-03-191-8/+19
| | | | | | | | | | | | | | To further improve the optimization of source and destination indirect addressing we need the ability to store a reference to the declaration of the addressed operands. Since most of the fields in tgsi_src_register doesn't apply for an indirect addressing operand replace it with a separate tgsi_ind_register structure and so make room for extra information. v2: rename Declaration to ArrayID, put the ArrayID into () instead of [] Signed-off-by: Christian König <[email protected]>
* tgsi: add ArrayID to declarationsChristian König2013-03-191-0/+22
| | | | | | | | Remember which declarations are declared as "arrays" and so can be indirectly addressed. ArrayIDs start at 1, cause for compatibility reasons zero is treaded as no array present. Signed-off-by: Christian König <[email protected]>
* tgsi: remove TGSI_FILE_(IMMEDIATE|TEMP)_ARRAYChristian König2013-03-191-43/+0
| | | | | | Nobody seems to be using it, and only nv50 had a partial implementation. Signed-off-by: Christian König <[email protected]>
* gallivm/tgsi: fix issues with sample opcodesRoland Scheidegger2013-02-161-0/+11
| | | | | | | | We need to encode them as Texture instructions since the NumOffsets field is encoded there. However, we don't encode the actual target in there, this is derived from the sampler view src later. Reviewed-by: Jose Fonseca <[email protected]>
* tgsi: Add support to parse IMM[x] too.José Fonseca2012-10-171-0/+28
| | | | Thanks to Brian for pointing this out.
* gallium/tgsi: fix TGSI text parserMarek Olšák2012-08-151-77/+97
| | | | | | | | The problem was that the string matching succeeded e.g. for "2D" when there was actually "2D_MSAA" and then failed parsing "_MSAA". To prevent similar failures in the future, let's fix this kind of error everywhere.
* gallium/tgsi/text: Ensure ret is initialized in parse_immediate_data.Vinson Lee2012-05-171-0/+4
| | | | | | | Fix uninitialized scalar variable defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/tgsi/text: Replace open-coded integer parsing with parse_int().Francisco Jerez2012-05-111-17/+3
|
* gallium/tgsi/text: Parse immediates of non-float data types.Francisco Jerez2012-05-111-18/+48
|
* gallium/tgsi/text: Make label parsing optional for branch instructions.Francisco Jerez2012-05-111-10/+9
| | | | | Structured branch instructions like IF, ELSE, BGNLOOP, ENDLOOP no longer require a label argument, make it optional for them.
* gallium/tgsi: Introduce the "LOCAL" register declaration modifier.Francisco Jerez2012-05-111-26/+39
| | | | | | | | | | | | | | | | | | | | | | | This change will be useful to implement function parameter passing on top of TGSI. As we don't have a proper stack, a register-based calling convention will be used instead, which isn't necessarily a bad thing given that GPUs often have plenty of registers to spare. Using the same register space for local temporaries and inter-procedural communication caused some inefficiencies, because in some cases the register allocator would lose the freedom to merge temporary values together into the same physical register, leading to suboptimal register (and sometimes, as a side effect, instruction) usage. The LOCAL declaration modifier specifies that the value isn't intended for parameter passing and as a result the compiler doesn't have to give any guarantees of it being preserved across function boundaries. Ignoring the LOCAL flag doesn't change the semantics of a valid program in any way, because local variables are just supposed to get a more relaxed treatment. IOW, this should be a backwards-compatible change.
* gallium/tgsi: Add resource write-back support.Francisco Jerez2012-05-111-0/+4
| | | | | Define a new STORE opcode with a role dual to the LOAD opcode, and add flags to specify that a shader resource is intended for writing.
* gallium/tgsi: Add support for raw resources.Francisco Jerez2012-05-111-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | Normal resource access (e.g. the LOAD TGSI opcode) is supposed to perform a series of conversions to turn the texture data as it's found in memory into the target data type. In compute programs it's often the case that we only want to access the raw bits as they're stored in some buffer object, and any kind of channel conversion and scaling is harmful or inefficient, especially in implementations that lack proper hardware support to take care of it -- in those cases the conversion has to be implemented in software and it's likely to result in a performance hit even if the pipe_buffer and declaration data types are set up in a way that would just pass the data through. Add a declaration flag that marks a resource as typeless. No channel conversion will be performed in that case, and the X coordinate of the address vector will be interpreted in byte units instead of elements for obvious reasons. This is similar to D3D11's ByteAddressBuffer, and will be used to implement OpenCL's constant arguments. The remaining four compute memory spaces can also be understood as raw resources.
* gallium/tgsi: Introduce the compute processor.Francisco Jerez2012-05-111-0/+2
|
* gallium/tgsi: Move interpolation info from tgsi_declaration to a separate token.Francisco Jerez2012-05-111-1/+2
| | | | | | Move Interpolate, Centroid and CylindricalWrap from tgsi_declaration to a separate token -- they only make sense for FS inputs and we need room for other flags in the top-level declaration token.