diff options
author | Samuel Pitoiset <[email protected]> | 2017-04-26 13:49:13 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-05-02 22:40:45 +0200 |
commit | e0e01895b054847e41b98cbf3939520747a0f32d (patch) | |
tree | ef7e9aa02a6515ba31b57e164ce5a3f48b8479ad /src/mesa/main/uniform_query.cpp | |
parent | ece06defe77a77d2db40abeddee5a2e0e45654ce (diff) |
glsl: set vector_elements to 1 for samplers
I don't see any reasons why vector_elements is 1 for images and
0 for samplers. This increases consistency and allows to clean
up some code a bit.
This will also help for ARB_bindless_texture.
No piglit regressions with RadeonSI.
This time the Intel CI system doesn't report any failures.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main/uniform_query.cpp')
-rw-r--r-- | src/mesa/main/uniform_query.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index e400d0eb00f..114f6fb5bee 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -321,8 +321,7 @@ _mesa_get_uniform(struct gl_context *ctx, GLuint program, GLint location, } { - unsigned elements = (uni->type->is_sampler()) - ? 1 : uni->type->components(); + unsigned elements = uni->type->components(); const int dmul = uni->type->is_64bit() ? 2 : 1; const int rmul = glsl_base_type_is_64bit(returnType) ? 2 : 1; @@ -648,10 +647,8 @@ _mesa_propagate_uniforms_to_driver_storage(struct gl_uniform_storage *uni, { unsigned i; - /* vector_elements and matrix_columns can be 0 for samplers. - */ - const unsigned components = MAX2(1, uni->type->vector_elements); - const unsigned vectors = MAX2(1, uni->type->matrix_columns); + const unsigned components = uni->type->vector_elements; + const unsigned vectors = uni->type->matrix_columns; const int dmul = uni->type->is_64bit() ? 2 : 1; /* Store the data in the driver's requested type in the driver's storage @@ -803,8 +800,7 @@ validate_uniform(GLint location, GLsizei count, const GLvoid *values, } /* Verify that the types are compatible. */ - const unsigned components = uni->type->is_sampler() - ? 1 : uni->type->vector_elements; + const unsigned components = uni->type->vector_elements; if (components != src_components) { /* glUniformN() must match float/vecN type */ @@ -925,8 +921,7 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values, return; } - const unsigned components = uni->type->is_sampler() - ? 1 : uni->type->vector_elements; + const unsigned components = uni->type->vector_elements; /* Page 82 (page 96 of the PDF) of the OpenGL 2.1 spec says: * |