ast_type_qualifier subroutine_only;
subroutine_only.flags.i = 0;
subroutine_only.flags.q.subroutine = 1;
- subroutine_only.flags.q.subroutine_def = 1;
if (state->has_explicit_uniform_location()) {
subroutine_only.flags.q.explicit_index = 1;
}
{
return this->flags.q.origin_upper_left
|| this->flags.q.pixel_center_integer
- || this->flags.q.depth_any
- || this->flags.q.depth_greater
- || this->flags.q.depth_less
- || this->flags.q.depth_unchanged
+ || this->flags.q.depth_type
|| this->flags.q.std140
|| this->flags.q.std430
|| this->flags.q.shared
|| 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,
}
static bool
-validate_point_mode(YYLTYPE *loc,
- _mesa_glsl_parse_state *state,
- const ast_type_qualifier &qualifier,
- const ast_type_qualifier &new_qualifier)
+validate_point_mode(MAYBE_UNUSED const ast_type_qualifier &qualifier,
+ MAYBE_UNUSED const ast_type_qualifier &new_qualifier)
{
/* Point mode can only be true if the flag is set. */
assert (!qualifier.flags.q.point_mode || !new_qualifier.flags.q.point_mode
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.subroutine_def) {
- if (this->flags.q.subroutine_def) {
+ if (q.subroutine_list) {
+ if (this->subroutine_list) {
_mesa_glsl_error(loc, state,
"conflicting subroutine qualifiers used");
} else {
}
if (q.flags.q.point_mode) {
- r &= validate_point_mode(loc, state, *this, q);
+ r &= validate_point_mode(*this, q);
this->flags.q.point_mode = 1;
this->point_mode = q.point_mode;
}
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;
}
r &= validate_prim_type(loc, state, *state->in_qualifier, *this);
r &= validate_vertex_spacing(loc, state, *state->in_qualifier, *this);
r &= validate_ordering(loc, state, *state->in_qualifier, *this);
- r &= validate_point_mode(loc, state, *state->in_qualifier, *this);
+ r &= validate_point_mode(*state->in_qualifier, *this);
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%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.explicit_index ? " index" : "",
bad.flags.q.explicit_binding ? " binding" : "",
bad.flags.q.explicit_offset ? " offset" : "",
- bad.flags.q.depth_any ? " depth_any" : "",
- bad.flags.q.depth_greater ? " depth_greater" : "",
- bad.flags.q.depth_less ? " depth_less" : "",
- bad.flags.q.depth_unchanged ? " depth_unchanged" : "",
+ bad.flags.q.depth_type ? " depth_type" : "",
bad.flags.q.std140 ? " std140" : "",
bad.flags.q.std430 ? " std430" : "",
bad.flags.q.shared ? " shared" : "",
bad.flags.q.point_mode ? " point_mode" : "",
bad.flags.q.vertices ? " vertices" : "",
bad.flags.q.subroutine ? " subroutine" : "",
- bad.flags.q.subroutine_def ? " subroutine_def" : "",
+ 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);