diff options
author | Samuel Pitoiset <[email protected]> | 2017-04-20 19:02:27 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-04-21 10:08:04 +0200 |
commit | 4a0aa0b3b3c07469aeef5d627f63adda6f5bcf5a (patch) | |
tree | e256688dc11863786c9bba3cca5102ffdc257014 /src/compiler | |
parent | 29582dd20c1bc54ef5f481a955862bbf48d61c90 (diff) |
glsl: make component_slots() returns 1 for sampler types
It looks inconsistent to return 1 for image types and 0 for
sampler types. Especially because component_slots() is mostly
used by values_for_type() which always returns 1 for samplers.
For bindless, this value will be bumped to 2 because the
ARB_bindless_texture states that bindless samplers/images
should consume two components.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl_types.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index db65bb0e00d..0480bef80ec 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -1296,13 +1296,12 @@ glsl_type::component_slots() const case GLSL_TYPE_ARRAY: return this->length * this->fields.array->component_slots(); + case GLSL_TYPE_SAMPLER: case GLSL_TYPE_IMAGE: - return 1; case GLSL_TYPE_SUBROUTINE: - return 1; + return 1; case GLSL_TYPE_FUNCTION: - case GLSL_TYPE_SAMPLER: case GLSL_TYPE_ATOMIC_UINT: case GLSL_TYPE_VOID: case GLSL_TYPE_ERROR: |