diff options
author | Timothy Arceri <[email protected]> | 2015-07-25 12:33:53 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2015-07-30 22:00:45 +1000 |
commit | 8cd2f88845acd45ebcbaae2e68a8a47b3c17e6d5 (patch) | |
tree | 23d02a1c7f26b591a928974a797a3fd6e80cf132 /src/mesa/main/uniforms.c | |
parent | 3a21e4bd263002dd600e7a693536c93f68b285a5 (diff) |
mesa: fix and simplify resource query for arrays
This removes the need for multiple functions designed to validate an array
subscript and replaces them with a call to a single function.
The change also means that validation is now only done once and the index
is retrived at the same time, as a result the getUniformLocation code can
be simplified saving an extra hash table lookup (and yet another
validation call).
This chage also fixes some tests in:
ES31-CTS.program_interface_query.uniform
V3: rebase on subroutines, and move the resource index array == 0
check into _mesa_GetProgramResourceIndex() to simplify things further
V2: Fix bounds checks for program input/output, split unrelated comment fix
and _mesa_get_uniform_location() removal into their own patch.
Cc: Tapani Pälli <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/mesa/main/uniforms.c')
-rw-r--r-- | src/mesa/main/uniforms.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c index 6ba746e2f58..ff1df72e1d6 100644 --- a/src/mesa/main/uniforms.c +++ b/src/mesa/main/uniforms.c @@ -952,7 +952,7 @@ _mesa_GetUniformBlockIndex(GLuint program, struct gl_program_resource *res = _mesa_program_resource_find_name(shProg, GL_UNIFORM_BLOCK, - uniformBlockName); + uniformBlockName, NULL); if (!res) return GL_INVALID_INDEX; @@ -987,7 +987,8 @@ _mesa_GetUniformIndices(GLuint program, for (i = 0; i < uniformCount; i++) { struct gl_program_resource *res = - _mesa_program_resource_find_name(shProg, GL_UNIFORM, uniformNames[i]); + _mesa_program_resource_find_name(shProg, GL_UNIFORM, uniformNames[i], + NULL); uniformIndices[i] = _mesa_program_resource_index(shProg, res); } } |