summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_fragprog.c
Commit message (Collapse)AuthorAgeFilesLines
* swrast: Remove support for the NV_fragment_program extension.Kenneth Graunke2012-10-161-5/+0
| | | | | | | | No hardware drivers support this, it's obsolete, and unlikely to be useful without NV_vertex_program, which is gone now. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* swrast: Support sampler object for texture fetching statePauli Nieminen2012-08-011-7/+10
| | | | | | | | | | | | swrast needs to pass sampler object into all texture fetching functions to use correct sampling state when sampler object is bound to the unit. The changes were made using half manual regular expression replace. v2: Fix NULL deref in _swrast_choose_triangle(), because the _Current values aren't set yet, so we need to look at our texObj2D. (anholt) Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Only avoid empty _TexEnvProgramsIan Romanick2012-02-151-1/+2
| | | | | | | | | | | | | | If the generated shader for _TexEnvProgram is empty, force the use of the fixed-function code. Otherwise, go ahead and use the shader. This works around a mysterious issue on i915 where fixed-function software fallbacks are not working correctly. This isn't really the fix we want, but it works around the issue. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876
* swrast: Fix fixed-function fragment processingChad Versace2012-01-271-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On i965, _mesa_ir_link_shader is never called. As a consequence, the current fragment program (ctx->FragmentProgram->_Current) exists but is invalid because it has no instructions. Yet swrast continued to attempt to use the empty program. To avoid using the empty program, this patch 1) defines a new function, _swrast_use_fragment_program, which checks if the current fragment program exists and differs from the fixed function fragment program, and, when appropriate, 2) replaces checks of the form if (ctx->FragmentProgram->_Current == NULL) with if (_swrast_use_fragment_program(ctx)) Fixes the following oglconform regressions on i965/gen6: api-fogcoord(basic.allCases.log) api-mtexcoord(basic.allCases.log) api-seccolor(basic.allCases.log) api-texcoord(basic.allCases.log) blend-separate(basic.allCases) colorsum(basic.allCases.log) The tests were ran with the GLXFBConfig: visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat ---------------------------------------------------------------------------- 0x021 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None (Note: I originally believed that the hunk in _swrast_update_fragment_program was unnecessary. But it is required to fix blend-separate.) Note: This is a candidate for the 8.0 branch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327 Reveiwed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* swrast: fix float->uint conversion of gl_FragDepthBrian Paul2011-10-191-1/+2
| | | | | | | | | Using IROUND() to convert a float depth value to a 32-bit uint Z value. didn't work (it returns a signed value). Just use a cast instead Fixes piglit fbo-depth-array failure with swrast. Note: this is a candidate for the 7.11 branch.
* mesa: s/INLINE/inline/Brian Paul2011-10-011-1/+1
| | | | | | | INLINE is still seen in some files (some generated files, etc) but this is a good start. Acked-by: Kenneth Graunke <[email protected]>
* mesa: move gl_texture_image::Width/Height/DepthScale fields to swrastBrian Paul2011-09-221-2/+4
| | | | | | | These fields were only used for swrast so move them into swrast_texture_image. Reviewed-by: Ian Romanick <[email protected]>
* mesa: move sampler state into new gl_sampler_object typeBrian Paul2011-04-101-3/+3
| | | | | | gl_texture_object contains an instance of this type for the regular texture object sampling state. glGenSamplers() generates new instances of gl_sampler_object which can override that state with glBindSampler().
* Track separate programs for each stageIan Romanick2010-10-271-1/+1
| | | | | The assumption is that all stages are the same program or that varyings are passed between stages using built-in varyings.
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-5/+5
|
* swrast: Reduce header file inclusion in s_fragprog.h.Vinson Lee2010-08-071-0/+1
| | | | | | | | | s_fragprog.h Include mtype.h for GLcontext symbol. Include s_span.h for SWspan symbol. s_fragprog.c Include s_context.h now that it is removed from s_fragprog.h.
* swrast: Remove unnecessary headers.Vinson Lee2010-07-311-1/+0
|
* mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-101-1/+1
|
* mesa: replace _mesa_bzero() with memset()Brian Paul2010-02-191-2/+1
|
* swrast: silence double->float assignment warningsBrian Paul2010-01-271-3/+3
| | | | Reported by Karl Schultz.
* swrast: Implement ARB_fragment_coord_conventions but don't enable.Eric Anholt2010-01-261-0/+10
| | | | | | | | | | | This brings swrast's support up to the state of gallium, and fixes the default center behavior of fragment.position.xy in piglit fp-arb-fragment-coord-conventions-none. The extension is not enabled currently because the GLSL part of the extension isn't supported, so piglit glsl-arb-fragment-coord-conventions-define fails as would any serious test of the GLSL part.
* swrast: Remove unnecessary header from s_fragprog.c.Vinson Lee2010-01-121-1/+0
|
* Merge branch 'outputswritten64'Ian Romanick2009-11-171-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge branch 'mesa_7_5_branch' into mesa_7_6_branchBrian Paul2009-09-241-3/+8
|\
| * swrast: add lod bias when texture samplingBrian Paul2009-09-231-2/+7
| | | | | | | | | | | | Mostly fixes progs/demos/lodbias when MESA_TEX_PROG=1. But the LOD still seems off by -1 or so. May be an issue with the params passed to _swrast_compute_lambda()
| * swrast: fix typo in partial derivatives parameter passingBrian Paul2009-09-231-1/+1
| |
* | mesa: add new FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC fragment program inputsBrian Paul2009-07-291-3/+2
|/ | | | | | | | | | 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...
* mesa: texture combine clean-upsBrian Paul2009-04-011-2/+0
| | | | | | Use MAX_COMBINER_TERMS instead of 4. Rename some vars. Update comments.
* swrast: do texture sampling/combining in floating pointBrian Paul2009-04-011-11/+8
| | | | | The code's cleaner and a step toward supporting float-valued texture sampling. Some optimizations for common cases can be added and re-enabled...
* mesa: remove some last remnants of GL_MESA_program_debugBrian Paul2009-03-111-4/+0
|
* mesa: rename, reorder FRAG_RESULT_x tokensBrian Paul2009-02-281-6/+6
| | | | | | | 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).
* swrast: use ASSIGN_4V() macroBrian Paul2009-02-091-4/+2
|
* swrast: return (0,0,0,1) when sampling incomplete textures, not (0,0,0,0)Brian Paul2009-02-061-2/+4
| | | | Fixes piglit shaders/fp-incomplete-tex test.
* mesa: implement texture swizzling in swrastBrian Paul2009-01-281-8/+31
| | | | And enable GL_EXT_texture_swizzle for software drivers.
* mesa: if texObj is NULL in fetch_texel_*(), return black.Brian Paul2009-01-281-20/+32
|
* mesa: added comment about gl_PointCoordBrian Paul2008-08-111-0/+1
|
* added null texObj ptr check (bug 15567)Brian Paul2008-07-081-12/+16
|
* Updated GLSL uniform/sampler handling from gallium-0.1 branchBrian Paul2008-05-141-5/+9
| | | | | | | | | | Previously, the shader linker combined the uniforms used by the vertex and fragment shaders into a combined set of uniforms. This made the implementation of glUniform*() simple, but was rather inefficient otherwise. Now each shader gets its own set of uniforms (no more modelview matrix showing up in the fragment shader uniforms, for example). cherry-picked by hand from gallium-0.1 branch
* Simplify ctx->_NumColorDrawBuffers, _ColorDrawBuffers and fix bug 13835.Brian2008-01-061-5/+5
| | | | | | | | | | | These fields are no longer indexed by shader output. Now, we just have a simple array of renderbuffer pointers. If the shader writes to gl_FragData[i], send those colors to the N _ColorDrawBuffers. Otherwise, replicate the single gl_FragColor (or the fixed-function color) to the N _ColorDrawBuffers. A few more changes and simplifications can follow from this...
* fix span->facing computation and gl_FrontFacing initializationBrian2007-12-041-1/+1
|
* fix broken two-sided stencilBrian2007-11-301-1/+1
|
* Consolidate texture fetch code and use partial derivatives when possible.Brian2007-11-231-11/+12
|
* clamp lambda to Min/MaxLodBrian2007-11-201-3/+6
|
* Implement gl_PointCoord attribute for GLSL fragment shaders.Brian2007-10-241-0/+1
| | | | Contains the normalized fragment position within a point sprite.
* Be more consistant with paths in #includes. Eventually, eliminate a bunch ↵Brian2007-07-041-5/+5
| | | | of -I flags.
* Rework _mesa_update_texture_compare_function() to only be called duringBrian2007-06-111-20/+0
| | | | | | | state validation/update. Note that we're still temporarily skipping the test for an active fragment program. Need to fix shadow2D() ...
* Temporarily disable the calls to _mesa_update_texture_compare_function().Brian2007-06-111-0/+4
| | | | This fixes the depth-peel regression reported by Brad King.
* Add support for GL_ARB_fragment_program_shadow.Ian Romanick2007-06-071-1/+2
|
* Fix ARB_fp spec conformance bug WRT shadow sampling.Ian Romanick2007-06-071-0/+16
| | | | | The ARB_fp (and other assembly-level fragment program specs) say that the depth comparison function is always GL_NONE in fragment program mode.
* remove some unneeded code in init_machine()Brian2007-05-111-5/+0
|
* changes to get DDX/DDY working againBrian2007-05-021-0/+4
|
* only load front/back face attrib if using a shader (bug 10788)Brian2007-04-281-2/+4
|
* undo a test/debug changeBrian2007-04-211-1/+1
|
* Put gl_program_machine into swrast structure rather than using a local variable.Brian2007-04-191-8/+7
| | | | | Basically an easy way to make sure the memory gets initialized once (to zero) to avoid lots of valgrind warnings.
* Check if FRAG_RESULT_COLR is written and update span->interpMask, arrayMask.Brian2007-03-131-1/+8
| | | | Also, fix an assertion.