GLSL: emit [] for runtime-sized arrays, not [0].
Bug: tint:1262 Change-Id: Ic58729f075353f957c5d974c742b531e1e2cf518 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67940 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
parent
d148be4f00
commit
e9216ce595
|
@ -2310,7 +2310,11 @@ bool GeneratorImpl::EmitType(std::ostream& out,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (uint32_t size : sizes) {
|
for (uint32_t size : sizes) {
|
||||||
|
if (size > 0) {
|
||||||
out << "[" << size << "]";
|
out << "[" << size << "]";
|
||||||
|
} else {
|
||||||
|
out << "[]";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (type->Is<sem::Bool>()) {
|
} else if (type->Is<sem::Bool>()) {
|
||||||
out << "bool";
|
out << "bool";
|
||||||
|
|
|
@ -53,7 +53,7 @@ precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
layout (binding = 1) buffer my_struct_1 {
|
layout (binding = 1) buffer my_struct_1 {
|
||||||
float a[0];
|
float a[];
|
||||||
} b;
|
} b;
|
||||||
|
|
||||||
void a_func() {
|
void a_func() {
|
||||||
|
@ -105,7 +105,7 @@ precision mediump float;
|
||||||
|
|
||||||
layout (binding = 1) buffer my_struct_1 {
|
layout (binding = 1) buffer my_struct_1 {
|
||||||
float z;
|
float z;
|
||||||
float a[0];
|
float a[];
|
||||||
} b;
|
} b;
|
||||||
|
|
||||||
void a_func() {
|
void a_func() {
|
||||||
|
@ -158,7 +158,7 @@ precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
layout (binding = 1) buffer my_struct_1 {
|
layout (binding = 1) buffer my_struct_1 {
|
||||||
float a[0];
|
float a[];
|
||||||
} b;
|
} b;
|
||||||
|
|
||||||
void a_func() {
|
void a_func() {
|
||||||
|
|
Loading…
Reference in New Issue