Commit 71c012b1 by Nicolas Capens Committed by Nicolas Capens

Fix interpolating z when using FragCoord builtin

Z was only being interpolated when the Position builtin is used (which isn't valid for fragment shaders) and/or when there's a depth buffer present. Instead interpolate it when FragCoord is being used. Bug: b/133325267 Tests: dEQP-VK.draw.inverted_depth_ranges.* Change-Id: I0567084b6f7bb054bd864545fa34acc52c8ac3d6 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31848 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
parent d82354ac
......@@ -256,7 +256,7 @@ namespace sw
bool QuadRasterizer::interpolateZ() const
{
return state.depthTestActive || (spirvShader && spirvShader->hasBuiltinInput(spv::BuiltInPosition));
return state.depthTestActive || (spirvShader && spirvShader->hasBuiltinInput(spv::BuiltInFragCoord));
}
bool QuadRasterizer::interpolateW() const
......
......@@ -73,7 +73,7 @@ namespace sw
{
State state;
bool vPosZW = (context->pixelShader && context->pixelShader->hasBuiltinInput(spv::BuiltInPosition));
bool vPosZW = (context->pixelShader && context->pixelShader->hasBuiltinInput(spv::BuiltInFragCoord));
state.isDrawPoint = context->isDrawPoint();
state.isDrawLine = context->isDrawLine();
......
......@@ -1990,7 +1990,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2(VkDevice device, uint32_t bind
{
TRACE("(VkDevice device = %p, uint32_t bindInfoCount = %d, const VkBindImageMemoryInfo* pBindInfos = %p)",
device, bindInfoCount, pBindInfos);
for(uint32_t i = 0; i < bindInfoCount; i++)
{
if(pBindInfos[i].pNext)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment