[Mesa-dev] [RFC PATCH 38/56] glsl: more implicit sizing probably junk
Chris Forbes
chrisf at ijw.co.nz
Sat Sep 20 18:41:18 PDT 2014
---
src/glsl/ast_array_index.cpp | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp
index 1ad8361..e0110fe 100644
--- a/src/glsl/ast_array_index.cpp
+++ b/src/glsl/ast_array_index.cpp
@@ -107,9 +107,22 @@ static int
get_implicit_array_size(struct _mesa_glsl_parse_state *state,
ir_rvalue *array)
{
- /* Return the appropriate implicit array size. */
+ ir_variable *var = array->variable_referenced();
+
+ /* Inputs in control shader are implicitly sized
+ * to the maximum patch size.
+ */
if (state->stage == MESA_SHADER_TESS_CTRL &&
- array->variable_referenced()->data.mode == ir_var_shader_in) {
+ var->data.mode == ir_var_shader_in) {
+ return state->Const.MaxPatchVertices;
+ }
+
+ /* Non-patch inputs in evaluation shader are implicitly sized
+ * to the maximum patch size.
+ */
+ if (state->stage == MESA_SHADER_TESS_EVAL &&
+ var->data.mode == ir_var_shader_in &&
+ !var->data.patch) {
return state->Const.MaxPatchVertices;
}
--
2.1.0
More information about the mesa-dev
mailing list