glsl2: Don't assert in a couple of places when encountering sampler arrays.

Fixes glean shaderAPI.
This commit is contained in:
Eric Anholt
2010-08-05 16:00:46 -07:00
parent 658e25987f
commit 8d61a23b1a
2 changed files with 11 additions and 4 deletions
+6 -4
View File
@@ -793,11 +793,13 @@ assign_uniform_locations(struct gl_shader_program *prog)
if ((var == NULL) || (var->mode != ir_var_uniform))
continue;
if (var->type->is_sampler())
continue;
const unsigned vec4_slots = (var->component_slots() + 3) / 4;
assert(vec4_slots != 0);
if (vec4_slots == 0) {
/* If we've got a sampler or an aggregate of them, the size can
* end up zero. Don't allocate any space.
*/
continue;
}
uniform_node *n = (uniform_node *) hash_table_find(ht, var->name);
if (n == NULL) {
+5
View File
@@ -518,6 +518,11 @@ type_size(const struct glsl_type *type)
size += type_size(type->fields.structure[i].type);
}
return size;
case GLSL_TYPE_SAMPLER:
/* Samplers take up no register space, since they're baked in at
* link time.
*/
return 0;
default:
assert(0);
}