[Mesa-dev] [RFC PATCH 56/56] glsl: allow indexing of gl_out with gl_InvocationID even if length not known
Chris Forbes
chrisf at ijw.co.nz
Sat Sep 20 18:41:36 PDT 2014
Not all shaders are required to declare the output size; writing our
outputs doesn't require the output size to be known, so don't require
it.
---
src/glsl/ast_array_index.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp
index e0110fe..9f390d2 100644
--- a/src/glsl/ast_array_index.cpp
+++ b/src/glsl/ast_array_index.cpp
@@ -212,7 +212,7 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
if (v != NULL)
v->data.max_array_access = implicit_size - 1;
}
- else {
+ else if (array->variable_referenced()->data.mode != ir_var_shader_out) {
_mesa_glsl_error(&loc, state, "unsized array index must be constant");
}
} else if (array->type->fields.array->is_interface()
--
2.1.0
More information about the mesa-dev
mailing list