mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-20 21:00:29 +01:00
glsl: link error if unsized array not-last in ssbo
If an unsized declared array is not the last in an SSBO and an implicit size can not be defined on linking time, the linker should raise an error instead of reaching an assertion on GL. This reverts part of commit3da08e1664getting back to the behavior of commit5b2675093eThe original patch was correct for GLES that should produce a compile-time error but the linker error is still necessary in desktop GL. Fixes the following piglit tests: tests/spec/arb_shader_storage_buffer_object/non_integral_size_array_member.shader_test tests/spec/arb_shader_storage_buffer_object/unsized_array_member.shader_test Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
This commit is contained in:
parent
a0ac118398
commit
429f112a11
1 changed files with 7 additions and 1 deletions
|
|
@ -146,7 +146,13 @@ private:
|
|||
*/
|
||||
const glsl_type *type_for_size = type;
|
||||
if (type->is_unsized_array()) {
|
||||
assert(last_field);
|
||||
if (!last_field) {
|
||||
linker_error(prog, "unsized array `%s' definition: "
|
||||
"only last member of a shader storage block "
|
||||
"can be defined as unsized array",
|
||||
name);
|
||||
}
|
||||
|
||||
type_for_size = type->without_array();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue