Atomic memory function can only be used for shader storage block member or shared variable.
The glsl spec says:A shader will fail to compile if the value passed to the mem argument of an atomic memory function does not correspond to a buffer or shared variable.
This commit is contained in:
parent
202c8abae0
commit
587261a817
4 changed files with 113 additions and 0 deletions
19
Test/atomicAdd.comp
Normal file
19
Test/atomicAdd.comp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#version 320 es
|
||||
layout(local_size_x = 1) in;
|
||||
|
||||
struct structType{
|
||||
int y[3];
|
||||
};
|
||||
|
||||
layout(std430) buffer t2 {
|
||||
structType f;
|
||||
} t;
|
||||
|
||||
buffer coherent Buffer { int x; };
|
||||
int z;
|
||||
|
||||
void main() {
|
||||
atomicAdd(x, 1);
|
||||
atomicAdd(t.f.y[1], 1);
|
||||
atomicAdd(z, 1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue