Commit a070dcf0 by Nicolas Capens Committed by Nicolas Capens

Fix passing sampler offset operands unchanged

All sampler operands are passed through an array of float values. Offset operands are integers, but we were retrieving them from the SPIR-V constant object interpreted as floating-point data, and then creating Float constants from them. This may alter their bit pattern, specifically values corresponding to sNaN may become qNaN. Instead create Reactor integer constants and bitcast them to Float. Bug: b/140302841 Change-Id: I06aceb7b2a97d5f5ce9009f5ba97238602cdc126 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35910 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 dc550b2d
...@@ -5108,7 +5108,7 @@ namespace sw ...@@ -5108,7 +5108,7 @@ namespace sw
for(uint32_t j = 0; j < offsetType.sizeInComponents; j++, i++) for(uint32_t j = 0; j < offsetType.sizeInComponents; j++, i++)
{ {
in[i] = offsetValue.Float(j); // Integer values, but transfered as float. in[i] = As<SIMD::Float>(offsetValue.Int(j)); // Integer values, but transfered as float.
} }
} }
......
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