2016-02-16 03:58:50 +00:00
|
|
|
#version 450
|
|
|
|
|
2018-02-22 01:19:49 +00:00
|
|
|
uniform sampler s; // ERROR, no binding
|
|
|
|
uniform sampler sA[4]; // ERROR, no binding
|
|
|
|
uniform texture2D t2d; // ERROR, no binding
|
|
|
|
uniform texture3D t3d[4]; // ERROR, no binding
|
2016-02-16 03:58:50 +00:00
|
|
|
int i;
|
|
|
|
uniform samplerShadow sShadow;
|
|
|
|
uniform texture3D t3d5[5];
|
|
|
|
writeonly uniform image2D i2d;
|
|
|
|
|
|
|
|
void badConst()
|
|
|
|
{
|
|
|
|
sampler2D(t2d); // ERROR, need 2 args
|
|
|
|
sampler2D(s, s); // ERROR, wrong type
|
|
|
|
sampler2D(i, i); // ERROR, wrong type
|
|
|
|
sampler2D(t2d, i); // ERROR, wrong type
|
|
|
|
sampler2D(t2d, t2d); // ERROR, wrong type
|
|
|
|
sampler2D(t2d, sA); // ERROR, wrong type
|
|
|
|
|
|
|
|
sampler3D[4](t3d5, sA[2]); // ERROR, can't make array
|
|
|
|
sampler2D(i2d, s); // ERROR, image instead of texture
|
|
|
|
sampler2D(t3d[1], s); // ERROR, 3D not 2D
|
2018-07-25 18:11:04 +00:00
|
|
|
sampler2D(t2d, sShadow);
|
2018-07-23 21:59:09 +00:00
|
|
|
sampler2DShadow(t2d, s);
|
2016-02-16 03:58:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sampler2D s2D = sampler2D(t2d, s); // ERROR, no sampler constructor
|
|
|
|
sampler3D s3d[4] = sampler3D[4](t3d, sA[2]); // ERROR, no sampler constructor
|
|
|
|
|
2018-02-22 01:19:49 +00:00
|
|
|
out vec4 color; // ERROR, no location
|
2016-02-16 03:58:50 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
color = texture(s2D, vec2(0.5));
|
|
|
|
color += texture(s3d[i], vec3(0.5));
|
|
|
|
}
|
|
|
|
|
|
|
|
layout(push_constant) buffer pcb { // ERROR, not on a buffer
|
|
|
|
int a;
|
|
|
|
} pcbInst;
|
|
|
|
|
|
|
|
layout(push_constant) uniform float pcfloat; // ERROR 2X: not on a non-block, and non-opaque outside block
|
|
|
|
|
|
|
|
layout(push_constant) uniform; // ERROR, needs an object
|
2021-11-10 22:03:07 +00:00
|
|
|
layout(binding=2, push_constant) uniform pcbnd1 { // ERROR, can't have binding
|
|
|
|
int a;
|
|
|
|
} pcbnd1inst;
|
2022-03-23 17:42:21 +00:00
|
|
|
layout(push_constant) uniform pcbnd2 { // ERROR, can't be array
|
|
|
|
float a;
|
|
|
|
} pcbnd2inst[2];
|
2017-07-06 00:34:15 +00:00
|
|
|
layout(std430, push_constant) uniform pcb1 { int a; } pcb1inst;
|
2016-02-16 03:58:50 +00:00
|
|
|
layout(push_constant) uniform pcb2 {
|
|
|
|
int a;
|
2017-03-06 15:51:35 +00:00
|
|
|
}; // Okay now to have no instance name
|
2016-02-16 03:58:50 +00:00
|
|
|
|
|
|
|
layout(input_attachment_index = 2) uniform subpassInput subD;
|
|
|
|
layout(input_attachment_index = 3) uniform texture2D subDbad1; // ERROR, not a texture
|
|
|
|
layout(input_attachment_index = 4) writeonly uniform image2D subDbad2; // ERROR, not an image
|
|
|
|
uniform subpassInput subDbad3; // ERROR, need attachment number
|
|
|
|
layout(input_attachment_index = 2) uniform subpassInputMS subDMS;
|
|
|
|
|
|
|
|
void foo()
|
|
|
|
{
|
|
|
|
vec4 v = subpassLoad(subD);
|
|
|
|
v += subpassLoadMS(subD); // ERROR, no such function
|
|
|
|
v += subpassLoad(subD, 2); // ERROR, no such sig.
|
|
|
|
v += subpassLoad(subDMS, 2);
|
|
|
|
v += subpassLoadMS(subDMS, 2); // ERROR, no such function
|
|
|
|
}
|
|
|
|
|
|
|
|
subroutine int fooS; // ERROR, not in SPV
|
|
|
|
subroutine int fooSub(); // ERROR, not in SPV
|
|
|
|
|
|
|
|
uniform vec4 dv4; // ERROR, no default uniforms
|
2016-05-20 22:59:27 +00:00
|
|
|
|
|
|
|
void fooTex()
|
|
|
|
{
|
|
|
|
texture(t2d, vec2(1.0)); // ERROR, need a sampler, not a pure texture
|
|
|
|
imageStore(t2d, ivec2(4, 5), vec4(1.2)); // ERROR, need an image, not a pure texture
|
2016-07-31 18:39:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
precision highp float;
|
|
|
|
|
|
|
|
layout(location=0) in vec2 vTexCoord;
|
|
|
|
layout(location=0) out vec4 FragColor;
|
|
|
|
|
|
|
|
vec4 userTexture(mediump sampler2D samp, vec2 coord)
|
|
|
|
{
|
|
|
|
return texture(samp, coord);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cond;
|
|
|
|
|
|
|
|
void callUserTexture()
|
|
|
|
{
|
|
|
|
userTexture(sampler2D(t2d,s), vTexCoord); // ERROR, not point of use
|
|
|
|
userTexture((sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use
|
|
|
|
userTexture((sampler2D(t2d,s), sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use
|
|
|
|
userTexture(cond ? sampler2D(t2d,s) : sampler2D(t2d,s), vTexCoord); // ERROR, no ?:, not point of use
|
2017-01-03 00:01:21 +00:00
|
|
|
|
|
|
|
gl_NumSamples; // ERROR, not for Vulkan
|
2016-07-31 18:39:46 +00:00
|
|
|
}
|
2017-11-03 09:39:48 +00:00
|
|
|
|
|
|
|
void noise()
|
|
|
|
{
|
|
|
|
noise1(dv4);
|
|
|
|
noise2(4.0);
|
|
|
|
noise3(vec2(3));
|
|
|
|
noise4(dv4);
|
|
|
|
}
|