|| this->flags.q.column_major
|| this->flags.q.row_major
|| this->flags.q.packed
+ || this->flags.q.bindless_sampler
+ || this->flags.q.bindless_image
+ || this->flags.q.bound_sampler
+ || this->flags.q.bound_image
|| this->flags.q.explicit_align
|| this->flags.q.explicit_component
|| this->flags.q.explicit_location
|| this->flags.q.write_only;
}
+bool ast_type_qualifier::is_subroutine_decl() const
+{
+ return this->flags.q.subroutine && !this->subroutine_list;
+}
+
static bool
validate_prim_type(YYLTYPE *loc,
_mesa_glsl_parse_state *state,
return true;
}
+static void
+merge_bindless_qualifier(_mesa_glsl_parse_state *state)
+{
+ if (state->default_uniform_qualifier->flags.q.bindless_sampler) {
+ state->bindless_sampler_specified = true;
+ state->default_uniform_qualifier->flags.q.bindless_sampler = false;
+ }
+
+ if (state->default_uniform_qualifier->flags.q.bindless_image) {
+ state->bindless_image_specified = true;
+ state->default_uniform_qualifier->flags.q.bindless_image = false;
+ }
+
+ if (state->default_uniform_qualifier->flags.q.bound_sampler) {
+ state->bound_sampler_specified = true;
+ state->default_uniform_qualifier->flags.q.bound_sampler = false;
+ }
+
+ if (state->default_uniform_qualifier->flags.q.bound_image) {
+ state->bound_image_specified = true;
+ state->default_uniform_qualifier->flags.q.bound_image = false;
+ }
+}
+
/**
* This function merges duplicate layout identifiers.
*
input_layout_mask.flags.q.precise = 1;
input_layout_mask.flags.q.sample = 1;
input_layout_mask.flags.q.smooth = 1;
+ input_layout_mask.flags.q.non_coherent = 1;
+
+ if (state->has_bindless()) {
+ /* Allow to use image qualifiers with shader inputs/outputs. */
+ input_layout_mask.flags.q.coherent = 1;
+ input_layout_mask.flags.q._volatile = 1;
+ input_layout_mask.flags.q.restrict_flag = 1;
+ input_layout_mask.flags.q.read_only = 1;
+ input_layout_mask.flags.q.write_only = 1;
+ input_layout_mask.flags.q.explicit_image_format = 1;
+ }
/* Uniform block layout qualifiers get to overwrite each
* other (rightmost having priority), while all other
if (q.flags.q.local_size_variable)
this->flags.q.local_size_variable = true;
+ if (q.flags.q.bindless_sampler)
+ this->flags.q.bindless_sampler = true;
+
+ if (q.flags.q.bindless_image)
+ this->flags.q.bindless_image = true;
+
+ if (q.flags.q.bound_sampler)
+ this->flags.q.bound_sampler = true;
+
+ if (q.flags.q.bound_image)
+ this->flags.q.bound_image = true;
+
this->flags.i |= q.flags.i;
if (this->flags.q.in &&
this->image_base_type = q.image_base_type;
}
+ if (q.flags.q.bindless_sampler ||
+ q.flags.q.bindless_image ||
+ q.flags.q.bound_sampler ||
+ q.flags.q.bound_image)
+ merge_bindless_qualifier(state);
+
return r;
}
"%s '%s':"
"%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
"%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
- "%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+ "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
message, name,
bad.flags.q.invariant ? " invariant" : "",
bad.flags.q.precise ? " precise" : "",
bad.flags.q.subroutine ? " subroutine" : "",
bad.flags.q.blend_support ? " blend_support" : "",
bad.flags.q.inner_coverage ? " inner_coverage" : "",
- bad.flags.q.post_depth_coverage ? " post_depth_coverage" : "");
+ bad.flags.q.bindless_sampler ? " bindless_sampler" : "",
+ bad.flags.q.bindless_image ? " bindless_image" : "",
+ bad.flags.q.bound_sampler ? " bound_sampler" : "",
+ bad.flags.q.bound_image ? " bound_image" : "",
+ bad.flags.q.post_depth_coverage ? " post_depth_coverage" : "",
+ bad.flags.q.non_coherent ? " noncoherent" : "");
return false;
}
ir_rvalue *const ir = const_expression->hir(&dummy_instructions, state);
- ir_constant *const const_int = ir->constant_expression_value();
+ ir_constant *const const_int =
+ ir->constant_expression_value(ralloc_parent(ir));
+
if (const_int == NULL || !const_int->type->is_integer()) {
YYLTYPE loc = const_expression->get_location();
_mesa_glsl_error(&loc, state, "%s must be an integral constant "
ir_rvalue *const ir = const_expression->hir(&dummy_instructions, state);
- ir_constant *const const_int = ir->constant_expression_value();
+ ir_constant *const const_int =
+ ir->constant_expression_value(ralloc_parent(ir));
if (const_int == NULL || !const_int->type->is_integer()) {
_mesa_glsl_error(loc, state, "%s must be an integral constant "
"expression", qual_indentifier);