summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_program.c
AgeCommit message (Collapse)Author
2009-11-26Merge commit 'origin/st-shader-varients'Roland Scheidegger
Conflicts: src/mesa/state_tracker/st_atom_shader.c src/mesa/state_tracker/st_program.c
2009-11-17Merge branch 'outputswritten64'Ian Romanick
Add a GLbitfield64 type and several macros to operate on 64-bit fields. The OutputsWritten field of gl_program is changed to use that type. This results in a fair amount of fallout in drivers that use programs. No changes are strictly necessary at this point as all bits used are below the 32-bit boundary. Fairly soon several bits will be added for clip distances written by a vertex shader. This will cause several bits used for varyings to be pushed above the 32-bit boundary. This will affect any drivers that support GLSL. At this point, only the i965 driver has been modified to support this eventuality. I did this as a "squash" merge. There were several places through the outputswritten64 branch where things were broken. I foresee this causing difficulties later for bisecting. The history is still available in the branch. Conflicts: src/mesa/drivers/dri/i965/brw_wm.h
2009-11-17mesa: fix assorted compiler warningsBrian Paul
2009-11-15mesa/st: refactor vertex and fragment shader translationKeith Whitwell
Translate vertex shaders independently of fragment shaders. Previously tried to make fragment shader semantic indexes always start at zero and exclude holes. This was unnecessary but meant that vertex shader translation had to be adjusted to take this into account. Now use a fixed scheme for labelling special FS input semantics (color, etc), and another fixed scheme for the generics. With this, vertex shaders can be translated independently of the bound fragment shader, assuming mesa has done its own job and ensured that the vertex shader provides at least the inputs the fragment shader is looking for. The state-tracker didn't attempt to do anything about this previously, so it shouldn't be needed now.
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-11-15mesa/st: don't calculate unused vs input semantic tagsKeith Whitwell
2009-10-05mesa/st: add ST_DEBUG environment variableKeith Whitwell
At last it's possible to turn on tgsi dumps and other debugging in the state tracker without modifying sources...
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-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-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-16st/mesa: add some array index bounds assertionsBrian Paul
2009-07-04Merge branch 'mesa_7_5_branch'Jakob Bornecrantz
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-03Merge branch 'mesa_7_5_branch'Jakob Bornecrantz
Conflicts: src/mesa/main/dlist.c src/mesa/vbo/vbo_save_api.c
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-06-12st/mesa: additional debug code (disabled)Brian Paul
2009-06-08st/mesa: remove invalid assertionBrian Paul
It's legal for ARB_vertex_program programs to not write to result.position. The results are undefined in that case. This assertion was causing us to abort/exit though.
2009-06-08mesa: Allocate tokens from the heap.José Fonseca
The recent increase ST_MAX_SHADER_TOKENS to 8K causes stack overflows on windows. Failure to allocate is not being propagated to the caller. This is not a regression since the previous _mesa_malloc result wasn't being checked as well. Unfortunately it is not easy to fix, as the callers of these functions do not have failure propagation mechanism either, and so on. So leaving a just fixme note for now.
2009-06-04st/mesa: increase ST_MAX_SHADER_TOKENS to 8kBrian Paul
2009-04-28mesa/st: translate VERT_ATTRIB_GENERIC8..15 in st_translate_vertex_programKeith Whitwell
It seems quake4 can hit these attributes sometimes.
2009-04-15mesa: TGSI translation of multiple render targets.José Fonseca
2009-04-08gallium: when using gl_PointCoord ensure we use the correct attribute.Alan Hourihane
2009-02-28mesa: rename, reorder FRAG_RESULT_x tokensBrian Paul
s/FRAG_RESULT_DEPR/FRAG_RESULT_DEPTH/ s/FRAG_RESULT_COLR/FRAG_RESULT/COLOR/ Remove FRAG_RESULT_COLH (NV half-precision) output since we never used it. Next, we might merge the COLOR and DATA outputs (COLOR0, COLOR1, etc).
2009-02-12mesa: consistantly use mesa memory-functions in gallium state trackerBrian Paul
Use _mesa_malloc(), _mesa_free(), etc everywhere, not malloc(), free(), etc. Still using CALLOC_STRUCT() at this point.
2009-01-02gallium: assorted state tracker fixes for > 8 texture samplersBrian Paul
2008-11-24mesa: pass shader centroid/invariant info through to the TGSI shaderBrian Paul
2008-11-06gallium: added st_print_shaders() function to help w/ debuggingBrian Paul
2008-09-26gallium: rename tgsi_translate_mesa_program() to st_translate_mesa_program()Brian Paul
2008-09-17gallium: fix fog vs. pointcoord attribute handling in mesa->TGSI conversionBrian Paul
2008-08-24gallium: refactor/replace p_util.h with util/u_memory.h and util/u_math.hBrian Paul
Also, rename p_tile.[ch] to u_tile.[ch]
2008-08-18gallium: fix vertex program output translation/mapping bugBrian Paul
In some cases, the vertex program output's semantic info didn't match up with the fragment program's input semantic info. This info is now explicitly passed into the st_translate_fragment_program() function.
2008-08-11gallium: added commentBrian Paul
2008-07-28Merge tgsi/exec and tgsi/util directories.José Fonseca
2008-07-03gallium: move, increase ST_MAX_SHADER_TOKENSBrian Paul
2008-06-25mesa: point size arraysBrian Paul
2008-04-24gallium: use cso_destroy_vertex/fragment_shader() functionsBrian Paul
Also, rearrange the st_destroy_context() code a bit to prevent some invalid/NULL ptr derefs during tear-down.
2008-04-22gallium: st_translate_fragment_program() is void nowBrian Paul
The return value was never used.
2008-04-01handle IsPositionInvariant flagBen Skeggs
2008-03-22gallium: fix a few more shader-related mem leaksBrian
2008-03-13gallium: remove semantic info from pipe_shader_stateBrian Paul
Brian's patch to clean up the shader interfaces.
2008-03-11gallium: rework CSO-related code in state trackerBrian
Use the code in cso_context.c rather than st_cache.c. Basically, binding of state objects now goes through the CSO module. But Vertex/fragment shaders go through pipe->bind_fs/vs_state() since they're not cached by the CSO module at this time. Also, update softpipe driver to handle NULL state objects in various places. This happens during context destruction. May need to update other drivers...
2008-02-26gallium: remove input_map[] from pipe_shader_stateBrian
2008-02-15Code reorganization: update build.José Fonseca
Update the Makefiles and includes for the new paths. Note that there hasn't been no separation of the Makefiles yet, and make is jumping all over the place. That will be taken care shortly. But for now, make should work. It was tested with linux and linux-dri. Linux-cell and linux-llvm might require some minor tweaks.
2008-02-12gallium: rename st_fragment_program's fs field to cso to match st_vertex_programBrian
2008-01-31gallium: fix problem in which texcoords and varying vars got mapped to the ↵Brian
same slot This fixes the glsl/bump.c and glsl/texdemo1.c programs
2008-01-14Fix problems with vertex shaders and the private draw module.Brian
The CSO returned by pipe->create_vs_state() can't be passed to the private draw module. That was causing glRasterPos to blow up. Add a 'draw_shader' field to st_vertex_program for use with the private draw module. Change st_context->state.vs type from cso_vertex_shader to st_vertex_program.
2007-12-19new assertionsBrian
2007-12-18turn off TGSI_DEBUGBrian
2007-12-14Don't always declare frag shader INPUT[0] as fragment position.Brian
We were doing this for the sake of softpipe and the tgsi intergrepter since we always need the fragment position and W-coordinate information in order to compute fragment interpolants. But that's not appropriate for hardware drivers. The tgsi interpreter now get x,y,w information from a separate tgsi_exec_vector variable setup by softpipe. The new pipe_shader_state->input_map[] defines how vert shader outputs map to frag shader inputs. It may go away though, since one can also examine the semantic label on frag shader input[0] to figure things out.