[Mesa-dev] [PATCH 1/2] glsl: Properly count doubles as taking twice the number of attrib slots.

Matt Turner mattst88 at gmail.com
Tue Sep 1 15:57:09 PDT 2015


---
I checked the uses of count_attribute_slots() and it looks like they're
expecting this already, but these two patches definitely need testing on
a driver that supports fp64.

 src/glsl/glsl_types.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 755618a..cd7fef5 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -1386,9 +1386,11 @@ glsl_type::count_attribute_slots() const
    case GLSL_TYPE_INT:
    case GLSL_TYPE_FLOAT:
    case GLSL_TYPE_BOOL:
-   case GLSL_TYPE_DOUBLE:
       return this->matrix_columns;
 
+   case GLSL_TYPE_DOUBLE:
+      return this->matrix_columns * 2;
+
    case GLSL_TYPE_STRUCT:
    case GLSL_TYPE_INTERFACE: {
       unsigned size = 0;
-- 
2.4.6



More information about the mesa-dev mailing list