Allow arrays of floats as varyings.
The comment just above the code said arrays were OK, then it didn't handle arrays. Whoops. Partially fixes CorrectUnsizedArray.frat.
This commit is contained in:
@@ -1426,11 +1426,20 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
|
|||||||
* float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
|
* float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
|
||||||
* these."
|
* these."
|
||||||
*/
|
*/
|
||||||
if (qual->varying && var->type->base_type != GLSL_TYPE_FLOAT) {
|
if (qual->varying) {
|
||||||
|
const glsl_type *non_array_type;
|
||||||
|
|
||||||
|
if (var->type && var->type->is_array())
|
||||||
|
non_array_type = var->type->fields.array;
|
||||||
|
else
|
||||||
|
non_array_type = var->type;
|
||||||
|
|
||||||
|
if (non_array_type && non_array_type->base_type != GLSL_TYPE_FLOAT) {
|
||||||
var->type = glsl_type::error_type;
|
var->type = glsl_type::error_type;
|
||||||
_mesa_glsl_error(loc, state,
|
_mesa_glsl_error(loc, state,
|
||||||
"varying variables must be of base type float");
|
"varying variables must be of base type float");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (qual->in && qual->out)
|
if (qual->in && qual->out)
|
||||||
var->mode = ir_var_inout;
|
var->mode = ir_var_inout;
|
||||||
|
Reference in New Issue
Block a user