Commit fda74a68 by Nicolas Capens Committed by Nicolas Capens

Revert sampling parameter initialization workaround

1D image sampling used to be treated as 2D image sampling with the second coordinate being ignored. But a bug was causing us to use the second component of the 'offset' parameter. This was worked around by initializing all parameters provided to the sampling routine. This costs some performance, and since we've fixed the 'offset' bug and have specialized handling of 1D images now, the workaround can be reverted. Change-Id: Id69b68465d7755df35fe12619957971681e4c0b7 Fixes: b/136149446 Bug: b/134669567 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48930 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 008247a4
...@@ -103,13 +103,13 @@ std::shared_ptr<rr::Routine> SpirvShader::emitSamplerRoutine(ImageInstruction in ...@@ -103,13 +103,13 @@ std::shared_ptr<rr::Routine> SpirvShader::emitSamplerRoutine(ImageInstruction in
Pointer<SIMD::Float> out = function.Arg<2>(); Pointer<SIMD::Float> out = function.Arg<2>();
Pointer<Byte> constants = function.Arg<3>(); Pointer<Byte> constants = function.Arg<3>();
SIMD::Float uvwa[4] = { 0, 0, 0, 0 }; SIMD::Float uvwa[4];
SIMD::Float dRef = 0; SIMD::Float dRef;
SIMD::Float lodOrBias = 0; // Explicit level-of-detail, or bias added to the implicit level-of-detail (depending on samplerMethod). SIMD::Float lodOrBias; // Explicit level-of-detail, or bias added to the implicit level-of-detail (depending on samplerMethod).
Vector4f dsx = { 0, 0, 0, 0 }; Vector4f dsx;
Vector4f dsy = { 0, 0, 0, 0 }; Vector4f dsy;
Vector4i offset = { 0, 0, 0, 0 }; Vector4i offset;
SIMD::Int sampleId = 0; SIMD::Int sampleId;
SamplerFunction samplerFunction = instruction.getSamplerFunction(); SamplerFunction samplerFunction = instruction.getSamplerFunction();
uint32_t i = 0; uint32_t i = 0;
......
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