summaryrefslogtreecommitdiff
path: root/src/mesa/shader/shader_api.c
AgeCommit message (Collapse)Author
2009-10-07Merge branch 'mesa_7_6_branch'Nicolai Hähnle
2009-10-07shader_api: Fix bounds checking of glUniform and glUniformMatrixNicolai Hähnle
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2009-09-29mesa: added nopfrag/nopvert options for MESA_GLSLBrian Paul
These options can be used to force vertex/fragment shaders to be no-op shaders (actually, simple pass-through shaders). For debug/test purposes.
2009-09-15Merge branch 'mesa_7_5_branch' into mesa_7_6_branchBrian Paul
2009-09-14glsl: added some link debug code (disabled)Brian Paul
2009-08-26Merge branch 'mesa_7_5_branch'Brian Paul
2009-08-26glsl: asst. clean-ups in set_program_uniform()Brian Paul
Remove redunant type check for samplers (assert instead). Move some local vars. Update comments.
2009-08-26glsl: signal that the program needs to be re-translated when samplers changeBrian Paul
2009-08-26mesa: var renaming, new assertionBrian Paul
2009-08-26Merge branch 'mesa_7_5_branch'Brian Paul
2009-08-26glsl: fix bug in sampler array indexingBrian Paul
Need to add the 'offset' parameter when indexing the parameter array. Before, if we were setting arrays of samplers, we were actually only setting the 0th sampler's value. Because of how progs/glsl/samplers.c is constructed, this wasn't showing up as a failure in the samplers_array output.
2009-08-25glsl: implement shader sampler validationBrian Paul
Shader validation should fail if there are two samplers of different types which reference the same texture unit. For example, if a cubemap sampler and a 2D sampler both reference texture unit 0, that's invalid.
2009-08-14Merge branch 'mesa_7_5_branch'Brian Paul
2009-08-13glsl: fix some uninitialized pointersBrian Paul
2009-08-04mesa: compute, print shader checksumBrian Paul
2009-06-26glsl: Added gl_shader_state::EmitContReturn fieldBrian Paul
This is the start of a glsl-continue-return feature branch to support a GLSL code generator option for 'continue' and 'return' statements. Some targets don't support CONT or RET statements so we'll need to try to generate code that does not use them...
2009-06-26Merge branch 'mesa_7_5_branch'Brian Paul
Conflicts: Makefile src/gallium/drivers/softpipe/sp_screen.c src/mesa/main/version.h
2009-05-08mesa: more shader debug code (disabled)Brian Paul
2009-04-24mesa: signal _NEW_PROGRAM_CONSTANTS instead of _NEW_PROGRAMBrian Paul
Use _NEW_PROGRAM_CONSTANTS when changing constant/uniform buffer values. Binding a new program/shader sets both _NEW_PROGRAM and _NEW_PROGRAM_CONSTANTS.
2009-04-21mesa: new _NEW_PROGRAM_CONSTANTS flagBrian Paul
This state flag will be used to indicate that vertex/fragment program constants have changed. _NEW_PROGRAM will be used to indicate changes to the vertex/fragment shader itself, or misc related state. _NEW_PROGRAM_CONSTANTS is also set whenever a program parameter that's tracking GL state has changed. For example, if the projection matrix is in the parameter list, calling glFrustum() will cause _NEW_PROGRAM_CONSTANTS to be set. This will let to remove the need for dynamic state atoms in some drivers. For now, we still set _NEW_PROGRAM in all the places we used to. We'll no longer set _NEW_PROGRAM in glUniform() after drivers/etc have been updated.
2009-04-14mesa: remove unused matrixType param from ctx->Driver.UniformMatrix() functionsBrian Paul
2009-04-14mesa: move #define for GL_PROGRAM_BINARY_LENGTH_OESBrian Paul
2009-03-19glsl: change GLSL #pragma initializationBrian Paul
Initialize the shader's pragma settings before calling the compiler. Added pragma "Ignore" fields to allow overriding the #pragma directives found in shader source code.
2009-03-13mesa: glUseProgram() debug code (disabled)Brian Paul
2009-02-18glsl: asst improvements, clean-ups in set_program_uniform()Brian Paul
Move the is_boolean/integer_type() calls out of the loops. Move the is_sampler_type() function near the bool/int functions. Add a bunch of comments.
2009-02-18glsl: fix inequality in set_program_uniform()Brian Paul
We were off by one when checking for too many uniform values.
2009-02-18mesa: improved error msgBrian Paul
2009-02-16mesa: remove old commentsBrian Paul
Note: the default value for EmitCondCodes is FALSE. This means the GLSL compiler will emit code like this: SEQ TEMP[0].x, A, B; IF TEMP[0].x; ... ENDIF But if EmitCondCodes is TRUE, condition codes will be used instead: SEQ.C TEMP[0].x, A, B; IF (NE.xxxx); ... ENDIF
2009-02-11glsl: allow setting arrays of samplers in set_program_uniform()Brian Paul
Arrays of sampler vars haven't been tested much and might actually be broken. Will need to be revisited someday. Another fix for bug 20056.
2009-02-11glsl: raise GL_INVALID_OPERATION for glUniform(location < -1)Brian Paul
location = -1 is silently ignored, but other negative values should raise an error. Another fix for bug 20056.
2009-02-11glsl: rework _mesa_get_uniform[fi]v() to avoid using a fixed size ↵Brian Paul
intermediate array
2009-02-11glsl: fix glUniform() array bounds error checkingBrian Paul
If too many array elements are specified, they're to be silently ignored (don't raise a GL error). Fixes another issue in bug 20056.
2009-02-11glsl: fix incorrect size returned by glGetActiveUniform() for array elements.Brian Paul
Fixes one of the issues in bug 20056.
2009-02-09mesa: merge gallium-0.2 into gallium-master-mergeBrian Paul
Merge commit 'origin/gallium-0.2' into gallium-master-merge Conflicts: Makefile docs/relnotes-7.4.html docs/relnotes.html src/mesa/drivers/dri/i965/brw_wm.h src/mesa/main/imports.c src/mesa/main/mtypes.h src/mesa/main/texcompress.c src/mesa/main/texenvprogram.c src/mesa/main/version.h src/mesa/vbo/vbo_exec_api.c src/mesa/vbo/vbo_save_draw.c
2009-02-06glsl: new MESA_GLSL env var for GLSL debugging featuresBrian Paul
Replaces the VERBOSE_GLSL, VERBOSE_GLSL_DUMP flags which only worked in debug builds. MESA_GLSL will work both in debug and non-debug builds. Also add facility to dump glUniform() calls to stdout.
2009-02-06Revert "mesa: meaningless whitespace change to see if git's working (ignore)"Brian Paul
This reverts commit b2e779988eeb595187933fe2122d86f8ccfe059c. I didn't mean to push this stuff yet. I'm having a bad git day...
2009-02-06mesa: meaningless whitespace change to see if git's working (ignore)Brian Paul
2009-01-22glsl: set shader->CompileStatus in _slang_compile()Brian Paul
2008-11-11Merge commit 'origin/master' into gallium-0.2Brian Paul
Conflicts: src/mesa/shader/prog_execute.c src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
2008-11-10mesa: track initialization status of uniform variables. Plus, asst clean-ups.Brian Paul
2008-11-06mesa: update the shader programs->TexturesUsed array at link timeBrian Paul
If an application never calls glUniform() to set sampler variable values they'll remain 0 (the default value/unit). Now call _mesa_update_shader_textures_used() at link time in case glUniform() is never called. program->TextureUsed[] will then be correct for state validation.
2008-11-06Merge commit 'origin/gallium-0.1' into gallium-0.2Brian Paul
2008-11-06mesa: update the shader programs->TexturesUsed array at link timeBrian Paul
If an application never calls glUniform() to set sampler variable values they'll remain 0 (the default value/unit). Now call _mesa_update_shader_textures_used() at link time in case glUniform() is never called. program->TextureUsed[] will then be correct for state validation.
2008-11-05Merge commit 'origin/gallium-0.1' into gallium-0.2Brian Paul
Conflicts: src/gallium/auxiliary/rtasm/rtasm_execmem.c src/mesa/shader/slang/slang_emit.c src/mesa/shader/slang/slang_log.c src/mesa/state_tracker/st_atom_framebuffer.c
2008-11-05mesa: add Initialized field to gl_uniform struct, for debugging purposes onlyBrian Paul
2008-11-05mesa: add Initialized field to gl_uniform struct, for debugging purposes onlyBrian Paul
2008-10-10Merge commit 'origin/master' into gallium-0.2Keith Whitwell
Conflicts: src/mesa/glapi/descrip.mms src/mesa/shader/grammar/descrip.mms
2008-09-29GLSL: Implement _mesa_get_handleIan Romanick
Implementing _mesa_get_handle in using glGetIntegerv(GL_CURRENT_PROGRAM, ...) allows glGetHandleARB to work.
2008-09-29GLSL: AttachShader returns INVALID_OPERATION for repeated attachIan Romanick
The GL_ARB_shader_objects spec says that glAttachShaderARB is supposed to return GL_INVALID_OPERATION if a shader is attached to a program where it is already attached. _mesa_attach_shader perviously returned without error in this case.
2008-09-23mesa: glsl: fix glGetUniform for matrix queriesBrian Paul
(cherry picked from commit 7a6eba54d064cadf15f93df2c1748cf5e474ef03)