aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/uniforms.c
Commit message (Collapse)AuthorAgeFilesLines
* uniforms: accept all int/unsigned int sampler types in uniform checks.Dave Airlie2011-09-151-0/+22
| | | | | | | | | | I'm not 100% sure about this, it may need a version check or it might be completely wrong. added multisample ones as well. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: add a UniformBooleanTrue optionBryan Cain2011-09-051-1/+4
| | | | | | | | Drivers supporting native integers set UniformBooleanTrue to the integer value that should be used for true when uploading uniform booleans. This is ~0 for Gallium and 1 for i965. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa: Fix glGetUniform() type conversions.Eric Anholt2011-08-301-58/+79
| | | | | | | | | | | | | | | | | | | | | We were primarily failing to convert in the NativeIntegers case, which this fixes. However, we were also just truncating float uniforms when converting to integer, which does not appear to be the correct behavior. Note, however, that the NVIDIA drivers also truncate instead of rounding. GL_DOUBLE return type is dropped because it was never used and completely broken. It can be added when there's test code. Fixes piglit ARB_shader_objects/getuniform v2: This is a rewrite of my previous glGetUniform patch, which Ken pointed out missed storage_type-based conversions to integer, which was totally broken still thanks to a typo in the testcase. v3: Quote the spec justifying the rounding behavior. Acked-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa, glsl_to_tgsi: Add new gl_context::NativeIntegers flag.Kenneth Graunke2011-08-191-9/+9
| | | | | | | | | | | | | | | | | | | Previously, native integer support was based on whether the driver advertised GLSL 1.30 or not. However, drivers that natively support integers may wish to do so for older GLSL versions as well. Adding this new opt-in flag allows them to do so. Currently disabled by default on all drivers, which was the existing behavior (no drivers currently implement GLSL 1.30). Fixes piglit tests on i965 with INTEL_GLSL_VERSION=130 set: - spec/glsl-1.10/fs-uniform-int-110.shader_test - spec/glsl-1.30/fs-uniform-int-130.shader_test (it was doubly converting the data) Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* Merge branch 'glsl-to-tgsi'Bryan Cain2011-08-041-17/+29
|\ | | | | | | | | | | Conflicts: src/mesa/state_tracker/st_atom_pixeltransfer.c src/mesa/state_tracker/st_program.c
| * mesa, glsl_to_tgsi: add native support for integers in shadersBryan Cain2011-08-011-13/+25
| | | | | | | | | | Disabled by default on all drivers. To enable it, change ctx->GLSLVersion to 130 in st_extensions.c. Currently, softpipe is the only driver with integer support.
| * mesa: support boolean and integer-based parameters in prog_parameterBryan Cain2011-08-011-6/+6
| | | | | | | | | | | | The functionality is not used by anything yet, and the glUniform functions will need to be reworked before this can reach its full usefulness. It is nonetheless a step towards integer support in the state tracker and classic drivers.
* | mesa: Allow sampling from units >= MAX_TEXTURE_UNITS in shaders.Henri Verbeet2011-07-071-2/+2
|/ | | | | | | | | | | | The total number of units used by a shader is limited to MAX_TEXTURE_UNITS, but the actual indices are only limited by MAX_COMBINED_TEXTURE_IMAGE_UNITS, since they're shared between vertex and fragment shaders. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Henri Verbeet <hverbeet@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa: remove old commentBrian Paul2011-06-081-1/+0
|
* mesa: add more sampler types to is_sampler_type()Brian Paul2011-06-081-0/+4
|
* mesa: fix typo (s/GLGL/GLSL/)Brian Paul2011-06-021-1/+1
|
* mesa: 80-column wrappingBrian Paul2011-06-021-8/+14
|
* mesa: consolidate glGetUniform codeBrian Paul2011-06-021-124/+64
|
* mesa: refactor/consolidate uniform lookup codeBrian Paul2011-06-021-96/+87
|
* mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/EndMarek Olšák2011-06-011-0/+4
| | | | | | I couldn't find this being required by the spec. Reviewed-by: Brian Paul <brianp@vmware.com>
* Squashed commit of the following:Brian Paul2011-04-261-14/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 864fe253b04105b7469e5f7b064dc37637b944f8 Author: Brian Paul <brianp@vmware.com> Date: Thu Apr 21 20:13:07 2011 -0600 mesa: s/exec/disp/ in _mesa_init_histogram_dispatch() This function isn't normally compiled (FEATURE_histogram). commit f4bf45e2b94b582cacd19cdca873c5be627e4250 Author: nobled <nobled@dreamwidth.org> Date: Thu Apr 21 07:53:58 2011 -0600 mesa: hook up GL_ARB_robustness dispatch functions ...and advertise the extension. Signed-off-by: Brian Paul <brianp@vmware.com> commit 2b89e38e5f572dc40cebc06381ae7c5d04386998 Author: nobled <nobled@dreamwidth.org> Date: Thu Apr 21 07:53:58 2011 -0600 mesa: regenerated API files for GL_ARB_robustness Signed-off-by: Brian Paul <brianp@vmware.com> commit 5d5ebfb7135cec9d833adef86cbf4d0f3d9beca8 Author: nobled <nobled@dreamwidth.org> Date: Thu Apr 21 07:53:57 2011 -0600 glapi: add ARB_robustness xml Signed-off-by: Brian Paul <brianp@vmware.com> commit 0159d1d6d99f4bbc18381dc2081c20d3aff17ac9 Author: nobled <nobled@dreamwidth.org> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: implement GL_ARB_robustness functions Signed-off-by: Brian Paul <brianp@vmware.com> commit 938fd71f4c4742f274922d53492a7290ab8d9c9b Author: nobled <nobled@dreamwidth.org> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: add context fields for GL_ARB_robustness Signed-off-by: Brian Paul <brianp@vmware.com> commit 72075137bc79e65be03dac7e97b6dba93c3a86a4 Author: nobled <nobled@dreamwidth.org> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: standardize more bounds-checking error messages Signed-off-by: Brian Paul <brianp@vmware.com> commit 32a3fc23746db49da903fbc08afa0135af3007d2 Author: nobled <nobled@dreamwidth.org> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: standardize some bounds-checking error messages Signed-off-by: Brian Paul <brianp@vmware.com> commit cecbf1f4d164207de373dec0cadee2e84e1f9656 Author: nobled <nobled@dreamwidth.org> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: add more bounds-checking support for client memory buffers Signed-off-by: Brian Paul <brianp@vmware.com> commit edc895b52383d5bd274422db56adead1d81daf5f Author: nobled <nobled@dreamwidth.org> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: add bounds-checking support for client memory buffers Signed-off-by: Brian Paul <brianp@vmware.com> commit 3a96ef28a538f158a219b406cd090dee70470c85 Author: nobled <nobled@dreamwidth.org> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: use is_bufferobj() helper function Signed-off-by: Brian Paul <brianp@vmware.com>
* glsl: Move _mesa_builtin_uniform_desc from uniforms.c to ir_variable.cppIan Romanick2011-03-291-248/+0
| | | | | | | | This array is going to be used in the main compiler soon. Leaving them uniforms.c caused problems for building the stand-alone compiler. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Chad Versace <chad.versace@intel.com>
* mesa: Add gl_MESAFogParamsOptimized for our special pre-computed fog params.Eric Anholt2011-03-111-0/+5
| | | | | | | It would be nice if we handled optimized uniform math like this in some generic way, since people often end up doing uniform expressions in shaders, but for now keep this hard-coded like it was in the texenvprogram code.
* mesa: Add a builtin uniform for the ATI_envmap_bumpmap rotation matrix.Eric Anholt2011-03-111-0/+11
| | | | | | | For fixed function fragment processing in GLSL IR, we want to be able to reference this state value. gl_* not explicitly permitted is reserved, so using this variable name internally shouldn't be any issue.
* mesa: glGetUniform only returns a single element of an arrayIan Romanick2011-02-011-14/+41
| | | | | | | Also return it as the correct type. Previously the whole array would be returned and each element would be expanded to a vec4. Fixes piglit test getuniform-01 and bugzilla #29823.
* mesa: fix an error in uniform arrays in row calculating.Jian Zhao2011-01-071-1/+1
| | | | | | | | | | Fix the error in uniform row calculating, it may alloc one line more which may cause out of range on memory usage, sometimes program aborted when free the memory. NOTE: This is a candidate for 7.9 and 7.10 branches. Signed-off-by: Brian Paul <brianp@vmware.com>
* mesa: Directly include mfeatures.h in files that perform feature tests.Vinson Lee2011-01-071-0/+1
|
* mesa: Include mtypes.h in files that use gl_context struct.Vinson Lee2011-01-051-0/+1
| | | | | | Directly include mtypes.h if a file uses a gl_context struct. This allows future removal of headers that are not strictly necessary but indirectly include mtypes.h for a file.
* mesa: add glGetUniformuiv(), plug in uint glUniform funcsBrian Paul2010-10-281-8/+55
|
* mesa: Track an ActiveProgram distinct from CurrentProgramIan Romanick2010-10-271-33/+33
| | | | | ActiveProgram is the GL_EXT_separate_shader_objects state variable used for glUniform calls. glUseProgram also sets this.
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-9/+9
|
* mesa: Don't reference a W component in setting up a vec3 uniform component.Eric Anholt2010-09-301-1/+5
| | | | | The 965 driver would try to set up storage for the W component, and the offsets would get mixed up.
* mesa: Move the list of builtin uniform info from ir_to_mesa to shared code.Eric Anholt2010-09-281-1/+230
| | | | | | I'm still not pleased with how builtin uniforms are handled, but as long as we're relying on the prog_statevar stuff this seems about as good as it'll get.
* glsl: Set up uniform initializers by walking the shaders after linking.Eric Anholt2010-08-241-48/+60
| | | | | | | | | | | | | Previously, uniform initializers were handled by ir_to_mesa as it made its Parameters list. However, uniform values are global to all shaders, and the value set in one Parameters list wasn't propagated to the other gl_program->Parameters lists. By going back through the general Mesa uniform handling, we make sure that all gl_programs get updated values, and also successfully separate uniform initializer handling from ir_to_mesa gl_program generation. Fixes: glsl-uniform-initializer-5.
* mesa: make uniform work with geometry shadersZack Rusin2010-07-101-0/+29
|
* mesa: Fix OpenGL ES-only builds.Chia-I Wu2010-07-031-0/+2
| | | | | | | | Check FEATURE_GL in _mesa_init_shader_dispatch and _mesa_init_shader_uniform_dispatch. OpenGL ES can not and does not use _mesa_init_<...>_dispatch. This is supposed to be temporary. Ideally, a more flexible way for initializing dispatch tables should be developed.
* mesa: initial support for ARB_geometry_shader4Zack Rusin2010-06-281-0/+5
| | | | | | 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-3/+3
|
* mesa: move uniforms.c to main/Brian Paul2010-06-101-0/+1334