GLSL: Inherit memory qualifiers, both declaratively and in execution.

Fixes #1870, probably others.
This commit is contained in:
John Kessenich
2019-08-22 06:58:26 -06:00
parent 28f314d436
commit 9a5689f632
11 changed files with 371 additions and 89 deletions

View File

@@ -0,0 +1,43 @@
#version 310 es
precision mediump float;
struct S {
float buff[10];
};
layout(std430, binding=2) readonly buffer RoBuff {
float buff_ro[10];
S s_ro;
} ro_buffer;
layout(std430, binding=2) buffer Buff {
float buff[10];
S s;
} non_ro_buffer;
void non_ro_fun(float[10] buff) { }
void non_ro_funf(float el) { }
void non_ro_funS(S s) { }
out vec4 fragColor;
void main()
{
S s;
non_ro_fun(s.buff);
non_ro_funf(s.buff[3]);
non_ro_funS(s);
non_ro_fun(non_ro_buffer.buff);
non_ro_fun(non_ro_buffer.s.buff);
non_ro_funf(non_ro_buffer.buff[3]);
non_ro_funf(non_ro_buffer.s.buff[3]);
non_ro_funS(non_ro_buffer.s);
non_ro_fun(ro_buffer.buff_ro);
non_ro_fun(ro_buffer.s_ro.buff);
non_ro_funf(ro_buffer.buff_ro[3]);
non_ro_funf(ro_buffer.s_ro.buff[3]);
non_ro_funS(ro_buffer.s_ro);
}