mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 21:10:12 +01:00
glsl: allow image qualifiers inside structures
ARB_bindless_texture allows to declare images inside structures which means that qualifiers like writeonly should be allowed. I have a got a confirmation from Jeff Bolz (one author of the spec), because the spec doesn't clearly explain this. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
48b7882200
commit
242964ca5c
1 changed files with 23 additions and 4 deletions
|
|
@ -2409,10 +2409,29 @@ struct_declaration:
|
|||
ast_fully_specified_type *const type = $1;
|
||||
type->set_location(@1);
|
||||
|
||||
if (type->qualifier.flags.i != 0)
|
||||
_mesa_glsl_error(&@1, state,
|
||||
"only precision qualifiers may be applied to "
|
||||
"structure members");
|
||||
if (state->has_bindless()) {
|
||||
ast_type_qualifier input_layout_mask;
|
||||
|
||||
/* Allow to declare qualifiers for images. */
|
||||
input_layout_mask.flags.i = 0;
|
||||
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;
|
||||
|
||||
if ((type->qualifier.flags.i & ~input_layout_mask.flags.i) != 0) {
|
||||
_mesa_glsl_error(&@1, state,
|
||||
"only precision and image qualifiers may be "
|
||||
"applied to structure members");
|
||||
}
|
||||
} else {
|
||||
if (type->qualifier.flags.i != 0)
|
||||
_mesa_glsl_error(&@1, state,
|
||||
"only precision qualifiers may be applied to "
|
||||
"structure members");
|
||||
}
|
||||
|
||||
$$ = new(ctx) ast_declarator_list(type);
|
||||
$$->set_location(@2);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue