vulkan: samplecmplevelzero in GS was rejected by driver, hotfix

This commit is contained in:
turanszkij
2018-04-23 14:23:53 +01:00
parent ca0d6ec9e1
commit 5f97d36793
+5 -2
View File
@@ -99,12 +99,15 @@ void main(point InVert p[1], inout TriangleStream<VertextoPixel> triStream)
for (float x = -range.x; x <= range.x; x += step.x)
{
samples += 1.0f;
#ifndef SHADERCOMPILER_SPIRV
// SampleCmpLevelZero also makes a comparison by using a comparison sampler
// It compares the reference depth value to the depthmap value.
// Returns 0.0 if all samples in a bilinear kernel are greater than reference value
// Returns 1.0 if all samples in a bilinear kernel are less or equal than refernce value
// Can return in between values based on bilinear filtering
accdepth += texture_depth.SampleCmpLevelZero(samplercmp, xSunPos.xy + float2(x, y), referenceDepth).r;
#else
// But samplecmplevelzero seems to not work in GS with my vulkan driver?
accdepth += texture_depth.SampleLevel(sampler_point_clamp, xSunPos.xy + float2(x, y), 0).r >= referenceDepth ? 1 : 0;
#endif
}
}
accdepth /= samples;