History log of /external/mesa3d/src/mesa/main/uniform_query.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3bdb75893491acaca571de6c8caf241dc47b9953 14-Dec-2012 Frank Henigman <fjhenigman@google.com> mesa: add bounds checking for uniform array access

No piglit regressions and now passes glsl-uniform-out-of-bounds-2.

validate_uniform_parameters now checks that the array index is
valid. This means if an index is out of bounds, glGetUniform* now
fails with GL_INVALID_OPERATION, as it should.
_mesa_uniform and _mesa_uniform_matrix also call
validate_uniform_parameters so the bounds checks there became
redundant and were removed.

The test in glGetUniformLocation is modified to check array bounds
so it now returns GL_INVALID_INDEX (-1) if you ask for the location
of a non-existent array element, as it should.

Signed-off-by: Frank Henigman <fjhenigman@google.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
(cherry picked from commit 46e3aeb07702f57d389fbfcade9d4ef66218dc53)
/external/mesa3d/src/mesa/main/uniform_query.cpp
5f8a8716b6b58a470be0b0d176e38d37eda2c8f7 08-Dec-2012 Matt Turner <mattst88@gmail.com> mesa/uniform_query: Don't write to *params if there is an error

The GL 3.1 and ES 3.0 specs say of glGetActiveUniformsiv:
"If an error occurs, nothing will be written to params."

So, make a pass through the indices and check that they're valid before
the pass that actually writes to params. Checking pname happens on the
first iteration of the second loop.

Fixes es3conform's getactiveuniformsiv_for_nonexistent_uniform_indices
test.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 11cea472466f731fa9c44d56f1643dec26e6601c)
/external/mesa3d/src/mesa/main/uniform_query.cpp
174d44a9c4d39a030fe3528acf07f9ac9aa617a1 22-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Use a new, more specific hook for shader uniform changes.

Gallium drivers and i965 don't require special notification when
sampler uniforms change. They simply see the _NEW_TEXTURE and adjust
their indirection tables. These drivers don't want ProgramStringNotify:
it simply causes pointless recompiles.

Unfortunately, i915 still requires shader recompiles and needs
ProgramStringNotify. Rather than trying to fix that, simply change the
hook to a new, more specific one: ShaderUniformChange. On i915, this
translates to ProgramStringNotify; others simply ignore it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/uniform_query.cpp
548bce473367a53f45275356f8d5b9e7d98be5ce 01-May-2012 Eric Anholt <eric@anholt.net> mesa: Implement the UBO-specific pnames of glGetActiveUniformsiv.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
9f1a4a6340824786142be9bc14f0c3418f14a69f 28-Apr-2012 Eric Anholt <eric@anholt.net> mesa: Add support for glGetActiveUniformsiv on non-UBO pnames.

We'll need to propagate the UBO fields to the uniform storage records
before we can handle the other pnames.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
abcdbdf9cce3c7520ee999fac3099d609960847d 25-Jun-2012 Eric Anholt <eric@anholt.net> mesa: Move the _mesa_uniform_merge_location_offset to glGetUniformLocation().

With the upcoming GL_ARB_uniform_buffer_object changes, the only
other caller that will want the cooked value is state_tracker.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
ef691885c92abcd085d89fc30feeda87961773ab 10-May-2012 Eric Anholt <eric@anholt.net> mesa: Throw error on glGetActiveUniform inside Begin/End.

Fixes piglit GL_ARB_shader_objeccts/getactiveuniform-beginend.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
60e8a4944081b42127b3de11b599f417c091307a 07-May-2012 Oliver McFadden <oliver.mcfadden@linux.intel.com> mesa: GLES specifies restrictions on uniform matrix transpose.

GL_INVALID_VALUE is generated if transpose is not GL_FALSE.

http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
0f3aa9f4bd7daab354deb9268307c5628b460f6b 23-Mar-2012 Vinson Lee <vlee@freedesktop.org> mesa: Fix memory leak in _mesa_get_uniform_location.

Fixes Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/uniform_query.cpp
b536ac6b2bc54ad9bb6e58fbd307055e419a288f 22-Dec-2011 Dylan Noblesmith <nobled@dreamwidth.org> mesa: add back glGetnUniform*v() overflow error reporting

The error was removed in:

commit 719909698c67c287a393d2380278e7b7495ae018
Author: Ian Romanick <ian.d.romanick@intel.com>
Date: Tue Oct 18 16:01:49 2011 -0700

mesa: Rewrite the way uniforms are tracked and handled

The GL_ARB_robustness spec doesn't say the implementation
should truncate the output, so just return after setting
the required error like it did before the above commit.

Also fixup an old comment and add an assert.

NOTE: This is a candidate for the 8.0 branch.
/external/mesa3d/src/mesa/main/uniform_query.cpp
6c0df75803e1944f82a1468dcca47d23de82ea6b 15-Nov-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Calculate used samplers and shadow samplers in the linker

It used to be done in ir_to_mesa, and that was kind of a bad place.

I didn't change st_glsl_to_tgsi because there is some strange stuff
happening in the code that generates glDrawPixels shaders. It looked
like this would break horribly if I touched anything.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/uniform_query.cpp
6a992c3288b6f7a5d94172c9ad1908e71e58233e 15-Nov-2011 Ian Romanick <ian.d.romanick@intel.com> linker: Calculate the sampler to texture target mapping during linking

Track the calculated data in gl_shader_program instead of the
individual assembly shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/uniform_query.cpp
195ee502c3196607e3a74075aefade9770a08a67 14-Nov-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Validate sampler settings using uniform storage

Rather than looking at the settings in individual assembly programs,
look at the settings in the top-level uniform values. The old code
was flawed because examining each shader stage in isolation could
allow inconsitent usage across stages (e.g., bind unit 0 to a
sampler2D in the vertex shader and sampler1DShadow in the fragment
shader).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/uniform_query.cpp
62f2d6ef034559257e01235c3562d821bdade4f5 26-Dec-2011 Brian Paul <brianp@vmware.com> mesa: fix signed/unsigned comparison warnings
/external/mesa3d/src/mesa/main/uniform_query.cpp
010dc29283cfc7791a29ba8a0570d8f7f9edef05 10-Nov-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Only update sampler uniforms that are used by the shader stage

Previously a vertex shader that used no samplers would get updated (by
calling the driver's ProgramStringNotify) when a sampler in the
fragment shader was updated. This was discovered while investigating
some spurious code generation for shaders in Cogs. The behavior in
Cogs is especially pessimal because it ping-pongs sampler uniform
settings:

glUniform1i(sampler1, 0);
glUniform1i(sampler2, 1);
draw();
glUniform1i(sampler1, 1);
glUniform1i(sampler2, 0);
draw();
glUniform1i(sampler1, 0);
glUniform1i(sampler2, 1);
draw();
// etc.

ProgramStringNotify is still too big of a hammer. Applications like
Cogs will still defeat the shader cache. A lighter-weight mechanism
that can work with the shader cache is needed. However, this patch at
least restores the previous behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/uniform_query.cpp
3800fe800bfc7faac6e629e584487c5904a5ef2b 10-Nov-2011 Brian Paul <brianp@vmware.com> mesa: silence uninitialized var warning
/external/mesa3d/src/mesa/main/uniform_query.cpp
63e7a4c6e5bf51d8090046ebc5adcb4207448565 09-Nov-2011 José Fonseca <jfonseca@vmware.com> mesa,glsl,mapi: Put extern "C" { ... } where appropriate.

Probably a several places missing, but enough to cover all headers
(in)directly included by uniform_query.cpp, and fix the MSVC build.
/external/mesa3d/src/mesa/main/uniform_query.cpp
207a016ecaabbccf865a5b8e026b95a4276adc15 08-Nov-2011 Brian Paul <brianp@vmware.com> mesa: fix signed/unsigned integer comparison warnings

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
be4524aeed7fb67bdc45861d299d4c5ca99c4d6c 19-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> Delete code made dead by previous uniform related patches

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
c42ca36d67939bb1cda8bb362ff8da7c0da24a1d 19-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Add missing check for glUniform*v count > 1 on non-array

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
719909698c67c287a393d2380278e7b7495ae018 19-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Rewrite the way uniforms are tracked and handled

Switch all of the code in ir_to_mesa, st_glsl_to_tgsi, glUniform*,
glGetUniform, glGetUniformLocation, and glGetActiveUniforms to use the
gl_uniform_storage structures in the gl_shader_program.

A couple of notes:

* Like most rewrite-the-world patches, this should be reviewed by
applying the patch and examining the modified functions.

* This leaves a lot of dead code around in linker.cpp and
uniform_query.cpp. This will be deleted in the next patches.

v2: Update the comment block (previously a FINISHME) in _mesa_uniform
about generating GL_INVALID_VALUE when an out-of-range sampler index
is specified.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
cfab4327c380e5abd4976e937d9421aa098d0c5f 19-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Add log_uniform and log_program_parameters to dump data

These were both useful debugging aids while developing this code.
log_uniform will be used to keep the MESA_GLSL=uniform behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
70650d08fa3f4db2aea41e4ed47b271c3a3e7385 18-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Add _mesa_uniform_{attach,detach_all}_driver_storage functions

These functions are used to create and destroy the connections between
a uniform and the storage used by the driver to hold its value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
9516182e80d5a21ab402c9b2cbe9e6c46e5bb1d8 18-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Add _mesa_propagate_uniforms_to_driver_storage

This function propagates the values from the backing storage of a
gl_uniform_storage structure to the driver supplied data locations.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
2f45ed393a40e914749ddb86d41e0f77b2cea3da 13-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Move most of uniforms.c to uniform_query.cpp

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
/external/mesa3d/src/mesa/main/uniform_query.cpp
1375d67984f0cd01efa7b256864f21dc4ff75982 07-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Use glsl_type::gl_type in glGetActiveUniform

This has the same value has gl_program_parameter::DataType field.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/uniform_query.cpp
a541ff3fb99f43f9f664daf275e315af2836977e 07-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Move _mesa_GetActiveUniformARB to uniform_query.cpp

Fold _mesa_get_active_uniform into its only caller in the process.
More changes are coming soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/uniform_query.cpp