Unverified Commit 930403e5 by John Kessenich Committed by GitHub

Merge branch 'master' into ARB_uniform_buffer_object

parents 97c4c093 18fb7f24
...@@ -7482,7 +7482,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: ...@@ -7482,7 +7482,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
id = builder.createCompositeExtract(mulOp, typeId, 0); id = builder.createCompositeExtract(mulOp, typeId, 0);
for (int i = 1; i < componentCount; ++i) { for (int i = 1; i < componentCount; ++i) {
builder.setPrecision(id, precision); builder.setPrecision(id, precision);
id = builder.createBinOp(spv::OpIAdd, typeId, id, builder.createCompositeExtract(operands[0], typeId, i)); id = builder.createBinOp(spv::OpIAdd, typeId, id, builder.createCompositeExtract(mulOp, typeId, i));
} }
} else { } else {
switch (consumedOperands) { switch (consumedOperands) {
......
...@@ -62,12 +62,14 @@ void bar2() ...@@ -62,12 +62,14 @@ void bar2()
b3 < b3; // ERROR b3 < b3; // ERROR
uv3 > uv3; // ERROR uv3 > uv3; // ERROR
uvec2(2, 3) >= uvec2(3,3); // ERROR uvec2(2, 3) >= uvec2(3,3); // ERROR
int samples = gl_NumSamples; // ERROR
int(bl4) <= int(bl4); // true int(bl4) <= int(bl4); // true
int(bl4.x) > int(bl4.y); // false int(bl4.x) > int(bl4.y); // false
} }
#extension GL_ARB_texture_gather : enable #extension GL_ARB_texture_gather : enable
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
#extension GL_ARB_sample_shading : enable
uniform sampler2D samp2D; uniform sampler2D samp2D;
uniform sampler2DShadow samp2DS; uniform sampler2DShadow samp2DS;
...@@ -83,6 +85,7 @@ void bar23() ...@@ -83,6 +85,7 @@ void bar23()
s = textureGatherOffset(samp2DA, vec3(0.3), ivec2(1)); s = textureGatherOffset(samp2DA, vec3(0.3), ivec2(1));
s = textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1)); // ERROR s = textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1)); // ERROR
s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2); // ERROR s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2); // ERROR
int samples = gl_NumSamples;
} }
#extension GL_ARB_gpu_shader5 : enable #extension GL_ARB_gpu_shader5 : enable
......
...@@ -17,6 +17,7 @@ void main() ...@@ -17,6 +17,7 @@ void main()
#error GL_ES is not set #error GL_ES is not set
#endif #endif
in struct S { float f; } s; // ERROR in struct S { float f; } s; // ERROR
float patch = 3.1; float patch = 3.1;
...@@ -51,3 +52,9 @@ float fooi() ...@@ -51,3 +52,9 @@ float fooi()
{ {
return i1 + i2; return i1 + i2;
} }
uniform sampler2DMS aaa1; // ERROR
#extension GL_ARB_texture_multisample : enable
uniform sampler2DMS aaa2;
#version 420 core #version 420 core
layout(binding = 0) uniform atomic_uint counter; layout(binding = 0) uniform atomic_uint counter;
layout(binding = 0, offset = 9) uniform atomic_uint counter;
uint func(atomic_uint c) uint func(atomic_uint c)
{ {
...@@ -41,7 +42,7 @@ uniform atomic_uint aNoBind; // ERROR, no binding ...@@ -41,7 +42,7 @@ uniform atomic_uint aNoBind; // ERROR, no binding
layout(binding=0, offset=32) uniform atomic_uint aOffset; layout(binding=0, offset=32) uniform atomic_uint aOffset;
layout(binding=0, offset=4) uniform atomic_uint; layout(binding=0, offset=4) uniform atomic_uint;
layout(binding=0) uniform atomic_uint bar3; // offset is 4 layout(binding=0) uniform atomic_uint bar3; // offset is 4
layout(binding=0) uniform atomic_uint ac[3]; // offset = 8 layout(binding=0) uniform atomic_uint ac[2]; // offset = 8
layout(binding=0) uniform atomic_uint ad; // offset = 20 layout(binding=0) uniform atomic_uint ad; // offset = 20
layout(offset=8) uniform atomic_uint bar4; // ERROR, no binding layout(offset=8) uniform atomic_uint bar4; // ERROR, no binding
layout(binding = 0, offset = 12) uniform atomic_uint overlap; // ERROR, overlapping offsets layout(binding = 0, offset = 12) uniform atomic_uint overlap; // ERROR, overlapping offsets
......
140.frag 140.frag
WARNING: 0:3: varying deprecated in version 130; may be removed in future release WARNING: 0:3: varying deprecated in version 130; may be removed in future release
ERROR: 0:17: '#error' : GL_ES is not set ERROR: 0:17: '#error' : GL_ES is not set
ERROR: 0:20: 'fragment-shader struct input' : not supported for this version or the enabled extensions ERROR: 0:21: 'fragment-shader struct input' : not supported for this version or the enabled extensions
ERROR: 0:24: 'location' : not supported for this version or the enabled extensions ERROR: 0:25: 'location' : not supported for this version or the enabled extensions
ERROR: 0:24: 'location qualifier on input' : not supported for this version or the enabled extensions ERROR: 0:25: 'location qualifier on input' : not supported for this version or the enabled extensions
ERROR: 0:26: 'location' : not supported for this version or the enabled extensions ERROR: 0:27: 'location' : not supported for this version or the enabled extensions
ERROR: 0:26: 'location qualifier on output' : not supported for this version or the enabled extensions ERROR: 0:27: 'location qualifier on output' : not supported for this version or the enabled extensions
ERROR: 0:40: 'assign' : l-value required "v" (can't modify shader input) ERROR: 0:41: 'assign' : l-value required "v" (can't modify shader input)
ERROR: 0:40: 'out' : Non-L-value cannot be passed for 'out' or 'inout' parameters. ERROR: 0:41: 'out' : Non-L-value cannot be passed for 'out' or 'inout' parameters.
ERROR: 8 compilation errors. No code generated. ERROR: 0:56: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 9 compilation errors. No code generated.
Shader version: 140 Shader version: 140
...@@ -25,80 +26,80 @@ ERROR: node is still EOpNull! ...@@ -25,80 +26,80 @@ ERROR: node is still EOpNull!
0:12 'gl_ClipDistance' ( smooth in 5-element array of float ClipDistance) 0:12 'gl_ClipDistance' ( smooth in 5-element array of float ClipDistance)
0:12 Constant: 0:12 Constant:
0:12 2 (const int) 0:12 2 (const int)
0:22 Sequence 0:23 Sequence
0:22 move second child to first child ( temp float) 0:23 move second child to first child ( temp float)
0:22 'patch' ( global float) 0:23 'patch' ( global float)
0:22 Constant: 0:23 Constant:
0:22 3.100000 0:23 3.100000
0:38 Function Definition: foo( ( global void) 0:39 Function Definition: foo( ( global void)
0:38 Function Parameters: 0:39 Function Parameters:
0:40 Sequence 0:41 Sequence
0:40 Sequence
0:40 move second child to first child ( temp 2-component vector of float)
0:40 'r1' ( temp 2-component vector of float)
0:40 modf ( global 2-component vector of float)
0:40 vector swizzle ( temp 2-component vector of float)
0:40 'v' ( smooth in 4-component vector of float)
0:40 Sequence
0:40 Constant:
0:40 0 (const int)
0:40 Constant:
0:40 1 (const int)
0:40 vector swizzle ( temp 2-component vector of float)
0:40 'v' ( smooth in 4-component vector of float)
0:40 Sequence
0:40 Constant:
0:40 2 (const int)
0:40 Constant:
0:40 3 (const int)
0:41 Sequence 0:41 Sequence
0:41 move second child to first child ( temp 2-component vector of float) 0:41 move second child to first child ( temp 2-component vector of float)
0:41 'r2' ( temp 2-component vector of float) 0:41 'r1' ( temp 2-component vector of float)
0:41 modf ( global 2-component vector of float) 0:41 modf ( global 2-component vector of float)
0:41 vector swizzle ( temp 2-component vector of float) 0:41 vector swizzle ( temp 2-component vector of float)
0:41 'o' ( out 4-component vector of float) 0:41 'v' ( smooth in 4-component vector of float)
0:41 Sequence 0:41 Sequence
0:41 Constant: 0:41 Constant:
0:41 0 (const int) 0:41 0 (const int)
0:41 Constant: 0:41 Constant:
0:41 1 (const int) 0:41 1 (const int)
0:41 vector swizzle ( temp 2-component vector of float) 0:41 vector swizzle ( temp 2-component vector of float)
0:41 'o' ( out 4-component vector of float) 0:41 'v' ( smooth in 4-component vector of float)
0:41 Sequence 0:41 Sequence
0:41 Constant: 0:41 Constant:
0:41 2 (const int) 0:41 2 (const int)
0:41 Constant: 0:41 Constant:
0:41 3 (const int) 0:41 3 (const int)
0:42 move second child to first child ( temp float) 0:42 Sequence
0:42 direct index ( temp float) 0:42 move second child to first child ( temp 2-component vector of float)
0:42 'o' ( out 4-component vector of float) 0:42 'r2' ( temp 2-component vector of float)
0:42 Constant: 0:42 modf ( global 2-component vector of float)
0:42 2 (const int) 0:42 vector swizzle ( temp 2-component vector of float)
0:42 Function Call: fooi( ( global float) 0:42 'o' ( out 4-component vector of float)
0:47 Sequence 0:42 Sequence
0:47 move second child to first child ( temp float) 0:42 Constant:
0:47 'i1' ( global float) 0:42 0 (const int)
0:47 Test condition and select ( temp float) 0:42 Constant:
0:47 Condition 0:42 1 (const int)
0:47 'gl_FrontFacing' ( gl_FrontFacing bool Face) 0:42 vector swizzle ( temp 2-component vector of float)
0:47 true case 0:42 'o' ( out 4-component vector of float)
0:47 Constant: 0:42 Sequence
0:47 -2.000000 0:42 Constant:
0:47 false case 0:42 2 (const int)
0:47 Constant: 0:42 Constant:
0:47 2.000000 0:42 3 (const int)
0:43 move second child to first child ( temp float)
0:43 direct index ( temp float)
0:43 'o' ( out 4-component vector of float)
0:43 Constant:
0:43 2 (const int)
0:43 Function Call: fooi( ( global float)
0:48 Sequence 0:48 Sequence
0:48 move second child to first child ( temp float) 0:48 move second child to first child ( temp float)
0:48 'i2' ( global float) 0:48 'i1' ( global float)
0:48 Constant: 0:48 Test condition and select ( temp float)
0:48 102.000000 0:48 Condition
0:50 Function Definition: fooi( ( global float) 0:48 'gl_FrontFacing' ( gl_FrontFacing bool Face)
0:50 Function Parameters: 0:48 true case
0:52 Sequence 0:48 Constant:
0:52 Branch: Return with expression 0:48 -2.000000
0:52 add ( temp float) 0:48 false case
0:52 'i1' ( global float) 0:48 Constant:
0:52 'i2' ( global float) 0:48 2.000000
0:49 Sequence
0:49 move second child to first child ( temp float)
0:49 'i2' ( global float)
0:49 Constant:
0:49 102.000000
0:51 Function Definition: fooi( ( global float)
0:51 Function Parameters:
0:53 Sequence
0:53 Branch: Return with expression
0:53 add ( temp float)
0:53 'i1' ( global float)
0:53 'i2' ( global float)
0:? Linker Objects 0:? Linker Objects
0:? 'v' ( smooth in 4-component vector of float) 0:? 'v' ( smooth in 4-component vector of float)
0:? 'i' ( smooth in 4-component vector of float) 0:? 'i' ( smooth in 4-component vector of float)
...@@ -131,28 +132,28 @@ ERROR: node is still EOpNull! ...@@ -131,28 +132,28 @@ ERROR: node is still EOpNull!
0:12 'gl_ClipDistance' ( smooth in 5-element array of float ClipDistance) 0:12 'gl_ClipDistance' ( smooth in 5-element array of float ClipDistance)
0:12 Constant: 0:12 Constant:
0:12 2 (const int) 0:12 2 (const int)
0:22 Sequence 0:23 Sequence
0:22 move second child to first child ( temp float) 0:23 move second child to first child ( temp float)
0:22 'patch' ( global float) 0:23 'patch' ( global float)
0:22 Constant: 0:23 Constant:
0:22 3.100000 0:23 3.100000
0:47 Sequence
0:47 move second child to first child ( temp float)
0:47 'i1' ( global float)
0:47 Test condition and select ( temp float)
0:47 Condition
0:47 'gl_FrontFacing' ( gl_FrontFacing bool Face)
0:47 true case
0:47 Constant:
0:47 -2.000000
0:47 false case
0:47 Constant:
0:47 2.000000
0:48 Sequence 0:48 Sequence
0:48 move second child to first child ( temp float) 0:48 move second child to first child ( temp float)
0:48 'i2' ( global float) 0:48 'i1' ( global float)
0:48 Constant: 0:48 Test condition and select ( temp float)
0:48 102.000000 0:48 Condition
0:48 'gl_FrontFacing' ( gl_FrontFacing bool Face)
0:48 true case
0:48 Constant:
0:48 -2.000000
0:48 false case
0:48 Constant:
0:48 2.000000
0:49 Sequence
0:49 move second child to first child ( temp float)
0:49 'i2' ( global float)
0:49 Constant:
0:49 102.000000
0:? Linker Objects 0:? Linker Objects
0:? 'v' ( smooth in 4-component vector of float) 0:? 'v' ( smooth in 4-component vector of float)
0:? 'i' ( smooth in 4-component vector of float) 0:? 'i' ( smooth in 4-component vector of float)
......
atomic_uint.frag atomic_uint.frag
ERROR: 0:10: 'atomic_uint' : samplers and atomic_uints cannot be output parameters ERROR: 0:4: 'counter' : redefinition
ERROR: 0:12: 'return' : type does not match, or is not convertible to, the function's return type ERROR: 0:11: 'atomic_uint' : samplers and atomic_uints cannot be output parameters
ERROR: 0:18: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: non_uniform_counter ERROR: 0:13: 'return' : type does not match, or is not convertible to, the function's return type
ERROR: 0:23: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings ERROR: 0:19: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: non_uniform_counter
ERROR: 0:28: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( binding=0 offset=0) uniform atomic_uint' and a right operand of type 'layout( binding=0 offset=0) uniform atomic_uint' (or there is no acceptable conversion) ERROR: 0:24: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings
ERROR: 0:29: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( binding=0 offset=0) uniform atomic_uint (or there is no acceptable conversion) ERROR: 0:29: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'layout( binding=0 offset=0) uniform atomic_uint' and a right operand of type 'layout( binding=0 offset=0) uniform atomic_uint' (or there is no acceptable conversion)
ERROR: 0:31: '[]' : scalar integer expression required ERROR: 0:30: '-' : wrong operand type no operation '-' exists that takes an operand of type layout( binding=0 offset=0) uniform atomic_uint (or there is no acceptable conversion)
ERROR: 0:34: 'assign' : l-value required "counter" (can't modify a uniform) ERROR: 0:32: '[]' : scalar integer expression required
ERROR: 0:34: 'assign' : cannot convert from ' const int' to 'layout( binding=0 offset=0) uniform atomic_uint' ERROR: 0:35: 'assign' : l-value required "counter" (can't modify a uniform)
ERROR: 0:37: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: acin ERROR: 0:35: 'assign' : cannot convert from ' const int' to 'layout( binding=0 offset=0) uniform atomic_uint'
ERROR: 0:38: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: acg ERROR: 0:38: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: acin
ERROR: 0:47: 'offset' : atomic counters sharing the same offset: 12 ERROR: 0:39: 'atomic_uint' : atomic_uints can only be used in uniform variables or function parameters: acg
ERROR: 0:48: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings ERROR: 0:48: 'offset' : atomic counters sharing the same offset: 12
ERROR: 13 compilation errors. No code generated. ERROR: 0:49: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCounterBindings
ERROR: 14 compilation errors. No code generated.
Shader version: 420 Shader version: 420
ERROR: node is still EOpNull! ERROR: node is still EOpNull!
0:5 Function Definition: func(au1; ( global uint) 0:6 Function Definition: func(au1; ( global uint)
0:5 Function Parameters: 0:6 Function Parameters:
0:5 'c' ( in atomic_uint) 0:6 'c' ( in atomic_uint)
0:7 Sequence 0:8 Sequence
0:7 Branch: Return with expression 0:8 Branch: Return with expression
0:7 AtomicCounterIncrement ( global uint) 0:8 AtomicCounterIncrement ( global uint)
0:7 'c' ( in atomic_uint) 0:8 'c' ( in atomic_uint)
0:10 Function Definition: func2(au1; ( global uint) 0:11 Function Definition: func2(au1; ( global uint)
0:10 Function Parameters: 0:11 Function Parameters:
0:10 'c' ( out atomic_uint) 0:11 'c' ( out atomic_uint)
0:12 Sequence 0:13 Sequence
0:12 Branch: Return with expression
0:12 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:13 Branch: Return with expression 0:13 Branch: Return with expression
0:13 AtomicCounter ( global uint) 0:13 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:13 'counter' (layout( binding=0 offset=0) uniform atomic_uint) 0:14 Branch: Return with expression
0:16 Function Definition: main( ( global void) 0:14 AtomicCounter ( global uint)
0:16 Function Parameters: 0:14 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:17 Function Definition: main( ( global void)
0:17 Function Parameters:
0:? Sequence 0:? Sequence
0:19 Sequence 0:20 Sequence
0:19 move second child to first child ( temp uint) 0:20 move second child to first child ( temp uint)
0:19 'val' ( temp uint) 0:20 'val' ( temp uint)
0:19 AtomicCounter ( global uint) 0:20 AtomicCounter ( global uint)
0:19 'counter' (layout( binding=0 offset=0) uniform atomic_uint) 0:20 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:20 AtomicCounterDecrement ( global uint) 0:21 AtomicCounterDecrement ( global uint)
0:20 'counter' (layout( binding=0 offset=0) uniform atomic_uint) 0:21 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:26 Function Definition: opac( ( global void) 0:27 Function Definition: opac( ( global void)
0:26 Function Parameters: 0:27 Function Parameters:
0:28 Sequence 0:29 Sequence
0:28 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:29 'counter' (layout( binding=0 offset=0) uniform atomic_uint) 0:29 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:31 indirect index ( temp int) 0:30 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:31 'a' ( temp 3-element array of int) 0:32 indirect index ( temp int)
0:31 'counter' (layout( binding=0 offset=0) uniform atomic_uint) 0:32 'a' ( temp 3-element array of int)
0:32 direct index (layout( binding=1 offset=3) temp atomic_uint) 0:32 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:32 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint) 0:33 direct index (layout( binding=1 offset=3) temp atomic_uint)
0:32 Constant:
0:32 2 (const int)
0:33 indirect index (layout( binding=1 offset=3) temp atomic_uint)
0:33 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint) 0:33 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint)
0:33 'i' ( uniform int) 0:33 Constant:
0:34 'counter' (layout( binding=0 offset=0) uniform atomic_uint) 0:33 2 (const int)
0:34 indirect index (layout( binding=1 offset=3) temp atomic_uint)
0:34 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint)
0:34 'i' ( uniform int)
0:35 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:? Linker Objects 0:? Linker Objects
0:? 'counter' (layout( binding=0 offset=0) uniform atomic_uint) 0:? 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:? 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint) 0:? 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint)
...@@ -68,8 +69,8 @@ ERROR: node is still EOpNull! ...@@ -68,8 +69,8 @@ ERROR: node is still EOpNull!
0:? 'aNoBind' ( uniform atomic_uint) 0:? 'aNoBind' ( uniform atomic_uint)
0:? 'aOffset' (layout( binding=0 offset=32) uniform atomic_uint) 0:? 'aOffset' (layout( binding=0 offset=32) uniform atomic_uint)
0:? 'bar3' (layout( binding=0 offset=4) uniform atomic_uint) 0:? 'bar3' (layout( binding=0 offset=4) uniform atomic_uint)
0:? 'ac' (layout( binding=0 offset=8) uniform 3-element array of atomic_uint) 0:? 'ac' (layout( binding=0 offset=8) uniform 2-element array of atomic_uint)
0:? 'ad' (layout( binding=0 offset=20) uniform atomic_uint) 0:? 'ad' (layout( binding=0 offset=16) uniform atomic_uint)
0:? 'bar4' (layout( offset=8) uniform atomic_uint) 0:? 'bar4' (layout( offset=8) uniform atomic_uint)
0:? 'overlap' (layout( binding=0 offset=12) uniform atomic_uint) 0:? 'overlap' (layout( binding=0 offset=12) uniform atomic_uint)
0:? 'bigBind' (layout( binding=20) uniform atomic_uint) 0:? 'bigBind' (layout( binding=20) uniform atomic_uint)
...@@ -80,16 +81,16 @@ Linked fragment stage: ...@@ -80,16 +81,16 @@ Linked fragment stage:
Shader version: 420 Shader version: 420
ERROR: node is still EOpNull! ERROR: node is still EOpNull!
0:16 Function Definition: main( ( global void) 0:17 Function Definition: main( ( global void)
0:16 Function Parameters: 0:17 Function Parameters:
0:? Sequence 0:? Sequence
0:19 Sequence 0:20 Sequence
0:19 move second child to first child ( temp uint) 0:20 move second child to first child ( temp uint)
0:19 'val' ( temp uint) 0:20 'val' ( temp uint)
0:19 AtomicCounter ( global uint) 0:20 AtomicCounter ( global uint)
0:19 'counter' (layout( binding=0 offset=0) uniform atomic_uint) 0:20 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:20 AtomicCounterDecrement ( global uint) 0:21 AtomicCounterDecrement ( global uint)
0:20 'counter' (layout( binding=0 offset=0) uniform atomic_uint) 0:21 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:? Linker Objects 0:? Linker Objects
0:? 'counter' (layout( binding=0 offset=0) uniform atomic_uint) 0:? 'counter' (layout( binding=0 offset=0) uniform atomic_uint)
0:? 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint) 0:? 'countArr' (layout( binding=1 offset=3) uniform 4-element array of atomic_uint)
...@@ -99,8 +100,8 @@ ERROR: node is still EOpNull! ...@@ -99,8 +100,8 @@ ERROR: node is still EOpNull!
0:? 'aNoBind' ( uniform atomic_uint) 0:? 'aNoBind' ( uniform atomic_uint)
0:? 'aOffset' (layout( binding=0 offset=32) uniform atomic_uint) 0:? 'aOffset' (layout( binding=0 offset=32) uniform atomic_uint)
0:? 'bar3' (layout( binding=0 offset=4) uniform atomic_uint) 0:? 'bar3' (layout( binding=0 offset=4) uniform atomic_uint)
0:? 'ac' (layout( binding=0 offset=8) uniform 3-element array of atomic_uint) 0:? 'ac' (layout( binding=0 offset=8) uniform 2-element array of atomic_uint)
0:? 'ad' (layout( binding=0 offset=20) uniform atomic_uint) 0:? 'ad' (layout( binding=0 offset=16) uniform atomic_uint)
0:? 'bar4' (layout( offset=8) uniform atomic_uint) 0:? 'bar4' (layout( offset=8) uniform atomic_uint)
0:? 'overlap' (layout( binding=0 offset=12) uniform atomic_uint) 0:? 'overlap' (layout( binding=0 offset=12) uniform atomic_uint)
0:? 'bigBind' (layout( binding=20) uniform atomic_uint) 0:? 'bigBind' (layout( binding=20) uniform atomic_uint)
......
...@@ -295,7 +295,7 @@ gl_FragCoord origin is upper left ...@@ -295,7 +295,7 @@ gl_FragCoord origin is upper left
39: 17(ivec2) Load 19(i3) 39: 17(ivec2) Load 19(i3)
40: 17(ivec2) IMul 38 39 40: 17(ivec2) IMul 38 39
41: 11(int) CompositeExtract 40 0 41: 11(int) CompositeExtract 40 0
42: 11(int) CompositeExtract 38 1 42: 11(int) CompositeExtract 40 1
43: 11(int) IAdd 41 42 43: 11(int) IAdd 41 42
44: 17(ivec2) CompositeConstruct 43 43 44: 17(ivec2) CompositeConstruct 43 43
Store 19(i3) 44 Store 19(i3) 44
...@@ -303,9 +303,9 @@ gl_FragCoord origin is upper left ...@@ -303,9 +303,9 @@ gl_FragCoord origin is upper left
46: 22(ivec3) Load 24(i4) 46: 22(ivec3) Load 24(i4)
47: 22(ivec3) IMul 45 46 47: 22(ivec3) IMul 45 46
48: 11(int) CompositeExtract 47 0 48: 11(int) CompositeExtract 47 0
49: 11(int) CompositeExtract 45 1 49: 11(int) CompositeExtract 47 1
50: 11(int) IAdd 48 49 50: 11(int) IAdd 48 49
51: 11(int) CompositeExtract 45 2 51: 11(int) CompositeExtract 47 2
52: 11(int) IAdd 50 51 52: 11(int) IAdd 50 51
53: 22(ivec3) CompositeConstruct 52 52 52 53: 22(ivec3) CompositeConstruct 52 52 52
Store 24(i4) 53 Store 24(i4) 53
...@@ -313,11 +313,11 @@ gl_FragCoord origin is upper left ...@@ -313,11 +313,11 @@ gl_FragCoord origin is upper left
55: 27(ivec4) Load 29(i5) 55: 27(ivec4) Load 29(i5)
56: 27(ivec4) IMul 54 55 56: 27(ivec4) IMul 54 55
57: 11(int) CompositeExtract 56 0 57: 11(int) CompositeExtract 56 0
58: 11(int) CompositeExtract 54 1 58: 11(int) CompositeExtract 56 1
59: 11(int) IAdd 57 58 59: 11(int) IAdd 57 58
60: 11(int) CompositeExtract 54 2 60: 11(int) CompositeExtract 56 2
61: 11(int) IAdd 59 60 61: 11(int) IAdd 59 60
62: 11(int) CompositeExtract 54 3 62: 11(int) CompositeExtract 56 3
63: 11(int) IAdd 61 62 63: 11(int) IAdd 61 62
64: 27(ivec4) CompositeConstruct 63 63 63 63 64: 27(ivec4) CompositeConstruct 63 63 63 63
Store 29(i5) 64 Store 29(i5) 64
......
...@@ -5178,19 +5178,25 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV ...@@ -5178,19 +5178,25 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"flat in int gl_PrimitiveID;" "flat in int gl_PrimitiveID;"
); );
if (version >= 400) { if (version >= 130) { // ARB_sample_shading
stageBuiltins[EShLangFragment].append( stageBuiltins[EShLangFragment].append(
"flat in int gl_SampleID;" "flat in int gl_SampleID;"
" in vec2 gl_SamplePosition;" " in vec2 gl_SamplePosition;"
"flat in int gl_SampleMaskIn[];"
" out int gl_SampleMask[];" " out int gl_SampleMask[];"
); );
if (spvVersion.spv == 0)
if (spvVersion.spv == 0) {
stageBuiltins[EShLangFragment].append( stageBuiltins[EShLangFragment].append(
"uniform int gl_NumSamples;" "uniform int gl_NumSamples;"
); );
}
} }
if (version >= 400)
stageBuiltins[EShLangFragment].append(
"flat in int gl_SampleMaskIn[];"
);
if (version >= 430) if (version >= 430)
stageBuiltins[EShLangFragment].append( stageBuiltins[EShLangFragment].append(
"flat in int gl_Layer;" "flat in int gl_Layer;"
...@@ -7422,18 +7428,29 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion ...@@ -7422,18 +7428,29 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_FragStencilRefARB", EbvFragStencilRef, symbolTable); BuiltInVariable("gl_FragStencilRefARB", EbvFragStencilRef, symbolTable);
} }
if ((profile != EEsProfile && version >= 400) || if ((profile != EEsProfile && version >= 130) ||
(profile == EEsProfile && version >= 310)) { (profile == EEsProfile && version >= 310)) {
BuiltInVariable("gl_SampleID", EbvSampleId, symbolTable); BuiltInVariable("gl_SampleID", EbvSampleId, symbolTable);
BuiltInVariable("gl_SamplePosition", EbvSamplePosition, symbolTable); BuiltInVariable("gl_SamplePosition", EbvSamplePosition, symbolTable);
BuiltInVariable("gl_SampleMaskIn", EbvSampleMask, symbolTable); BuiltInVariable("gl_SampleMask", EbvSampleMask, symbolTable);
BuiltInVariable("gl_SampleMask", EbvSampleMask, symbolTable);
if (profile == EEsProfile && version < 320) { if (profile != EEsProfile && version < 400) {
symbolTable.setVariableExtensions("gl_SampleID", 1, &E_GL_OES_sample_variables); BuiltInVariable("gl_NumSamples", EbvSampleMask, symbolTable);
symbolTable.setVariableExtensions("gl_SamplePosition", 1, &E_GL_OES_sample_variables);
symbolTable.setVariableExtensions("gl_SampleMaskIn", 1, &E_GL_OES_sample_variables); symbolTable.setVariableExtensions("gl_SampleMask", 1, &E_GL_ARB_sample_shading);
symbolTable.setVariableExtensions("gl_SampleMask", 1, &E_GL_OES_sample_variables); symbolTable.setVariableExtensions("gl_SampleID", 1, &E_GL_ARB_sample_shading);
symbolTable.setVariableExtensions("gl_NumSamples", 1, &E_GL_OES_sample_variables); symbolTable.setVariableExtensions("gl_SamplePosition", 1, &E_GL_ARB_sample_shading);
symbolTable.setVariableExtensions("gl_NumSamples", 1, &E_GL_ARB_sample_shading);
} else {
BuiltInVariable("gl_SampleMaskIn", EbvSampleMask, symbolTable);
if (profile == EEsProfile && version < 320) {
symbolTable.setVariableExtensions("gl_SampleID", 1, &E_GL_OES_sample_variables);
symbolTable.setVariableExtensions("gl_SamplePosition", 1, &E_GL_OES_sample_variables);
symbolTable.setVariableExtensions("gl_SampleMaskIn", 1, &E_GL_OES_sample_variables);
symbolTable.setVariableExtensions("gl_SampleMask", 1, &E_GL_OES_sample_variables);
symbolTable.setVariableExtensions("gl_NumSamples", 1, &E_GL_OES_sample_variables);
}
} }
} }
......
...@@ -6035,6 +6035,10 @@ void TParseContext::fixOffset(const TSourceLoc& loc, TSymbol& symbol) ...@@ -6035,6 +6035,10 @@ void TParseContext::fixOffset(const TSourceLoc& loc, TSymbol& symbol)
offset = qualifier.layoutOffset; offset = qualifier.layoutOffset;
else else
offset = atomicUintOffsets[qualifier.layoutBinding]; offset = atomicUintOffsets[qualifier.layoutBinding];
if (offset % 4 != 0)
error(loc, "atomic counters offset should align based on 4:", "offset", "%d", offset);
symbol.getWritableType().getQualifier().layoutOffset = offset; symbol.getWritableType().getQualifier().layoutOffset = offset;
// Check for overlap // Check for overlap
......
...@@ -1421,6 +1421,9 @@ int TScanContext::tokenizeIdentifier() ...@@ -1421,6 +1421,9 @@ int TScanContext::tokenizeIdentifier()
afterType = true; afterType = true;
if (parseContext.isEsProfile() && parseContext.version >= 310) if (parseContext.isEsProfile() && parseContext.version >= 310)
return keyword; return keyword;
if (!parseContext.isEsProfile() && (parseContext.version > 140 ||
(parseContext.version == 140 && parseContext.extensionsTurnedOn(1, &E_GL_ARB_texture_multisample))))
return keyword;
return es30ReservedFromGLSL(150); return es30ReservedFromGLSL(150);
case SAMPLER2DMSARRAY: case SAMPLER2DMSARRAY:
...@@ -1430,6 +1433,9 @@ int TScanContext::tokenizeIdentifier() ...@@ -1430,6 +1433,9 @@ int TScanContext::tokenizeIdentifier()
if ((parseContext.isEsProfile() && parseContext.version >= 320) || if ((parseContext.isEsProfile() && parseContext.version >= 320) ||
parseContext.extensionsTurnedOn(1, &E_GL_OES_texture_storage_multisample_2d_array)) parseContext.extensionsTurnedOn(1, &E_GL_OES_texture_storage_multisample_2d_array))
return keyword; return keyword;
if (!parseContext.isEsProfile() && (parseContext.version > 140 ||
(parseContext.version == 140 && parseContext.extensionsTurnedOn(1, &E_GL_ARB_texture_multisample))))
return keyword;
return es30ReservedFromGLSL(150); return es30ReservedFromGLSL(150);
case SAMPLER1D: case SAMPLER1D:
......
...@@ -172,6 +172,7 @@ void TParseVersions::initializeExtensionBehavior() ...@@ -172,6 +172,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_ARB_tessellation_shader] = EBhDisable; extensionBehavior[E_GL_ARB_tessellation_shader] = EBhDisable;
extensionBehavior[E_GL_ARB_enhanced_layouts] = EBhDisable; extensionBehavior[E_GL_ARB_enhanced_layouts] = EBhDisable;
extensionBehavior[E_GL_ARB_texture_cube_map_array] = EBhDisable; extensionBehavior[E_GL_ARB_texture_cube_map_array] = EBhDisable;
extensionBehavior[E_GL_ARB_texture_multisample] = EBhDisable;
extensionBehavior[E_GL_ARB_shader_texture_lod] = EBhDisable; extensionBehavior[E_GL_ARB_shader_texture_lod] = EBhDisable;
extensionBehavior[E_GL_ARB_explicit_attrib_location] = EBhDisable; extensionBehavior[E_GL_ARB_explicit_attrib_location] = EBhDisable;
extensionBehavior[E_GL_ARB_explicit_uniform_location] = EBhDisable; extensionBehavior[E_GL_ARB_explicit_uniform_location] = EBhDisable;
...@@ -193,6 +194,7 @@ void TParseVersions::initializeExtensionBehavior() ...@@ -193,6 +194,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_ARB_fragment_shader_interlock] = EBhDisable; extensionBehavior[E_GL_ARB_fragment_shader_interlock] = EBhDisable;
extensionBehavior[E_GL_ARB_shader_clock] = EBhDisable; extensionBehavior[E_GL_ARB_shader_clock] = EBhDisable;
extensionBehavior[E_GL_ARB_uniform_buffer_object] = EBhDisable; extensionBehavior[E_GL_ARB_uniform_buffer_object] = EBhDisable;
extensionBehavior[E_GL_ARB_sample_shading] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable;
...@@ -380,6 +382,7 @@ void TParseVersions::getPreamble(std::string& preamble) ...@@ -380,6 +382,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_ARB_tessellation_shader 1\n" "#define GL_ARB_tessellation_shader 1\n"
"#define GL_ARB_enhanced_layouts 1\n" "#define GL_ARB_enhanced_layouts 1\n"
"#define GL_ARB_texture_cube_map_array 1\n" "#define GL_ARB_texture_cube_map_array 1\n"
"#define GL_ARB_texture_multisample 1\n"
"#define GL_ARB_shader_texture_lod 1\n" "#define GL_ARB_shader_texture_lod 1\n"
"#define GL_ARB_explicit_attrib_location 1\n" "#define GL_ARB_explicit_attrib_location 1\n"
"#define GL_ARB_explicit_uniform_location 1\n" "#define GL_ARB_explicit_uniform_location 1\n"
...@@ -395,6 +398,7 @@ void TParseVersions::getPreamble(std::string& preamble) ...@@ -395,6 +398,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_ARB_sparse_texture2 1\n" "#define GL_ARB_sparse_texture2 1\n"
"#define GL_ARB_sparse_texture_clamp 1\n" "#define GL_ARB_sparse_texture_clamp 1\n"
"#define GL_ARB_shader_stencil_export 1\n" "#define GL_ARB_shader_stencil_export 1\n"
"#define GL_ARB_sample_shading 1\n"
// "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members // "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members
"#define GL_ARB_post_depth_coverage 1\n" "#define GL_ARB_post_depth_coverage 1\n"
"#define GL_ARB_fragment_shader_interlock 1\n" "#define GL_ARB_fragment_shader_interlock 1\n"
......
...@@ -124,6 +124,7 @@ const char* const E_GL_ARB_compute_shader = "GL_ARB_compute_shader ...@@ -124,6 +124,7 @@ const char* const E_GL_ARB_compute_shader = "GL_ARB_compute_shader
const char* const E_GL_ARB_tessellation_shader = "GL_ARB_tessellation_shader"; const char* const E_GL_ARB_tessellation_shader = "GL_ARB_tessellation_shader";
const char* const E_GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layouts"; const char* const E_GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layouts";
const char* const E_GL_ARB_texture_cube_map_array = "GL_ARB_texture_cube_map_array"; const char* const E_GL_ARB_texture_cube_map_array = "GL_ARB_texture_cube_map_array";
const char* const E_GL_ARB_texture_multisample = "GL_ARB_texture_multisample";
const char* const E_GL_ARB_shader_texture_lod = "GL_ARB_shader_texture_lod"; const char* const E_GL_ARB_shader_texture_lod = "GL_ARB_shader_texture_lod";
const char* const E_GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_location"; const char* const E_GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_location";
const char* const E_GL_ARB_explicit_uniform_location = "GL_ARB_explicit_uniform_location"; const char* const E_GL_ARB_explicit_uniform_location = "GL_ARB_explicit_uniform_location";
...@@ -145,6 +146,7 @@ const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewpor ...@@ -145,6 +146,7 @@ const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewpor
const char* const E_GL_ARB_fragment_shader_interlock = "GL_ARB_fragment_shader_interlock"; const char* const E_GL_ARB_fragment_shader_interlock = "GL_ARB_fragment_shader_interlock";
const char* const E_GL_ARB_shader_clock = "GL_ARB_shader_clock"; const char* const E_GL_ARB_shader_clock = "GL_ARB_shader_clock";
const char* const E_GL_ARB_uniform_buffer_object = "GL_ARB_uniform_buffer_object"; const char* const E_GL_ARB_uniform_buffer_object = "GL_ARB_uniform_buffer_object";
const char* const E_GL_ARB_sample_shading = "GL_ARB_sample_shading";
const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic"; const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic";
const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote"; const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment