glsl: make count_attribute_slots() returns 1 for samplers/images
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 1 May 2017 20:24:52 +0000 (22:24 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sat, 6 May 2017 14:40:19 +0000 (16:40 +0200)
For packed varyings.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl_types.cpp

index 8fa626bba96a677f28b5698dc599360611383233..00a95d4a8ed376b649791de74285be4d90476610 100644 (file)
@@ -1963,6 +1963,8 @@ glsl_type::count_attribute_slots(bool is_vertex_input) const
    case GLSL_TYPE_INT:
    case GLSL_TYPE_FLOAT:
    case GLSL_TYPE_BOOL:
+   case GLSL_TYPE_SAMPLER:
+   case GLSL_TYPE_IMAGE:
       return this->matrix_columns;
    case GLSL_TYPE_DOUBLE:
    case GLSL_TYPE_UINT64:
@@ -1985,8 +1987,6 @@ glsl_type::count_attribute_slots(bool is_vertex_input) const
       return this->length * this->fields.array->count_attribute_slots(is_vertex_input);
 
    case GLSL_TYPE_FUNCTION:
-   case GLSL_TYPE_SAMPLER:
-   case GLSL_TYPE_IMAGE:
    case GLSL_TYPE_ATOMIC_UINT:
    case GLSL_TYPE_VOID:
    case GLSL_TYPE_SUBROUTINE: