summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi
AgeCommit message (Collapse)Author
2009-09-24tgsi/sse: Pass the lodbias, not zero. More comments.Brian Paul
This fixes the glean/glsl1 "texture2D(), with bias" test when using SSE.
2009-09-10tgsi: use new tgsi_call_record to handle execution mask stacksBrian Paul
This fixes some issues when "return"ing from nested loops/conditionals.
2009-09-04tgsi: Document differencies between vs_1_1 and vs_2_0 for EXPP and LOGP.Michal Krol
2009-09-03aux/tgsi: pull back ureg work from 0.1 branchKeith Whitwell
Manual merge of ureg changes on the branch. Too much unrelated stuff for a proper merge.
2009-09-01tgsi: remove redundant CND0 opcodeKeith Whitwell
Can be implemented with CMP src2, src1, src0
2009-08-24tgsi: Only free temp uregs.José Fonseca
Shorthand. (cherry picked from commit de911220bbbe74cff0c79b260456ff36122b7b5b)
2009-08-24tgsi: Pass pipe_context as a parameter to ureg_create_shader.José Fonseca
Simplifies migration to tgsi_ureg. (cherry picked from commit f574398c07c41cb8d31249a7186fc178ef7d552a)
2009-08-24tgsi: add generic instruction builderKeith Whitwell
When translating an incoming shader (rather than building one from scratch) it's preferable to be able to call a single, generic instruction emitter rather than figuring out which of the opcode-specific functions to call.
2009-08-20tgsi: when printing/dumping programs indent loops and conditionalsBrian Paul
2009-08-20tgsi: check for SOA dependencies in SSE and PPC code generatorsBrian Paul
Fall back to interpreter for now. This doesn't happen very often.
2009-08-20tgsi: handle SOA dependencies for MOV/SWZBrian Paul
SOA dependencies can happen when a register is used both as a source and destination and the source is swizzled. For example: MOV T, T.yxwz; would expand into: MOV t0, t1; MOV t1, t0; MOV t2, t3; MOV t3, t2; The second instruction will produce the wrong result since we wrote to t0 in the first instruction. We need to use an intermediate temporary to fix this. This will take more work to fix for all TGSI instructions. This seems to happen with MOV instructions more than anything else so fix that case now and warn on others. Fixes piglit glsl-vs-loop test (when not using SSE). See bug 23317.
2009-08-20tgsi: added tgsi_full_instruction::Flags fieldBrian Paul
Users of the parser can make use of this.
2009-08-19tgsi: Add missing include.José Fonseca
(cherry picked from commit d2787c02c130b1fe20d0c032d468622f2fdaef79)
2009-08-19tgsi: Fix typo in ureg constant creation.José Fonseca
(cherry picked from commit aa40c9abc7787fdf46cb661a4d0bb8bec513fc63)
2009-08-19tgsi: silence compiler warningKeith Whitwell
2009-08-19tgsi: remove unused function argumentKeith Whitwell
2009-08-19tgsi: add missing functionality to support instructions with labelsKeith Whitwell
Could previously emit opcodes with label arguments, but was no way to patch them with the actual destinations of those labels. Adds two functions: ureg_get_instruction_number - to get the id of the next instruction to be emitted ureg_fixup_label - to patch an emitted label to point to a given instruction number. Need some more complex examples than u_simple_shader, so far this has only been compile-tested.
2009-08-18Merge branch 'mesa_7_5_branch'Brian Paul
2009-08-18tgsi/ppc: we don't implement saturation modes yetBrian Paul
2009-08-18tgsi/sse: we don't implement saturation modes yetBrian Paul
Fixes piglit fp-generic tests/shaders/generic/lrp_sat.fp, bug 23316.
2009-08-17gallium: memset() tgsi_exec_machine to all zeros in tgsi_exec_machine_create()Brian Paul
This fixes invalid values for CondStackTop, LoopStackTop, etc.
2009-08-13tgsi: add simple facility for releasing and reusing temporariesKeith Whitwell
2009-08-13tgsi: rename ureg src/dest convertersKeith Whitwell
Also fix a typo in ureg_src().
2009-08-13tgsi: turn off debuggingKeith Whitwell
2009-08-13tgsi: use REALLOC for growing token poolKeith Whitwell
2009-08-13tgsi: add tgsi_ureg, a simplified tgsi shader builderKeith Whitwell
This is modelled on the nice & easy-to-use facilities we had for building shaders in mesa, eg. in texenvprogram.c and friends. Key points include pass-by-value register structs that can be manipulated in a functional style, eg: negate(swizzle(reg, X,X,X,X)) and per-opcode instruction functions, eg: emit_MOV( p, writemask(dst, 0x1), negate(src)); and similar. Additionally, the interface allows mixed emit of instructions and decls, which are sorted out internally to obey TGSI ordering. Immediates may be emitted at any time and are scanned against existing immediates to try and reduce redundancy. Not all TGSI functionality is accessible through this interface, but most or all of what mesa uses should be.
2009-08-11gallium: fix debug_printf() format stringBrian Paul
2009-08-03tgsi: report opcode name in addition to the number when translation failsBrian Paul
2009-08-03tgsi: added tgsi_get_opcode_name()Brian Paul
2009-07-31Rename TGSI LOOP instruction to better match theri usage.Michal Krol
The LOOP/ENDLOOP pair is renamed to BGNFOR/ENDFOR as its behaviour is similar to a C language for-loop. The BGNLOOP2/ENDLOOP2 pair is renamed to BGNLOOP/ENDLOOP as now there is no name collision.
2009-07-30tgsi: Add proper constraints to sanity.Michal Krol
2009-07-30tgsi: Declare a LOOP register.Michal Krol
The only valid usage for LOOP/ENDLOOP instructions is LOOP[0] as a destination register. The only valid usage for the remaining instructions is LOOP[0].x as an indirect register.
2009-07-30tgsi: Fix number operands for LOOP/ENDLOOP.Michal Krol
2009-07-30tgsi: Document LOOP/ENDLOOP instruction operation.Michal Krol
2009-07-29gallium: fix SSE shadow texture instructionsBrian Paul
When sampling a 2D shadow map we need 3 texcoord components, not 2. The third component (distance from light source) is compared against the texture sample to return the result (visible vs. occluded). Also, enable proper handling of TGSI_TEXTURE_SHADOW targets in Mesa->TGSI translation. There's a possibility for breakage in gallium drivers if they fail to handle the TGSI_TEXTURE_SHADOW1D / TGSI_TEXTURE_SHADOW2D / TGSI_TEXTURE_SHADOWRECT texture targets for TGSI_OPCODE_TEX/TXP instructions, but that should be easy to fix. With these changes, progs/demos/shadowtex.c renders properly again with softpipe.
2009-07-23gallium: remove deprecated TGSI opcodesKeith Whitwell
Various opcodes which can be implemented trivially with other TGSI opcodes, such as matrix multiplication and negation. These were not used by any state tracker or implemented by any of the drivers.
2009-07-23gallium: Fix PPC build.Michel Dänzer
2009-07-22gallium: remove multiple aliases for TGSI opcodesKeith Whitwell
This is a source of ongoing confusion. TGSI has multiple names for opcodes where the same semantics originate in multiple shader APIs. For instance, TGSI includes both Mesa/GLSL and DX/SM30 names for opcodes with the same semantics, but aliases those names to the same underlying opcode number. This makes it very difficult to visually inspect two sets of opcodes (eg in state tracker & driver) and check if they implement the same functionality. This patch arbitarily rips out the versions of the opcodes not currently favoured by the mesa state tracker and leaves us with a single name for each distinct operation.
2009-07-22gallium: simplify tgsi_full_immediate structKeith Whitwell
Remove the need to have a pointer in this struct by just including the immediate data inline. Having a pointer in the struct introduces complications like needing to alloc/free the data pointed to, uncertainty about who owns the data, etc. There doesn't seem to be a need for it, and it is unlikely to make much difference plus or minus to performance. Added some asserts as we now will trip up on immediates with more than four elements. There were actually already quite a few such asserts, but the >4 case could be used in the future to specify indexable immediate ranges, such as lookup tables.
2009-07-20tgsi: get texturing working in vertex shader sse2 pathKeith Whitwell
2009-07-20tgsi: fix regression in indexed const lookupsKeith Whitwell
This function was calling get_input_base() and get_output_base() to get the names of a couple of register to use as temps. Those functions no longer return registers, so adjust it to get the registers elsewhere. This change doesn't address the issue that it's a fairly poor way to grab a register name by calling a function with an apparently unrelated meaning.
2009-07-16tgsi: simplify and fix sse KIL implementationKeith Whitwell
Use sse_movmskps to extract the correct bits of the comparison result for use in updating the killmask. Simplify some logic around identifying the set of necessary comparisons to make.
2009-07-16tgsi: initial texturing support on sse pathKeith Whitwell
Most obvious problem is drawpixels comes out blocky, but this may be an existing issue of KIL on the sse path.
2009-07-16tgsi: make sse function callout mechanism more genericKeith Whitwell
Take a list of arguments rather than hardcoding TEMP_R0.
2009-07-16tgsi: reduce x86 reg usage in tgsi_sse generated programsKeith Whitwell
Pass the tgsi_exec_machine struct in directly and just hold a single pointer to this struct, rather than keeping one for each of its internal members.
2009-07-16tgsi: no need to separately malloc input and output arraysKeith Whitwell
Can now guarantee alignment in the initial allocation of the tgsi exec machine.
2009-07-16gallium: reduce recursive include of tgsi_exec.hKeith Whitwell
A lot of draw code no longer needs to see this header.
2009-07-16tgsi: make function call code in tgsi_sse.c less opaqueKeith Whitwell
Explictly pass src and dst arguments (previously dst argument was also being used as a src). Separate argument handling from the rest of the function call emit.
2009-07-16gallium: proper constructor and destructor for tgsi_exec_machineKeith Whitwell
Centralize the creation, initialization and destruction of this struct. Use align_malloc instead of home-brew alternatives.
2009-07-10tgsi: update some assertionsBrian Paul