summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/sample-depth-separate-image-sampler.frag
blob: db1f5e983ac507fe9560fc07ed914a81019f4ad9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#version 450

layout(set = 0, binding = 0) uniform texture2D uDepth;
layout(set = 0, binding = 1) uniform texture2D uColor;
layout(set = 0, binding = 2) uniform sampler uSampler;
layout(set = 0, binding = 3) uniform samplerShadow uSamplerShadow;
layout(location = 0) out float FragColor;

float sample_depth_from_function(texture2D uT, samplerShadow uS)
{
	return texture(sampler2DShadow(uT, uS), vec3(0.5));
}

float sample_color_from_function(texture2D uT, sampler uS)
{
	return texture(sampler2D(uT, uS), vec2(0.5)).x;
}

void main()
{
	FragColor = sample_depth_from_function(uDepth, uSamplerShadow) + sample_color_from_function(uColor, uSampler);
}