summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_atom_shader.c
AgeCommit message (Collapse)Author
2010-12-16st/mesa: s/varient/variantBrian Paul
2010-12-13Squashed commit of the following (st-mesa-per-context-shaders branch):Brian Paul
commit 4f106f44a32eaddb6cf3fea6ba5ee9787bff609a Author: Brian Paul <brianp@vmware.com> Date: Mon Dec 13 14:06:08 2010 -0700 st/mesa: reorganize vertex program translation code Now it looks like the fragment and geometry program code. Also remove the serial number fields from programs. It was used to determine when new translations were needed. Now the variant key is used for that. And the st_program_string_notify() callback removes all variants when the program's code is changed. commit e12d6791c5e4bff60bb2e6c04414b1b4d1325f3e Author: Brian Paul <brianp@vmware.com> Date: Mon Dec 13 13:38:12 2010 -0700 st/mesa: implement geometry shader varients Only needed in order to support per-context gallium shaders. commit c5751c673644808ab069259a852f24c4c0e92b9d Author: Brian Paul <brianp@vmware.com> Date: Sun Dec 12 15:28:57 2010 -0700 st/mesa: restore glDraw/CopyPixels using new fragment program variants Clean up the logic for fragment programs for glDraw/CopyPixels. We now generate fragment program variants for glDraw/CopyPixels as needed which do texture sampling, pixel scale/bias, pixelmap lookups, etc. commit 7b0bb99bab6547f503a0176b5c0aef1482b02c97 Author: Brian Paul <brianp@vmware.com> Date: Fri Dec 10 17:03:23 2010 -0700 st/mesa: checkpoint: implement fragment program variants The fragment programs variants are per-context, as the vertex programs. NOTE: glDrawPixels is totally broken at this point. commit 2cc926183f957f8abac18d71276dd5bbd1f27be2 Author: Brian Paul <brianp@vmware.com> Date: Fri Dec 10 14:59:32 2010 -0700 st/mesa: make vertex shader variants per-context Gallium shaders are per-context but OpenGL shaders aren't. So we need to make a different variant for each context. During context tear-down we need to walk over all shaders/programs and free all variants for the context being destroyed.
2010-08-06st/mesa: Remove unnecessary header.Vinson Lee
2010-06-28mesa: initial support for ARB_geometry_shader4Zack Rusin
laying down the foundation for everything and implementing most of the stuff. linking, gl_VerticesIn and multidimensional inputs are left.
2010-06-10mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul
2010-02-12st/mesa: rename state -> tgsi, updated commentsBrian Paul
2010-02-03st/mesa: Remove unnecessary headers.Vinson Lee
2010-02-01st/mesa: remove duplicate calculation of fp input mappingKeith Whitwell
This was being calculated the same way in two different places. Now just do it in st_translate_fragment_program().
2010-01-31st/mesa: Remove unnecessary headers.Vinson Lee
2010-01-22Merge branch 'mesa_7_7_branch'Brian Paul
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
2010-01-18st/mesa: change instruction count assertion to > 0Brian Paul
Shaders should at least have an END instruction.
2010-01-16st/mesa: Remove unnecessary header from st_atom_shader.c.Vinson Lee
2010-01-11st/mesa: comments, whitespaceBrian Paul
2009-12-19gallium: don't use edgeflags if the app didn't supply themRoland Scheidegger
2009-12-19gallium: fix not generating new vp varient when polygon mode changesRoland Scheidegger
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-18st/mesa: move assert on nr vs insns until after pos_invarient expansionKeith Whitwell
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.
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-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-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-07-11gallium: compare the actual register, not all the inputsZack Rusin
otherwise we decrement indexes for all registers
2009-07-07gallium: fixup register indexes for fog/frontface/point coordZack Rusin
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-06-11mesa: rework vertex shader output / fragment shader input attribute matchingBrian Paul
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]
2009-06-11st/mesa: fix typo s/BFC0/BFC1/Brian Paul
2009-03-13gallium: no need to keep a copy of shader tokens in state trackerKeith Whitwell
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...
2009-02-19mesa: Free the util shaders with the gallium's FREE.José Fonseca
2009-02-12mesa: use new ST_CALLOC_STRUCT() macro in gallium state trackerBrian Paul
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.
2008-08-27gallium: remove old assertionsBrian Paul
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-07-02gallium: fix a bug in vertex program output mappingBrian Paul
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.
2008-05-08gallium: don't free shader.tokens in get_passthrough_fs()Brian Paul
2008-05-07gallium: fix some render to texture bugsBrian Paul
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...
2008-05-07gallium: implement full reference counting for vertex/fragment programsBrian Paul
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
2008-05-02Some changed for non-C99 compilersAlan Hourihane
2008-04-21use cso fs/vs handle functionsKeith Whitwell
2008-04-21gallium: Use CSO cache for shaders.Michel Dänzer
2008-03-22gallium: fix a few more shader-related mem leaksBrian
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-31Fix problem in mapping vertex program outputs (found with "spring" game engine)Brian
If the vertex program writes to an output that's not consumed by the fragment program, map the vp output to an unused slot.
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-19special-case PSIZE tooBrian
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.
2007-11-23gallium: reorg tgsi directories.Michal Krol