summaryrefslogtreecommitdiff
path: root/dist/Mesa/src/glsl/ast_array_index.cpp
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-02-20 22:51:21 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-02-20 22:51:21 +0000
commite6e3394a78b6d19474b3aea1458d8718d19d8325 (patch)
treefe92a58246a2181ba1459d22b92fbfc629b3cbb9 /dist/Mesa/src/glsl/ast_array_index.cpp
parent8bb43317c5713539f43fcdcb25a30cf59aa981d6 (diff)
Import Mesa 10.2.9
Diffstat (limited to 'dist/Mesa/src/glsl/ast_array_index.cpp')
-rw-r--r--dist/Mesa/src/glsl/ast_array_index.cpp26
1 files changed, 6 insertions, 20 deletions
diff --git a/dist/Mesa/src/glsl/ast_array_index.cpp b/dist/Mesa/src/glsl/ast_array_index.cpp
index ff0c7576d..f3b060ea6 100644
--- a/dist/Mesa/src/glsl/ast_array_index.cpp
+++ b/dist/Mesa/src/glsl/ast_array_index.cpp
@@ -49,12 +49,12 @@ ast_array_specifier::print(void) const
* loc and state to report the error.
*/
static void
-update_max_array_access(ir_rvalue *ir, int idx, YYLTYPE *loc,
+update_max_array_access(ir_rvalue *ir, unsigned idx, YYLTYPE *loc,
struct _mesa_glsl_parse_state *state)
{
if (ir_dereference_variable *deref_var = ir->as_dereference_variable()) {
ir_variable *var = deref_var->var;
- if (idx > (int)var->data.max_array_access) {
+ if (idx > var->data.max_array_access) {
var->data.max_array_access = idx;
/* Check whether this access will, as a side effect, implicitly cause
@@ -88,14 +88,8 @@ update_max_array_access(ir_rvalue *ir, int idx, YYLTYPE *loc,
unsigned field_index =
deref_record->record->type->field_index(deref_record->field);
assert(field_index < interface_type->length);
-
- unsigned *const max_ifc_array_access =
- deref_var->var->get_max_ifc_array_access();
-
- assert(max_ifc_array_access != NULL);
-
- if (idx > (int)max_ifc_array_access[field_index]) {
- max_ifc_array_access[field_index] = idx;
+ if (idx > deref_var->var->max_ifc_array_access[field_index]) {
+ deref_var->var->max_ifc_array_access[field_index] = idx;
/* Check whether this access will, as a side effect, implicitly
* cause the size of a built-in array to be too large.
@@ -187,8 +181,7 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
if (array->type->is_unsized_array()) {
_mesa_glsl_error(&loc, state, "unsized array index must be constant");
} else if (array->type->fields.array->is_interface()
- && array->variable_referenced()->data.mode == ir_var_uniform
- && !state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
+ && array->variable_referenced()->data.mode == ir_var_uniform) {
/* Page 46 in section 4.3.7 of the OpenGL ES 3.00 spec says:
*
* "All indexes used to index a uniform block array must be
@@ -219,13 +212,6 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
* as using a loop counter as the index to an array of samplers. If the
* loop in unrolled, the code should compile correctly. Instead, emit a
* warning.
- *
- * In GLSL 4.00 / ARB_gpu_shader5, this requirement is relaxed again to allow
- * indexing with dynamically uniform expressions. Note that these are not
- * required to be uniforms or expressions based on them, but merely that the
- * values must not diverge between shader invocations run together. If the
- * values *do* diverge, then the behavior of the operation requiring a
- * dynamically uniform expression is undefined.
*/
if (array->type->element_type()->is_sampler()) {
if (!state->is_version(130, 100)) {
@@ -240,7 +226,7 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
"expressions will be forbidden in GLSL 1.30 "
"and later");
}
- } else if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
+ } else {
_mesa_glsl_error(&loc, state,
"sampler arrays indexed with non-constant "
"expressions is forbidden in GLSL 1.30 and "