summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2017-04-28 11:48:29 -0700
committerMatt Turner <[email protected]>2017-04-28 11:48:57 -0700
commitb64da3d14e9778a17ccf8ed444a103d117eecb6f (patch)
treeb3f2b869421f37d7d435ee745598360158fada97 /src/compiler
parent85ca563b583d39664752d0686894353c8ed96089 (diff)
Revert "glsl: set vector_elements to 1 for samplers"
This reverts commit 75a31a20af269c047661af33e28f793269537b79. This breaks thousands of tests on i965 with malloc corruption.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl_types.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index bf078ad6141..0480bef80ec 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -95,7 +95,12 @@ glsl_type::glsl_type(GLenum gl_type, glsl_base_type base_type,
memset(& fields, 0, sizeof(fields));
- matrix_columns = vector_elements = 1;
+ if (is_sampler()) {
+ /* Samplers take no storage whatsoever. */
+ matrix_columns = vector_elements = 0;
+ } else {
+ matrix_columns = vector_elements = 1;
+ }
}
glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,