aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_shader.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: add new FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC fragment program inputsBrian Paul2009-07-291-17/+0
| | | | | | | | | | 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...
* gallium: compare the actual register, not all the inputsZack Rusin2009-07-111-1/+1
| | | | otherwise we decrement indexes for all registers
* gallium: fixup register indexes for fog/frontface/point coordZack Rusin2009-07-071-3/+12
|
* gallium: more fog extraction fixesZack Rusin2009-07-061-14/+7
| | | | | fix the cases when fog coord/front face/point coord are used in the same shader.
* gallium: fix the front face semanticsZack Rusin2009-07-011-2/+17
| | | | | | | | 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.
* mesa: rework vertex shader output / fragment shader input attribute matchingBrian Paul2009-06-111-20/+33
| | | | | | | | | | | | | | | | | | | | Before, if a vertex shader's outputs didn't exactly match a fragment shader's inputs we could wind up with invalid TGSI shader declarations. For example: Before patch: DCL OUT[0], POSITION DCL OUT[1], COLOR[1] DCL OUT[2], GENERIC[0] DCL OUT[3], GENERIC[0] <- note duplicate [0] DCL OUT[4], GENERIC[2] After patch: DCL OUT[0], POSITION DCL OUT[1], COLOR[1] DCL OUT[2], GENERIC[0] DCL OUT[3], GENERIC[1] DCL OUT[4], GENERIC[2]
* st/mesa: fix typo s/BFC0/BFC1/Brian Paul2009-06-111-2/+2
|
* gallium: no need to keep a copy of shader tokens in state trackerKeith Whitwell2009-03-131-6/+1
| | | | | | | | Any driver who needs a copy of the shader tokens must organize to do so itself. This has been the case for a long time, but there was still defensive code in the state tracker, which is now removed. Any bugs resulting from this need to be fixed in the offending driver...
* mesa: Free the util shaders with the gallium's FREE.José Fonseca2009-02-191-1/+1
|
* mesa: use new ST_CALLOC_STRUCT() macro in gallium state trackerBrian Paul2009-02-121-1/+1
|
* mesa: consistantly use mesa memory-functions in gallium state trackerBrian Paul2009-02-121-2/+2
| | | | | Use _mesa_malloc(), _mesa_free(), etc everywhere, not malloc(), free(), etc. Still using CALLOC_STRUCT() at this point.
* gallium: remove old assertionsBrian Paul2008-08-271-5/+0
|
* gallium: fix vertex program output translation/mapping bugBrian Paul2008-08-181-10/+50
| | | | | | 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.
* gallium: fix a bug in vertex program output mappingBrian Paul2008-07-021-9/+24
| | | | | | | Need to translate VERT_RESULT_PSIZ, BFC0, BFC1 to TGSI shader output slots after all other attributes have been handled. This fixes a bug where generic vertex program outputs (varying vars) could get mapped to the same slot at point size or back-face colors.
* gallium: don't free shader.tokens in get_passthrough_fs()Brian Paul2008-05-081-0/+2
|
* gallium: fix some render to texture bugsBrian Paul2008-05-071-1/+25
| | | | | | | | | | | | | | | Before, we were sometimes rendering into a stale texture because st_finalize_texture() would discard the old texture and create a new one. Moved st_update_framebuffer atom after texture validation so that we can create a new renderbuffer surface if the texture changes. Also, split texture validation into two parts: finalize_textures and update_textures. Do finalize_textures first to avoid getting into the situtation where we're doing a pipe->surface_copy() mid-way through state validation. Some debug code still in place, but disabled...
* gallium: implement full reference counting for vertex/fragment programsBrian Paul2008-05-071-2/+5
| | | | | | | | Use _mesa_reference_vert/fragprog() wherever we assign program pointers. Fixes a memory corruption bug found with glean/api2 test. Another memory bug involving shaders yet to be fixed... Picked from gallium-0.1
* Some changed for non-C99 compilersAlan Hourihane2008-05-021-5/+5
|
* use cso fs/vs handle functionsKeith Whitwell2008-04-211-2/+2
|
* gallium: Use CSO cache for shaders.Michel Dänzer2008-04-211-2/+2
|
* gallium: fix a few more shader-related mem leaksBrian2008-03-221-28/+15
|
* gallium: rework CSO-related code in state trackerBrian2008-03-111-21/+7
| | | | | | | | | | 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...
* gallium: remove input_map[] from pipe_shader_stateBrian2008-02-261-1/+1
|
* Code reorganization: update build.José Fonseca2008-02-151-1/+1
| | | | | | | | | 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.
* gallium: rename st_fragment_program's fs field to cso to match st_vertex_programBrian2008-02-121-4/+4
|
* Fix problem in mapping vertex program outputs (found with "spring" game engine)Brian2008-01-311-4/+6
| | | | | If the vertex program writes to an output that's not consumed by the fragment program, map the vp output to an unused slot.
* Fix problems with vertex shaders and the private draw module.Brian2008-01-141-10/+13
| | | | | | | | 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.
* special-case PSIZE tooBrian2007-12-191-1/+6
|
* Don't always declare frag shader INPUT[0] as fragment position.Brian2007-12-141-6/+19
| | | | | | | | | | | | 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.
* gallium: reorg tgsi directories.Michal Krol2007-11-231-1/+1
|
* simplify code which access the current vertex/fragment shadersBrian2007-10-291-23/+4
|
* Move mesa_to_tgsi.[ch] to state_trackerBrian2007-10-271-1/+1
|
* Get rid of ST_NEW_SHADER flag and the dependency on _NEW_PROGRAMZack Rusin2007-10-031-2/+2
| | | | which is being hit all the time. Done by Keith really.
* assert that program length > 1 (some code, plus END)Brian2007-10-021-0/+3
|
* fix a few vert/frag program items to get i915 driver going againBrian2007-10-011-1/+4
|
* fix bug causing unnecessary translationsBrian2007-09-281-1/+1
|
* Instead of linked program pairs, keep a list of vertex programs translated ↵Brian2007-09-281-226/+111
| | | | for each fragment program.
* check for _NEW_PROGRAM mesa state (fixes arbfplight)Brian2007-09-261-1/+1
|
* some clean-up of ST_NEW_ shader flagsBrian2007-09-251-1/+1
|
* vertex/fragment shader state and linkingBrian2007-09-251-0/+422