Add special test for more coverage in combined image sampler.
This commit is contained in:
parent
50839910a2
commit
3c5f55cde1
@ -0,0 +1,48 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
precision highp int;
|
||||
|
||||
uniform mediump sampler2D SPIRV_Cross_CombineduTexture0uSampler0;
|
||||
uniform mediump sampler2D SPIRV_Cross_CombineduTexture1uSampler1;
|
||||
uniform mediump sampler2D SPIRV_Cross_CombineduTexture1uSampler0;
|
||||
uniform mediump sampler2D SPIRV_Cross_CombineduTexture0uSampler1;
|
||||
|
||||
layout(location = 0) in vec2 vTex;
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
vec4 sample_dual(mediump sampler2D SPIRV_Cross_Combinedtexsamp)
|
||||
{
|
||||
return texture(SPIRV_Cross_Combinedtexsamp, vTex);
|
||||
}
|
||||
|
||||
vec4 sample_duals()
|
||||
{
|
||||
vec4 a = sample_dual(SPIRV_Cross_CombineduTexture0uSampler0);
|
||||
vec4 b = sample_dual(SPIRV_Cross_CombineduTexture1uSampler1);
|
||||
return (a + b);
|
||||
}
|
||||
|
||||
vec4 sample_global_tex(mediump sampler2D SPIRV_Cross_CombineduTexture0samp, mediump sampler2D SPIRV_Cross_CombineduTexture1samp)
|
||||
{
|
||||
vec4 a = texture(SPIRV_Cross_CombineduTexture0samp, vTex);
|
||||
vec4 b = sample_dual(SPIRV_Cross_CombineduTexture1samp);
|
||||
return (a + b);
|
||||
}
|
||||
|
||||
vec4 sample_global_sampler(mediump sampler2D SPIRV_Cross_CombinedtexuSampler0, mediump sampler2D SPIRV_Cross_CombinedtexuSampler1)
|
||||
{
|
||||
vec4 a = texture(SPIRV_Cross_CombinedtexuSampler0, vTex);
|
||||
vec4 b = sample_dual(SPIRV_Cross_CombinedtexuSampler1);
|
||||
return (a + b);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 c0 = sample_duals();
|
||||
vec4 c1 = sample_global_tex(SPIRV_Cross_CombineduTexture0uSampler0, SPIRV_Cross_CombineduTexture1uSampler0);
|
||||
vec4 c2 = sample_global_tex(SPIRV_Cross_CombineduTexture0uSampler1, SPIRV_Cross_CombineduTexture1uSampler1);
|
||||
vec4 c3 = sample_global_sampler(SPIRV_Cross_CombineduTexture0uSampler0, SPIRV_Cross_CombineduTexture0uSampler1);
|
||||
vec4 c4 = sample_global_sampler(SPIRV_Cross_CombineduTexture1uSampler0, SPIRV_Cross_CombineduTexture1uSampler1);
|
||||
FragColor = ((((c0 + c1) + c2) + c3) + c4);
|
||||
}
|
||||
|
@ -0,0 +1,48 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
precision highp int;
|
||||
|
||||
layout(set = 0, binding = 2) uniform mediump texture2D uTexture0;
|
||||
layout(set = 0, binding = 3) uniform mediump texture2D uTexture1;
|
||||
layout(set = 0, binding = 0) uniform mediump sampler uSampler0;
|
||||
layout(set = 0, binding = 1) uniform mediump sampler uSampler1;
|
||||
|
||||
layout(location = 0) in vec2 vTex;
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
vec4 sample_dual(mediump sampler samp, mediump texture2D tex)
|
||||
{
|
||||
return texture(sampler2D(tex, samp), vTex);
|
||||
}
|
||||
|
||||
vec4 sample_duals()
|
||||
{
|
||||
vec4 a = sample_dual(uSampler0, uTexture0);
|
||||
vec4 b = sample_dual(uSampler1, uTexture1);
|
||||
return (a + b);
|
||||
}
|
||||
|
||||
vec4 sample_global_tex(mediump sampler samp)
|
||||
{
|
||||
vec4 a = texture(sampler2D(uTexture0, samp), vTex);
|
||||
vec4 b = sample_dual(samp, uTexture1);
|
||||
return (a + b);
|
||||
}
|
||||
|
||||
vec4 sample_global_sampler(mediump texture2D tex)
|
||||
{
|
||||
vec4 a = texture(sampler2D(tex, uSampler0), vTex);
|
||||
vec4 b = sample_dual(uSampler1, tex);
|
||||
return (a + b);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 c0 = sample_duals();
|
||||
vec4 c1 = sample_global_tex(uSampler0);
|
||||
vec4 c2 = sample_global_tex(uSampler1);
|
||||
vec4 c3 = sample_global_sampler(uTexture0);
|
||||
vec4 c4 = sample_global_sampler(uTexture1);
|
||||
FragColor = ((((c0 + c1) + c2) + c3) + c4);
|
||||
}
|
||||
|
47
shaders/vulkan/frag/combined-texture-sampler.vk.frag
Normal file
47
shaders/vulkan/frag/combined-texture-sampler.vk.frag
Normal file
@ -0,0 +1,47 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(set = 0, binding = 0) uniform mediump sampler uSampler0;
|
||||
layout(set = 0, binding = 1) uniform mediump sampler uSampler1;
|
||||
layout(set = 0, binding = 2) uniform mediump texture2D uTexture0;
|
||||
layout(set = 0, binding = 3) uniform mediump texture2D uTexture1;
|
||||
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
layout(location = 0) in vec2 vTex;
|
||||
|
||||
vec4 sample_dual(mediump sampler samp, mediump texture2D tex)
|
||||
{
|
||||
return texture(sampler2D(tex, samp), vTex);
|
||||
}
|
||||
|
||||
vec4 sample_global_tex(mediump sampler samp)
|
||||
{
|
||||
vec4 a = texture(sampler2D(uTexture0, samp), vTex);
|
||||
vec4 b = sample_dual(samp, uTexture1);
|
||||
return a + b;
|
||||
}
|
||||
|
||||
vec4 sample_global_sampler(mediump texture2D tex)
|
||||
{
|
||||
vec4 a = texture(sampler2D(tex, uSampler0), vTex);
|
||||
vec4 b = sample_dual(uSampler1, tex);
|
||||
return a + b;
|
||||
}
|
||||
|
||||
vec4 sample_duals()
|
||||
{
|
||||
vec4 a = sample_dual(uSampler0, uTexture0);
|
||||
vec4 b = sample_dual(uSampler1, uTexture1);
|
||||
return a + b;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 c0 = sample_duals();
|
||||
vec4 c1 = sample_global_tex(uSampler0);
|
||||
vec4 c2 = sample_global_tex(uSampler1);
|
||||
vec4 c3 = sample_global_sampler(uTexture0);
|
||||
vec4 c4 = sample_global_sampler(uTexture1);
|
||||
|
||||
FragColor = c0 + c1 + c2 + c3 + c4;
|
||||
}
|
Loading…
Reference in New Issue
Block a user