aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_shader.c
Commit message (Collapse)AuthorAgeFilesLines
* gallium/util: make WRITES_ALL_CBUFS optional in the passthrough fragment shaderMarek Olšák2013-06-131-1/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: don't set _ClampFragmentColor to TRUE if it has no effectMarek Olšák2013-04-061-2/+1
| | | | | | | | This should reduce shader recompilations with drivers that emulate fragment color clamping, because we want the clamping to be enabled only if there is a signed normalized or floating-point colorbuffer. Reviewed-by: Brian Paul <[email protected]>
* gallium/util: fix glClear with MRT by making the FS write to all cbufsMarek Olšák2013-01-151-1/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: don't clamp fragment color with integer colorbufferMarek Olšák2012-08-151-2/+3
|
* st/mesa: do vertex and fragment color clamping in shadersMarek Olšák2012-01-251-0/+7
| | | | | | | | | | | | | | For ARB_color_buffer_float. Most hardware can't do it and st/mesa is the perfect place for a fallback. The exceptions are: - r500 (vertex clamp only) - nv50 (both) - nvc0 (both) - softpipe (both) We also have to take into account that r300 can do CLAMPED vertex colors only, while r600 can do UNCLAMPED vertex colors only. The difference can be expressed with the two new CAPs.
* st/mesa: s/varient/variantBrian Paul2010-12-161-9/+9
|
* Squashed commit of the following (st-mesa-per-context-shaders branch):Brian Paul2010-12-131-105/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 4f106f44a32eaddb6cf3fea6ba5ee9787bff609a Author: Brian Paul <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> 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.
* st/mesa: Remove unnecessary header.Vinson Lee2010-08-061-1/+0
|
* 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
|