yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
610fd6ed
main
1#version 450 2 3uniform sampler s ;// ERROR, no binding 4uniform sampler sA [4 ];// ERROR, no binding 5uniform texture2D t2d ;// ERROR, no binding 6uniform texture3D t3d [4 ];// ERROR, no binding 7int i ; 8uniform samplerShadow sShadow ; 9uniform texture3D t3d5 [5 ]; 10writeonly uniform image2D i2d ; 11 12void badConst () 13{ 14sampler2D (t2d );// ERROR, need 2 args 15sampler2D (s ,s );// ERROR, wrong type 16sampler2D (i ,i );// ERROR, wrong type 17sampler2D (t2d ,i );// ERROR, wrong type 18sampler2D (t2d ,t2d );// ERROR, wrong type 19sampler2D (t2d ,sA );// ERROR, wrong type 20 21sampler3D [4 ](t3d5 ,sA [2 ]);// ERROR, can't make array 22sampler2D (i2d ,s );// ERROR, image instead of texture 23sampler2D (t3d [1 ],s );// ERROR, 3D not 2D 24sampler2D (t2d ,sShadow ); 25sampler2DShadow (t2d ,s ); 26} 27 28sampler2D s2D = sampler2D (t2d ,s );// ERROR, no sampler constructor 29sampler3D s3d [4 ]= sampler3D [4 ](t3d ,sA [2 ]);// ERROR, no sampler constructor 30 31out vec4 color ;// ERROR, no location 32 33void main () 34{ 35color = texture (s2D ,vec2 (0.5 )); 36color += texture (s3d [i ],vec3 (0.5 )); 37} 38 39layout (push_constant )buffer pcb {// ERROR, not on a buffer 40int a ; 41}pcbInst ; 42 43layout (push_constant )uniform float pcfloat ;// ERROR 2X: not on a non-block, and non-opaque outside block 44 45layout (push_constant )uniform ;// ERROR, needs an object 46layout (binding = 2 ,push_constant )uniform pcbnd1 {// ERROR, can't have binding 47int a ; 48}pcbnd1inst ; 49layout (push_constant )uniform pcbnd2 {// ERROR, can't be array 50float a ; 51}pcbnd2inst [2 ]; 52layout (std430 ,push_constant )uniform pcb1 {int a ; }pcb1inst ; 53layout (push_constant )uniform pcb2 { 54int a ; 55};// Okay now to have no instance name 56 57layout (input_attachment_index = 2 )uniform subpassInput subD ; 58layout (input_attachment_index = 3 )uniform texture2D subDbad1 ;// ERROR, not a texture 59layout (input_attachment_index = 4 )writeonly uniform image2D subDbad2 ;// ERROR, not an image 60uniform subpassInput subDbad3 ;// ERROR, need attachment number 61layout (input_attachment_index = 2 )uniform subpassInputMS subDMS ; 62 63void foo () 64{ 65vec4 v = subpassLoad (subD ); 66v += subpassLoadMS (subD );// ERROR, no such function 67v += subpassLoad (subD ,2 );// ERROR, no such sig. 68v += subpassLoad (subDMS ,2 ); 69v += subpassLoadMS (subDMS ,2 );// ERROR, no such function 70} 71 72subroutine int fooS ;// ERROR, not in SPV 73subroutine int fooSub ();// ERROR, not in SPV 74 75uniform vec4 dv4 ;// ERROR, no default uniforms 76 77void fooTex () 78{ 79texture (t2d ,vec2 (1.0 ));// ERROR, need a sampler, not a pure texture 80imageStore (t2d ,ivec2 (4 ,5 ),vec4 (1.2 ));// ERROR, need an image, not a pure texture 81} 82 83precision highp float ; 84 85layout (location = 0 ) in vec2 vTexCoord; 86layout (location = 0 ) out vec4 FragColor; 87 88vec4 userTexture( mediump sampler2D samp, vec2 coord) 89{ 90return texture(samp, coord); 91} 92 93bool cond; 94 95void callUserTexture() 96{ 97userTexture(sampler2D(t2d,s), vTexCoord); // ERROR, not point of use 98userTexture((sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use 99userTexture((sampler2D(t2d,s), sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use 100userTexture(cond ? sampler2D(t2d,s) : sampler2D(t2d,s), vTexCoord); // ERROR, no ?:, not point of use 101 102gl_NumSamples; // ERROR, not for Vulkan 103} 104 105void noise() 106{ 107noise1(dv4); 108noise2( 4.0 ); 109noise3(vec2( 3 )); 110noise4(dv4 ); 111}