aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_shader.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: initial support for ARB_geometry_shader4Zack Rusin2010-06-281-0/+42
| | | | | | laying down the foundation for everything and implementing most of the stuff. linking, gl_VerticesIn and multidimensional inputs are left.
* mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-101-1/+1
|
* st/mesa: rename state -> tgsi, updated commentsBrian Paul2010-02-121-1/+1
|
* st/mesa: Remove unnecessary headers.Vinson Lee2010-02-031-1/+0
|
* st/mesa: remove duplicate calculation of fp input mappingKeith Whitwell2010-02-011-17/+1
| | | | | This was being calculated the same way in two different places. Now just do it in st_translate_fragment_program().
* st/mesa: Remove unnecessary headers.Vinson Lee2010-01-311-1/+0
|
* Merge branch 'mesa_7_7_branch'Brian Paul2010-01-221-2/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gallium/auxiliary/draw/draw_context.c src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c src/gallium/auxiliary/pipebuffer/Makefile src/gallium/auxiliary/pipebuffer/SConscript src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c src/gallium/auxiliary/tgsi/tgsi_scan.c src/gallium/drivers/i915/i915_surface.c src/gallium/drivers/i915/i915_texture.c src/gallium/drivers/llvmpipe/lp_setup.c src/gallium/drivers/llvmpipe/lp_tex_sample_c.c src/gallium/drivers/llvmpipe/lp_texture.c src/gallium/drivers/softpipe/sp_prim_vbuf.c src/gallium/state_trackers/xorg/xorg_dri2.c src/gallium/winsys/drm/intel/gem/intel_drm_api.c src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c src/gallium/winsys/drm/radeon/core/radeon_drm.c src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c src/mesa/state_tracker/st_cb_clear.c
| * st/mesa: change instruction count assertion to > 0Brian Paul2010-01-181-1/+1
| | | | | | | | Shaders should at least have an END instruction.
| * st/mesa: Remove unnecessary header from st_atom_shader.c.Vinson Lee2010-01-161-1/+0
| |
| * st/mesa: move assert on nr vs insns until after pos_invarient expansionKeith Whitwell2009-12-181-2/+0
| | | | | | | | | | | | It is possible to have a 1-instruction vertex shader before expanding pos_invarient. Not sure what this assert achieved, but at least move it where it is correct.
| * Merge branch 'outputswritten64'Ian Romanick2009-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | st/mesa: comments, whitespaceBrian Paul2010-01-111-8/+15
| |
* | gallium: don't use edgeflags if the app didn't supply themRoland Scheidegger2009-12-191-4/+6
| |
* | gallium: fix not generating new vp varient when polygon mode changesRoland Scheidegger2009-12-191-1/+1
| |
* | gallium: more work for edgeflags changesRoland Scheidegger2009-12-141-2/+2
| | | | | | | | | | fixes, cleanups, etc. not working yet
* | gallium: first steps to treat edgeflags as regular vertex elementKeith Whitwell2009-12-091-1/+10
| | | | | | | | | | | | | | | | | | | | 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).
* | mesa/st: refactor vertex and fragment shader translationKeith Whitwell2009-11-151-239/+87
|/ | | | | | | | | | | | | | | | | 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.
* 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.