Commit 2f3d8f52 by Nicolas Capens Committed by Nicolas Capens

Fix OpImageSampleProjDref

Divide Dref by the projection coordinate. The SPIR-V spec states that "Dref /q is the depth-comparison reference value." Bug b/129523279 Tests: dEQP-VK.glsl.texture_functions.textureproj.* Change-Id: Ib1c4ad09f829b84b6b1065ff604fe88f8b1c1426 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31693 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent b188cf9e
......@@ -4768,7 +4768,16 @@ namespace sw
if(instruction.isDref())
{
auto drefValue = GenericValue(this, state->routine, insn.word(5));
in[i] = drefValue.Float(0);
if(instruction.isProj())
{
in[i] = drefValue.Float(0) / coordinate.Float(coordinates); // TODO(b/129523279): Optimize using reciprocal.
}
else
{
in[i] = drefValue.Float(0);
}
i++;
}
......
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