summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2012-03-24 13:33:41 +0000
committerDave Airlie <[email protected]>2012-04-13 17:19:01 +0100
commit1256a5dcc86014d48bdc6fd10ea5a2fa11241667 (patch)
tree8739552f09debe93734d1b338ac0e2787fc8a80f /src/glsl/ast_to_hir.cpp
parentf8cf79936b42405a8366613b80e3bde21aadaa02 (diff)
glsl: add support for ARB_blend_func_extended (v3)
This adds index support to the GLSL compiler. I'm not 100% sure of my approach here, esp without how output ordering happens wrt location, index pairs, in the "mark" function. Since current hw doesn't ever have a location > 0 with an index > 0, we don't have to work out if the output ordering the hw requires is location, index, location, index or location, location, index, index. But we have no hw to know, so punt on it for now. v2: index requires layout - catch and error setup explicit index properly. v3: drop idx_offset stuff, assume index follow location Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index f4dfc4ce34c..820c86c5e6b 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2092,14 +2092,21 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
} else {
var->location = qual->location;
}
+ if (qual->flags.q.explicit_index) {
+ var->explicit_index = true;
+ var->index = qual->index;
+ }
}
+ } else if (qual->flags.q.explicit_index) {
+ _mesa_glsl_error(loc, state,
+ "explicit index requires explicit location\n");
}
/* Does the declaration use the 'layout' keyword?
*/
const bool uses_layout = qual->flags.q.pixel_center_integer
|| qual->flags.q.origin_upper_left
- || qual->flags.q.explicit_location;
+ || qual->flags.q.explicit_location; /* no need for index since it relies on location */
/* Does the declaration use the deprecated 'attribute' or 'varying'
* keywords?