diff --git a/Test/baseResults/sparsetextureoffset_non_const.vert.out b/Test/baseResults/sparsetextureoffset_non_const.vert.out new file mode 100644 index 0000000000..9ccbcd6440 --- /dev/null +++ b/Test/baseResults/sparsetextureoffset_non_const.vert.out @@ -0,0 +1,251 @@ +sparsetextureoffset_non_const.vert +Shader version: 450 +Requested GL_ARB_sparse_texture2 +Requested GL_EXT_texture_offset_non_const +0:? Sequence +0:19 Function Definition: main( ( global void) +0:19 Function Parameters: +0:21 Sequence +0:21 move second child to first child ( temp 4-component vector of float) +0:21 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:21 'anon@2' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:21 Constant: +0:21 0 (const uint) +0:21 'a_position' (layout( location=0) in 4-component vector of float) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'ret0' ( temp int) +0:27 sparseTextureOffset ( global int) +0:27 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:27 'a_in0' (layout( location=4) in 2-component vector of float) +0:27 'offsetValue' (layout( location=10) in 2-component vector of int) +0:27 'aux0' ( temp 4-component vector of float) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'ret1' ( temp int) +0:28 sparseTexelFetchOffset ( global int) +0:28 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:28 Convert float to int ( temp 2-component vector of int) +0:28 'a_in0' (layout( location=4) in 2-component vector of float) +0:28 Convert float to int ( temp int) +0:28 'a_in1' (layout( location=5) in float) +0:28 'offsetValue' (layout( location=10) in 2-component vector of int) +0:28 'aux1' ( temp 4-component vector of float) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'ret2' ( temp int) +0:29 sparseTextureLodOffset ( global int) +0:29 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:29 'a_in0' (layout( location=4) in 2-component vector of float) +0:29 'a_in1' (layout( location=5) in float) +0:29 'offsetValue' (layout( location=10) in 2-component vector of int) +0:29 'aux2' ( temp 4-component vector of float) +0:30 Sequence +0:30 move second child to first child ( temp int) +0:30 'ret3' ( temp int) +0:30 sparseTextureGradOffset ( global int) +0:30 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:30 'a_in0' (layout( location=4) in 2-component vector of float) +0:30 Construct vec2 ( temp 2-component vector of float) +0:30 'a_in1' (layout( location=5) in float) +0:30 'a_in1' (layout( location=5) in float) +0:30 Construct vec2 ( temp 2-component vector of float) +0:30 'a_in1' (layout( location=5) in float) +0:30 'a_in1' (layout( location=5) in float) +0:30 'offsetValue' (layout( location=10) in 2-component vector of int) +0:30 'aux3' ( temp 4-component vector of float) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'v_color0' (layout( location=0) smooth out 4-component vector of float) +0:32 add ( temp 4-component vector of float) +0:32 component-wise multiply ( temp 4-component vector of float) +0:32 'aux0' ( temp 4-component vector of float) +0:32 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:32 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:32 Constant: +0:32 0 (const uint) +0:32 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:32 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:32 Constant: +0:32 0 (const uint) +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'v_color1' (layout( location=1) smooth out 4-component vector of float) +0:33 add ( temp 4-component vector of float) +0:33 component-wise multiply ( temp 4-component vector of float) +0:33 'aux1' ( temp 4-component vector of float) +0:33 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:33 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:33 Constant: +0:33 0 (const uint) +0:33 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:33 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:33 Constant: +0:33 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'v_color2' (layout( location=2) smooth out 4-component vector of float) +0:34 add ( temp 4-component vector of float) +0:34 component-wise multiply ( temp 4-component vector of float) +0:34 'aux2' ( temp 4-component vector of float) +0:34 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:34 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:34 Constant: +0:34 0 (const uint) +0:34 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:34 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:34 Constant: +0:34 0 (const uint) +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'v_color3' (layout( location=3) smooth out 4-component vector of float) +0:35 add ( temp 4-component vector of float) +0:35 component-wise multiply ( temp 4-component vector of float) +0:35 'aux3' ( temp 4-component vector of float) +0:35 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:35 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:35 Constant: +0:35 0 (const uint) +0:35 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:35 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:35 Constant: +0:35 0 (const uint) +0:? Linker Objects +0:? 'a_position' (layout( location=0) in 4-component vector of float) +0:? 'a_in0' (layout( location=4) in 2-component vector of float) +0:? 'a_in1' (layout( location=5) in float) +0:? 'offsetValue' (layout( location=10) in 2-component vector of int) +0:? 'v_color0' (layout( location=0) smooth out 4-component vector of float) +0:? 'v_color1' (layout( location=1) smooth out 4-component vector of float) +0:? 'v_color2' (layout( location=2) smooth out 4-component vector of float) +0:? 'v_color3' (layout( location=3) smooth out 4-component vector of float) +0:? 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:? 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:? 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:? 'anon@2' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 450 +Requested GL_ARB_sparse_texture2 +Requested GL_EXT_texture_offset_non_const +0:? Sequence +0:19 Function Definition: main( ( global void) +0:19 Function Parameters: +0:21 Sequence +0:21 move second child to first child ( temp 4-component vector of float) +0:21 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:21 'anon@2' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:21 Constant: +0:21 0 (const uint) +0:21 'a_position' (layout( location=0) in 4-component vector of float) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'ret0' ( temp int) +0:27 sparseTextureOffset ( global int) +0:27 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:27 'a_in0' (layout( location=4) in 2-component vector of float) +0:27 'offsetValue' (layout( location=10) in 2-component vector of int) +0:27 'aux0' ( temp 4-component vector of float) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'ret1' ( temp int) +0:28 sparseTexelFetchOffset ( global int) +0:28 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:28 Convert float to int ( temp 2-component vector of int) +0:28 'a_in0' (layout( location=4) in 2-component vector of float) +0:28 Convert float to int ( temp int) +0:28 'a_in1' (layout( location=5) in float) +0:28 'offsetValue' (layout( location=10) in 2-component vector of int) +0:28 'aux1' ( temp 4-component vector of float) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'ret2' ( temp int) +0:29 sparseTextureLodOffset ( global int) +0:29 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:29 'a_in0' (layout( location=4) in 2-component vector of float) +0:29 'a_in1' (layout( location=5) in float) +0:29 'offsetValue' (layout( location=10) in 2-component vector of int) +0:29 'aux2' ( temp 4-component vector of float) +0:30 Sequence +0:30 move second child to first child ( temp int) +0:30 'ret3' ( temp int) +0:30 sparseTextureGradOffset ( global int) +0:30 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:30 'a_in0' (layout( location=4) in 2-component vector of float) +0:30 Construct vec2 ( temp 2-component vector of float) +0:30 'a_in1' (layout( location=5) in float) +0:30 'a_in1' (layout( location=5) in float) +0:30 Construct vec2 ( temp 2-component vector of float) +0:30 'a_in1' (layout( location=5) in float) +0:30 'a_in1' (layout( location=5) in float) +0:30 'offsetValue' (layout( location=10) in 2-component vector of int) +0:30 'aux3' ( temp 4-component vector of float) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'v_color0' (layout( location=0) smooth out 4-component vector of float) +0:32 add ( temp 4-component vector of float) +0:32 component-wise multiply ( temp 4-component vector of float) +0:32 'aux0' ( temp 4-component vector of float) +0:32 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:32 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:32 Constant: +0:32 0 (const uint) +0:32 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:32 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:32 Constant: +0:32 0 (const uint) +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'v_color1' (layout( location=1) smooth out 4-component vector of float) +0:33 add ( temp 4-component vector of float) +0:33 component-wise multiply ( temp 4-component vector of float) +0:33 'aux1' ( temp 4-component vector of float) +0:33 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:33 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:33 Constant: +0:33 0 (const uint) +0:33 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:33 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:33 Constant: +0:33 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'v_color2' (layout( location=2) smooth out 4-component vector of float) +0:34 add ( temp 4-component vector of float) +0:34 component-wise multiply ( temp 4-component vector of float) +0:34 'aux2' ( temp 4-component vector of float) +0:34 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:34 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:34 Constant: +0:34 0 (const uint) +0:34 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:34 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:34 Constant: +0:34 0 (const uint) +0:35 move second child to first child ( temp 4-component vector of float) +0:35 'v_color3' (layout( location=3) smooth out 4-component vector of float) +0:35 add ( temp 4-component vector of float) +0:35 component-wise multiply ( temp 4-component vector of float) +0:35 'aux3' ( temp 4-component vector of float) +0:35 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:35 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:35 Constant: +0:35 0 (const uint) +0:35 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:35 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:35 Constant: +0:35 0 (const uint) +0:? Linker Objects +0:? 'a_position' (layout( location=0) in 4-component vector of float) +0:? 'a_in0' (layout( location=4) in 2-component vector of float) +0:? 'a_in1' (layout( location=5) in float) +0:? 'offsetValue' (layout( location=10) in 2-component vector of int) +0:? 'v_color0' (layout( location=0) smooth out 4-component vector of float) +0:? 'v_color1' (layout( location=1) smooth out 4-component vector of float) +0:? 'v_color2' (layout( location=2) smooth out 4-component vector of float) +0:? 'v_color3' (layout( location=3) smooth out 4-component vector of float) +0:? 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:? 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:? 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:? 'anon@2' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/Test/baseResults/sparsetextureoffset_non_const_fail.vert.out b/Test/baseResults/sparsetextureoffset_non_const_fail.vert.out new file mode 100644 index 0000000000..d25040c94f --- /dev/null +++ b/Test/baseResults/sparsetextureoffset_non_const_fail.vert.out @@ -0,0 +1,256 @@ +sparsetextureoffset_non_const_fail.vert +ERROR: 0:26: 'texel offset' : argument must be compile-time constant +ERROR: 0:27: 'texel offset' : argument must be compile-time constant +ERROR: 0:28: 'texel offset' : argument must be compile-time constant +ERROR: 0:29: 'texel offset' : argument must be compile-time constant +ERROR: 4 compilation errors. No code generated. + + +Shader version: 450 +Requested GL_ARB_sparse_texture2 +ERROR: node is still EOpNull! +0:18 Function Definition: main( ( global void) +0:18 Function Parameters: +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:20 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:20 'anon@2' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:20 Constant: +0:20 0 (const uint) +0:20 'a_position' (layout( location=0) in 4-component vector of float) +0:26 Sequence +0:26 move second child to first child ( temp int) +0:26 'ret0' ( temp int) +0:26 sparseTextureOffset ( global int) +0:26 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:26 'a_in0' (layout( location=4) in 2-component vector of float) +0:26 'offsetValue' (layout( location=10) in 2-component vector of int) +0:26 'aux0' ( temp 4-component vector of float) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'ret1' ( temp int) +0:27 sparseTexelFetchOffset ( global int) +0:27 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:27 Convert float to int ( temp 2-component vector of int) +0:27 'a_in0' (layout( location=4) in 2-component vector of float) +0:27 Convert float to int ( temp int) +0:27 'a_in1' (layout( location=5) in float) +0:27 'offsetValue' (layout( location=10) in 2-component vector of int) +0:27 'aux1' ( temp 4-component vector of float) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'ret2' ( temp int) +0:28 sparseTextureLodOffset ( global int) +0:28 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:28 'a_in0' (layout( location=4) in 2-component vector of float) +0:28 'a_in1' (layout( location=5) in float) +0:28 'offsetValue' (layout( location=10) in 2-component vector of int) +0:28 'aux2' ( temp 4-component vector of float) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'ret3' ( temp int) +0:29 sparseTextureGradOffset ( global int) +0:29 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:29 'a_in0' (layout( location=4) in 2-component vector of float) +0:29 Construct vec2 ( temp 2-component vector of float) +0:29 'a_in1' (layout( location=5) in float) +0:29 'a_in1' (layout( location=5) in float) +0:29 Construct vec2 ( temp 2-component vector of float) +0:29 'a_in1' (layout( location=5) in float) +0:29 'a_in1' (layout( location=5) in float) +0:29 'offsetValue' (layout( location=10) in 2-component vector of int) +0:29 'aux3' ( temp 4-component vector of float) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'v_color0' (layout( location=0) smooth out 4-component vector of float) +0:31 add ( temp 4-component vector of float) +0:31 component-wise multiply ( temp 4-component vector of float) +0:31 'aux0' ( temp 4-component vector of float) +0:31 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:31 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:31 Constant: +0:31 0 (const uint) +0:31 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:31 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:31 Constant: +0:31 0 (const uint) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'v_color1' (layout( location=1) smooth out 4-component vector of float) +0:32 add ( temp 4-component vector of float) +0:32 component-wise multiply ( temp 4-component vector of float) +0:32 'aux1' ( temp 4-component vector of float) +0:32 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:32 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:32 Constant: +0:32 0 (const uint) +0:32 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:32 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:32 Constant: +0:32 0 (const uint) +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'v_color2' (layout( location=2) smooth out 4-component vector of float) +0:33 add ( temp 4-component vector of float) +0:33 component-wise multiply ( temp 4-component vector of float) +0:33 'aux2' ( temp 4-component vector of float) +0:33 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:33 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:33 Constant: +0:33 0 (const uint) +0:33 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:33 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:33 Constant: +0:33 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'v_color3' (layout( location=3) smooth out 4-component vector of float) +0:34 add ( temp 4-component vector of float) +0:34 component-wise multiply ( temp 4-component vector of float) +0:34 'aux3' ( temp 4-component vector of float) +0:34 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:34 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:34 Constant: +0:34 0 (const uint) +0:34 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:34 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:34 Constant: +0:34 0 (const uint) +0:? Linker Objects +0:? 'a_position' (layout( location=0) in 4-component vector of float) +0:? 'a_in0' (layout( location=4) in 2-component vector of float) +0:? 'a_in1' (layout( location=5) in float) +0:? 'offsetValue' (layout( location=10) in 2-component vector of int) +0:? 'v_color0' (layout( location=0) smooth out 4-component vector of float) +0:? 'v_color1' (layout( location=1) smooth out 4-component vector of float) +0:? 'v_color2' (layout( location=2) smooth out 4-component vector of float) +0:? 'v_color3' (layout( location=3) smooth out 4-component vector of float) +0:? 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:? 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:? 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:? 'anon@2' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 450 +Requested GL_ARB_sparse_texture2 +ERROR: node is still EOpNull! +0:18 Function Definition: main( ( global void) +0:18 Function Parameters: +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:20 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:20 'anon@2' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:20 Constant: +0:20 0 (const uint) +0:20 'a_position' (layout( location=0) in 4-component vector of float) +0:26 Sequence +0:26 move second child to first child ( temp int) +0:26 'ret0' ( temp int) +0:26 sparseTextureOffset ( global int) +0:26 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:26 'a_in0' (layout( location=4) in 2-component vector of float) +0:26 'offsetValue' (layout( location=10) in 2-component vector of int) +0:26 'aux0' ( temp 4-component vector of float) +0:27 Sequence +0:27 move second child to first child ( temp int) +0:27 'ret1' ( temp int) +0:27 sparseTexelFetchOffset ( global int) +0:27 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:27 Convert float to int ( temp 2-component vector of int) +0:27 'a_in0' (layout( location=4) in 2-component vector of float) +0:27 Convert float to int ( temp int) +0:27 'a_in1' (layout( location=5) in float) +0:27 'offsetValue' (layout( location=10) in 2-component vector of int) +0:27 'aux1' ( temp 4-component vector of float) +0:28 Sequence +0:28 move second child to first child ( temp int) +0:28 'ret2' ( temp int) +0:28 sparseTextureLodOffset ( global int) +0:28 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:28 'a_in0' (layout( location=4) in 2-component vector of float) +0:28 'a_in1' (layout( location=5) in float) +0:28 'offsetValue' (layout( location=10) in 2-component vector of int) +0:28 'aux2' ( temp 4-component vector of float) +0:29 Sequence +0:29 move second child to first child ( temp int) +0:29 'ret3' ( temp int) +0:29 sparseTextureGradOffset ( global int) +0:29 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:29 'a_in0' (layout( location=4) in 2-component vector of float) +0:29 Construct vec2 ( temp 2-component vector of float) +0:29 'a_in1' (layout( location=5) in float) +0:29 'a_in1' (layout( location=5) in float) +0:29 Construct vec2 ( temp 2-component vector of float) +0:29 'a_in1' (layout( location=5) in float) +0:29 'a_in1' (layout( location=5) in float) +0:29 'offsetValue' (layout( location=10) in 2-component vector of int) +0:29 'aux3' ( temp 4-component vector of float) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 'v_color0' (layout( location=0) smooth out 4-component vector of float) +0:31 add ( temp 4-component vector of float) +0:31 component-wise multiply ( temp 4-component vector of float) +0:31 'aux0' ( temp 4-component vector of float) +0:31 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:31 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:31 Constant: +0:31 0 (const uint) +0:31 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:31 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:31 Constant: +0:31 0 (const uint) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 'v_color1' (layout( location=1) smooth out 4-component vector of float) +0:32 add ( temp 4-component vector of float) +0:32 component-wise multiply ( temp 4-component vector of float) +0:32 'aux1' ( temp 4-component vector of float) +0:32 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:32 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:32 Constant: +0:32 0 (const uint) +0:32 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:32 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:32 Constant: +0:32 0 (const uint) +0:33 move second child to first child ( temp 4-component vector of float) +0:33 'v_color2' (layout( location=2) smooth out 4-component vector of float) +0:33 add ( temp 4-component vector of float) +0:33 component-wise multiply ( temp 4-component vector of float) +0:33 'aux2' ( temp 4-component vector of float) +0:33 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:33 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:33 Constant: +0:33 0 (const uint) +0:33 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:33 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:33 Constant: +0:33 0 (const uint) +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'v_color3' (layout( location=3) smooth out 4-component vector of float) +0:34 add ( temp 4-component vector of float) +0:34 component-wise multiply ( temp 4-component vector of float) +0:34 'aux3' ( temp 4-component vector of float) +0:34 u_scale: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:34 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:34 Constant: +0:34 0 (const uint) +0:34 u_bias: direct index for structure (layout( column_major shared) uniform 4-component vector of float) +0:34 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:34 Constant: +0:34 0 (const uint) +0:? Linker Objects +0:? 'a_position' (layout( location=0) in 4-component vector of float) +0:? 'a_in0' (layout( location=4) in 2-component vector of float) +0:? 'a_in1' (layout( location=5) in float) +0:? 'offsetValue' (layout( location=10) in 2-component vector of int) +0:? 'v_color0' (layout( location=0) smooth out 4-component vector of float) +0:? 'v_color1' (layout( location=1) smooth out 4-component vector of float) +0:? 'v_color2' (layout( location=2) smooth out 4-component vector of float) +0:? 'v_color3' (layout( location=3) smooth out 4-component vector of float) +0:? 'u_sampler' (layout( set=0 binding=0) uniform sampler2D) +0:? 'anon@0' (layout( set=0 binding=1 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_scale}) +0:? 'anon@1' (layout( set=0 binding=2 column_major shared) uniform block{layout( column_major shared) uniform 4-component vector of float u_bias}) +0:? 'anon@2' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/Test/sparsetextureoffset_non_const.vert b/Test/sparsetextureoffset_non_const.vert new file mode 100644 index 0000000000..699d2b8190 --- /dev/null +++ b/Test/sparsetextureoffset_non_const.vert @@ -0,0 +1,36 @@ +#version 450 core +#extension GL_ARB_sparse_texture2 : enable +#extension GL_EXT_texture_offset_non_const : enable +layout(location = 0) in highp vec4 a_position; +layout(location = 4) in highp vec2 a_in0; +layout(location = 5) in highp float a_in1; +layout(location = 10) in highp ivec2 offsetValue; +layout(location = 0) out mediump vec4 v_color0; +layout(location = 1) out mediump vec4 v_color1; +layout(location = 2) out mediump vec4 v_color2; +layout(location = 3) out mediump vec4 v_color3; +layout(set = 0, binding = 0) uniform highp sampler2D u_sampler; +layout(set = 0, binding = 1) uniform buf0 { highp vec4 u_scale; }; +layout(set = 0, binding = 2) uniform buf1 { highp vec4 u_bias; }; +out gl_PerVertex { + vec4 gl_Position; +}; + +void main() +{ + gl_Position = a_position; + vec4 aux0; + vec4 aux1; + vec4 aux2; + vec4 aux3; + + int ret0 = sparseTextureOffsetARB(u_sampler, a_in0, offsetValue, aux0); + int ret1 = sparseTexelFetchOffsetARB(u_sampler, ivec2(a_in0), int(a_in1), offsetValue, aux1); + int ret2 = sparseTextureLodOffsetARB(u_sampler, a_in0, a_in1, offsetValue, aux2); + int ret3 = sparseTextureGradOffsetARB(u_sampler, a_in0, vec2(a_in1, a_in1), vec2(a_in1, a_in1), offsetValue, aux3); + + v_color0 = aux0 * u_scale + u_bias; + v_color1 = aux1 * u_scale + u_bias; + v_color2 = aux2 * u_scale + u_bias; + v_color3 = aux3 * u_scale + u_bias; +} diff --git a/Test/sparsetextureoffset_non_const_fail.vert b/Test/sparsetextureoffset_non_const_fail.vert new file mode 100644 index 0000000000..706f1fffe1 --- /dev/null +++ b/Test/sparsetextureoffset_non_const_fail.vert @@ -0,0 +1,35 @@ +#version 450 core +#extension GL_ARB_sparse_texture2 : enable +layout(location = 0) in highp vec4 a_position; +layout(location = 4) in highp vec2 a_in0; +layout(location = 5) in highp float a_in1; +layout(location = 10) in highp ivec2 offsetValue; +layout(location = 0) out mediump vec4 v_color0; +layout(location = 1) out mediump vec4 v_color1; +layout(location = 2) out mediump vec4 v_color2; +layout(location = 3) out mediump vec4 v_color3; +layout(set = 0, binding = 0) uniform highp sampler2D u_sampler; +layout(set = 0, binding = 1) uniform buf0 { highp vec4 u_scale; }; +layout(set = 0, binding = 2) uniform buf1 { highp vec4 u_bias; }; +out gl_PerVertex { + vec4 gl_Position; +}; + +void main() +{ + gl_Position = a_position; + vec4 aux0; + vec4 aux1; + vec4 aux2; + vec4 aux3; + + int ret0 = sparseTextureOffsetARB(u_sampler, a_in0, offsetValue, aux0); + int ret1 = sparseTexelFetchOffsetARB(u_sampler, ivec2(a_in0), int(a_in1), offsetValue, aux1); + int ret2 = sparseTextureLodOffsetARB(u_sampler, a_in0, a_in1, offsetValue, aux2); + int ret3 = sparseTextureGradOffsetARB(u_sampler, a_in0, vec2(a_in1, a_in1), vec2(a_in1, a_in1), offsetValue, aux3); + + v_color0 = aux0 * u_scale + u_bias; + v_color1 = aux1 * u_scale + u_bias; + v_color2 = aux2 * u_scale + u_bias; + v_color3 = aux3 * u_scale + u_bias; +} diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index a92d1634d2..62b9ee161e 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -2310,18 +2310,26 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan case EOpTextureProjLodOffset: case EOpTextureGradOffset: case EOpTextureProjGradOffset: + case EOpSparseTextureOffset: + case EOpSparseTextureFetchOffset: + case EOpSparseTextureLodOffset: + case EOpSparseTextureGradOffset: { // Handle texture-offset limits checking // Pick which argument has to hold constant offsets int arg = -1; switch (callNode.getOp()) { - case EOpTextureOffset: arg = 2; break; - case EOpTextureFetchOffset: arg = (arg0->getType().getSampler().isRect()) ? 2 : 3; break; - case EOpTextureProjOffset: arg = 2; break; - case EOpTextureLodOffset: arg = 3; break; - case EOpTextureProjLodOffset: arg = 3; break; - case EOpTextureGradOffset: arg = 4; break; - case EOpTextureProjGradOffset: arg = 4; break; + case EOpSparseTextureOffset: // fallthrough + case EOpTextureOffset: arg = 2; break; + case EOpSparseTextureFetchOffset: // fallthrough + case EOpTextureFetchOffset: arg = (arg0->getType().getSampler().isRect()) ? 2 : 3; break; + case EOpTextureProjOffset: arg = 2; break; + case EOpSparseTextureLodOffset: // fallthrough + case EOpTextureLodOffset: arg = 3; break; + case EOpTextureProjLodOffset: arg = 3; break; + case EOpSparseTextureGradOffset: // fallthrough + case EOpTextureGradOffset: arg = 4; break; + case EOpTextureProjGradOffset: arg = 4; break; default: assert(0); break; @@ -2347,6 +2355,8 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } } + // This check does not apply to sparse because + // GL_ARB_sparse_texture2 always includes this function. if (callNode.getOp() == EOpTextureOffset) { TSampler s = arg0->getType().getSampler(); if (s.is2D() && s.isArrayed() && s.isShadow()) { @@ -2367,6 +2377,9 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } } + // This check does not apply to sparse because + // GL_ARB_sparse_texture2 does not define sparseTextureLodOffsetARB + // with a sampler2DArrayShadow. if (callNode.getOp() == EOpTextureLodOffset) { TSampler s = arg0->getType().getSampler(); if (s.is2D() && s.isArrayed() && s.isShadow() && diff --git a/gtests/AST.FromFile.cpp b/gtests/AST.FromFile.cpp index e3259a10b9..5880d9089d 100644 --- a/gtests/AST.FromFile.cpp +++ b/gtests/AST.FromFile.cpp @@ -318,6 +318,8 @@ INSTANTIATE_TEST_SUITE_P( "ps_sample.frag", "tes_patch.tese", "textureoffset_non_const.vert", + "sparsetextureoffset_non_const.vert", + "sparsetextureoffset_non_const_fail.vert", })), FileNameAsCustomTestSuffix );