summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_mesa_to_tgsi.c
AgeCommit message (Collapse)Author
2010-04-05st/mesa: reformattingBrian Paul
2010-04-05st/mesa: put fragment wpos code into separate functionBrian Paul
2010-02-19Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg
2010-02-09Merge branch 'gallium-nopointsizeminmax'Roland Scheidegger
Conflicts: src/gallium/drivers/nv10/nv10_state.c src/gallium/drivers/nv20/nv20_state.c src/gallium/drivers/nv50/nv50_program.c
2010-02-09st/mesa: check for PROG_PARAM_BIT_CYL_WRAP flagBrian Paul
2010-02-05st/mesa: allow negative index for PROGRAM_STATE_VARBrian Paul
The piglit vp-address-01 test uses negative address-relative offsets. In this test we're indexing into PROGRAM_STATE_VAR which, in turn, contains references to ENV vars. We previously fixed this issue for PROGRAM_CONSTANT. piglit/vp-address-01 (the version from Feb 5) passes now. (cherry picked from commit 64be837b0b171c44f47a3c0b83f566d292ffff50)
2010-02-04gallium: add point size clamp to implementation limits in vertex shaderRoland Scheidegger
The point size min/max registers (unused by mesa state tracker) were removed since most hardware couldn't do much with them. However, we don't want to have to rely on hw to do point size clamping correctly to implementation dependent limits, hence have to do that in the vertex shader. This should also solve a potential problem with (non-AA) points smaller than 1.0 which according to OGL still have size 1.0. Note that OGL point rendering is odd, in particular point sprites are rasterized differently to points. Some hardware might support those different modes, but in any case the different clamping values used for smooth/multisampled/sprite enabled points might help a bit for hw which rasterizes points the same as point sprites. Also tweak mesa's ff to vertex shader translation so don't have to clamp twice in case of point attenuation.
2010-01-31st/mesa: Remove unnecessary headers.Vinson Lee
2010-01-29st/mesa: Gallium support for ARB_fragment_coord_conventions (v4)Luca Barbieri
Changes in v4; - Implemented Brian Paul's style suggestions Changes in v3: - Use positive caps instead of negative ones Changes in v2: - Updated formatting The state tracker will use the TGSI convention properties if the hardware exposes the appropriate capability, and otherwise adjust WPOS itself. This will also fix some drivers that were previously broken due to their incorrect, inadvertent, use of conventions other than upper_left+half_integer.
2010-01-18st/mesa: updated comments and whitespaceBrian Paul
2010-01-18st/mesa: fix memory leak in st_translate_mesa_programMarcin Slusarz
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-06Merge remote branch 'origin/mesa_7_7_branch'José Fonseca
Conflicts: configs/default src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c src/mesa/main/version.h
2010-01-05st/mesa: fix broken translation of negative register indexesBrian Paul
A src register's index can be negative if we're doing indirect addressing into the constant buffer. Ex: MOV OUT[1], CONST[ADDR[0].x-3] This fixes the piglit vp-arl-neg-array.vpfp test. Before this change we were going out of bounds of the t->constants[] array and getting garbage that later triggered an assertion.
2010-01-05st/mesa: added PROGRAM_LOCAL_PARAM case in src_register()Brian Paul
Fixes piglit vpfp-generic arl.vpfp failure when using gallium.
2009-12-18fix debug output mising from edgeflag changesRoland Scheidegger
2009-12-18gallium: fix mesa to tgsi translation for edgeflagsRoland Scheidegger
test apps (progs/trivial/tri-edgeflags and similar) seem to work now
2009-12-14gallium: more work for edgeflags changesRoland Scheidegger
fixes, cleanups, etc. not working yet
2009-12-09gallium: first steps to treat edgeflags as regular vertex elementKeith Whitwell
The idea here is to eliminate the set_edgeflags() call in pipe_context by treating edgeflags as a regular vertex element. Edgeflags provoke special treatment in hardware, which means we need to label them in some way, in this case we'll be passing them through the vertex shader and labelling the vertex shader output with a new TGSI semantic (TGSI_SEMANTIC_EDGEFLAG).
2009-12-07st/mesa: remove debug codeBrian Paul
2009-12-07st/mesa: negate DDY to match GL semanticsBrian Paul
This fixes the regression from commit 884007546c98b1779bf266ec5111b1e7e2b68b2e Fixes bug 25456 (piglit derivs regression).
2009-12-02Merge branch 'mesa_7_7_branch'Jakob Bornecrantz
2009-12-01st/mesa: updated emit_swz() commentBrian Paul
2009-11-30st/mesa: handle front/back-face +1/-1 vs. 1/0 conversionBrian Paul
Fixes progs/glsl/twoside.c demo.
2009-11-15mesa/st: don't calculate unused output_flags data eitherKeith Whitwell
2009-11-15mesa/st: don't calculate unused input_flags dataKeith Whitwell
2009-10-23gallium: remove the swizzling parts of ExtSwizzleKeith Whitwell
These haven't been used by the mesa state tracker since the conversion to tgsi_ureg, and it seems that none of the other state trackers are using it either. This helps simplify one of the biggest suprises when starting off with TGSI shaders.
2009-10-23gallium: remove noise opcodesKeith Whitwell
Provide a dummy implementation in the GL state tracker (move 0.5 to the destination regs). At some point, a motivated person could add a better implementation of noise. Currently not even the nvidia binary drivers do anything more than this. In any case, the place to do this is in the GL state tracker, not the poor driver.
2009-10-07mesa/st: add missing mesa constant file nameKeith Whitwell
There are many different names for constants in mesa, we were missing one since the ureg rewrite.
2009-09-21mesa: Ensure TGSI tokens are freed with gallium's free.José Fonseca
To avoid breaking the gallium's builtin malloc debugging.
2009-09-15st/mesa: disable accidentally committed _mesa_print_program() callBrian Paul
2009-09-14st/mesa: minor whitespace, comment clean-upsBrian Paul
2009-09-14mesa/st: remove dead commentKeith Whitwell
2009-09-14st/mesa: convert to new tgsi_ureg mechanism for shader emitKeith Whitwell
Should be easier to read and work with than the older ways of emitting TGSI tokens. Also, emit simpler TGSI than previously: - translate away source and dest extended modifiers - translate away the SWZ opcode
2009-09-12mesa: remove unused SATURATE_PLUS_MINUS_ONE flagKeith Whitwell
Never set in mesa. Remove from tgsi translation as well.
2009-08-12Merge branch 'new-frag-attribs'Brian Paul
This branch introduces new FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC fragment program inputs for GLSL gl_FrontFacing and gl_PointCoord. Before, these attributes were packed with the FOG attribute. That made things complicated elsewhere.
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-29mesa: add new FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC fragment program inputsBrian Paul
Previously, the FOGC attribute contained the fragment fog coord, front/back- face flag and the gl_PointCoord.xy values. Now each of those things are separate fragment program attributes. This simplifies quite a few things in Mesa and gallium. Need to test i965 driver and fix up point coord handling in the gallium/draw module...
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-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-10st/mesa: implement indirect addressing for destination registersBrian Paul
2009-07-06gallium: more fog extraction fixesZack Rusin
fix the cases when fog coord/front face/point coord are used in the same shader.
2009-07-01gallium: fix the front face semanticsZack Rusin
mesa allocates both frontface and pointcoord registers within the fog coordinate register, by using swizzling. to make it cleaner and easier for drivers we want each of them in its own register. so when doing compilation from the mesa IR to tgsi allocate new registers for both and add new semantics to the respective declarations.
2009-04-14mesa: merge the prog_src_register::NegateBase and NegateAbs fieldsBrian Paul
There's really no need for two negation fields. This came from the GL_NV_fragment_program extension. The new, unified Negate bitfield applies after the absolute value step.
2009-03-20gallium: remove use of origin_lower_leftBrian Paul
This was used to indicate OpenGL's lower-left origin for fragment window coordinates for polygon stipple and gl_FragCoord. Now: - fragment coordinate origin is always upper-left corner - GL polygon stipple is inverted and shifted before given to gallium - GL fragment programs that use INPUT[WPOS] are modified to use an inverted window coord which is placed in a temp register. Note: the origin_lower_left field still exists in pipe_rasterizer_state. Remove it when all the drivers, etc. no longer reference it.
2009-03-07mesa: gl_register_file enum typedefBrian Paul
2009-02-20gallium: use the TGSI_TEXTURE_SHADOW1D/2D/RECT texture types for TEX ↵Brian Paul
instructions These texture types were defined but never put to use. For the time being though, the Mesa->TGSI translater isn't emitting these targets. See the XXX comment in map_texture_target().
2009-02-18util: Move p_debug.h into util module.José Fonseca
The debug functions depend on several util function for os abstractions, and these depend on debug functions, so a seperate module is not possible.
2009-02-17mesa: remove old comment as it's fixed elsewhere now.Alan Hourihane
2009-02-10Missing: tgsi: Fix build -- rename Size to NrTokens.Patrice Mandin
2009-01-02gallium: assorted state tracker fixes for > 8 texture samplersBrian Paul