mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
glsl: add member's location layout qualifier rules for arrayed in/out blocks
From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
"For some blocks declared as arrays, the location can only be applied
at the block level: When a block is declared as an array where
additional locations are needed for each member for each block array
element, it is a compile-time error to specify locations on the block
members. That is, when locations would be under specified by applying
them on block members, they are not allowed on block members. For
arrayed interfaces (those generally having an extra level of
arrayness due to interface expansion), the outer array is stripped
before applying this rule"
From Section 1.2.1 (Changes from Revision 6 of GLSL Version) of the GLSL 4.50 spec:
"Private Bug 15678: Don’t allow location = on block members where
the block needs an array of locations"
From Section 4.4.1 (Input Layout Qualifiers) of the GLSL ES 3.20 spec
"If an input is declared as an array of blocks, excluding per-vertex-arrays
as required for tessellation, it is an error to declare a member of
the block with a location qualifier"
From Section 1.1.3 (Changes from GLSL ES 3.2 revision 3) of the GLSL ES 3.20 spec:
"Arrayed blocks cannot have layout location qualifiers on members"
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11522>
This commit is contained in:
parent
0313110c92
commit
ddf2778269
7 changed files with 53 additions and 12 deletions
|
|
@ -8389,6 +8389,59 @@ ast_interface_block::hir(exec_list *instructions,
|
|||
const glsl_type *block_array_type =
|
||||
process_array_type(&loc, block_type, this->array_specifier, state);
|
||||
|
||||
/* From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
|
||||
*
|
||||
* "For some blocks declared as arrays, the location can only be applied
|
||||
* at the block level: When a block is declared as an array where
|
||||
* additional locations are needed for each member for each block array
|
||||
* element, it is a compile-time error to specify locations on the block
|
||||
* members. That is, when locations would be under specified by applying
|
||||
* them on block members, they are not allowed on block members. For
|
||||
* arrayed interfaces (those generally having an extra level of
|
||||
* arrayness due to interface expansion), the outer array is stripped
|
||||
* before applying this rule"
|
||||
*
|
||||
* From 4.4.1 (Input Layout Qualifiers) and
|
||||
* 4.4.2 (Output Layout Qualifiers) of GLSL ES 3.20
|
||||
*
|
||||
* "If an input is declared as an array of blocks, excluding
|
||||
* per-vertex-arrays as required for tessellation, it is an error
|
||||
* to declare a member of the block with a location qualifier."
|
||||
*
|
||||
* "If an output is declared as an array of blocks, excluding
|
||||
* per-vertex-arrays as required for tessellation, it is an error
|
||||
* to declare a member of the block with a location qualifier."
|
||||
*/
|
||||
if (!redeclaring_per_vertex &&
|
||||
(state->has_enhanced_layouts() || state->has_shader_io_blocks())) {
|
||||
bool allow_location;
|
||||
switch (state->stage)
|
||||
{
|
||||
case MESA_SHADER_TESS_CTRL:
|
||||
allow_location = this->array_specifier->is_single_dimension();
|
||||
break;
|
||||
case MESA_SHADER_TESS_EVAL:
|
||||
case MESA_SHADER_GEOMETRY:
|
||||
allow_location = (this->array_specifier->is_single_dimension()
|
||||
&& var_mode == ir_var_shader_in);
|
||||
break;
|
||||
default:
|
||||
allow_location = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!allow_location) {
|
||||
for (unsigned i = 0; i < num_variables; i++) {
|
||||
if (fields[i].location != -1) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"explicit member locations are not allowed in "
|
||||
"blocks declared as arrays %s shader",
|
||||
_mesa_shader_stage_to_string(state->stage));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Section 4.3.7 (Interface Blocks) of the GLSL 1.50 spec says:
|
||||
*
|
||||
* For uniform blocks declared an array, each individual array
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@ dEQP-GLES31.functional.primitive_bounding_box.wide_points.tessellation_set_per_p
|
|||
# Got wrong error code: GL_INVALID_OPERATION, expected: GL_INVALID_VALUE after step 0 at glcCompressedFormatTests.cpp:1463 (Fail)
|
||||
KHR-GLES31.core.compressed_format.api.invalid_teximage_with_compressed_format,Fail
|
||||
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.frag,Fail
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.vert,Fail
|
||||
spec@glsl-1.20@compiler@invalid-vec4-array-to-vec3-array-conversion.vert,Fail
|
||||
spec@oes_shader_io_blocks@compiler@layout-location-aliasing.vert,Fail
|
||||
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@ spec@!opengl 3.2@gl-3.2-adj-prims line cull-front pv-first,Fail
|
|||
spec@!opengl 3.2@gl-3.2-adj-prims pv-first,Fail
|
||||
spec@arb_bindless_texture@compiler@images@arith-bound-image.frag,Crash
|
||||
spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,Crash
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.frag,Fail
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.vert,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2-mat2,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2x3-mat2x3,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2x4-mat2x4,Fail
|
||||
|
|
|
|||
|
|
|
@ -56,8 +56,6 @@ spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,C
|
|||
spec@arb_bindless_texture@illegal,Fail
|
||||
spec@arb_bindless_texture@illegal@Call glCopyTexImage* when a texture handle is referenced,Fail
|
||||
spec@arb_bindless_texture@illegal@Call glTexImage* when a texture handle is referenced,Fail
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.frag,Fail
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.vert,Fail
|
||||
spec@arb_gl_spirv@execution@ssbo@aoa,Fail
|
||||
spec@arb_gl_spirv@execution@ssbo@aoa-2,Fail
|
||||
spec@arb_gl_spirv@execution@ssbo@array,Fail
|
||||
|
|
|
|||
|
|
|
@ -37,8 +37,6 @@ spec@!opengl 3.2@gl-3.2-adj-prims line cull-front pv-first,Fail
|
|||
spec@!opengl 3.2@gl-3.2-adj-prims pv-first,Fail
|
||||
spec@arb_bindless_texture@compiler@images@arith-bound-image.frag,Crash
|
||||
spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,Crash
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.frag,Fail
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.vert,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2-mat2,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2x3-mat2x3,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2x4-mat2x4,Fail
|
||||
|
|
|
|||
|
|
|
@ -48,8 +48,6 @@ spec@!opengl 3.2@gl-3.2-adj-prims pv-first,Fail
|
|||
spec@!opengl 3.2@gl-3.2-adj-prims pv-last,Fail
|
||||
spec@arb_bindless_texture@compiler@images@arith-bound-image.frag,Crash
|
||||
spec@arb_bindless_texture@compiler@samplers@arith-bound-sampler-texture2d.frag,Crash
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.frag,Fail
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.vert,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2-mat2,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2x3-mat2x3,Fail
|
||||
spec@arb_gpu_shader_fp64@execution@conversion@frag-conversion-explicit-dmat2x4-mat2x4,Fail
|
||||
|
|
|
|||
|
|
|
@ -1345,8 +1345,6 @@ spec@arb_depth_texture@texwrap formats offset@GL_DEPTH_COMPONENT24- swizzled,Fai
|
|||
spec@arb_depth_texture@texwrap formats offset@GL_DEPTH_COMPONENT32,Fail
|
||||
spec@arb_depth_texture@texwrap formats offset@GL_DEPTH_COMPONENT32- NPOT,Fail
|
||||
spec@arb_depth_texture@texwrap formats offset@GL_DEPTH_COMPONENT32- swizzled,Fail
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.frag,Fail
|
||||
spec@arb_enhanced_layouts@compiler@block-member-locations@arrayed-block-member-location.vert,Fail
|
||||
spec@arb_enhanced_layouts@execution@component-layout@vs-fs-array-dvec3,Crash
|
||||
spec@arb_enhanced_layouts@execution@component-layout@vs-gs-fs-double,Fail
|
||||
spec@arb_es2_compatibility@texwrap formats bordercolor-swizzled,Fail
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue