Commit 1d6301dc by Ben Clayton

SpirvShader: Fully initialize variables in emitSamplerFunction()

Let's just initialize these to zero, and let the optimizer remove redundant assignments. Bug: b/136149446 Change-Id: Ia776bae4433f78f5a66b16f275e728a70dd4e18d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/33468Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
parent 0b00b956
......@@ -125,12 +125,12 @@ SpirvShader::ImageSampler *SpirvShader::emitSamplerFunction(ImageInstruction ins
Pointer<SIMD::Float> out = function.Arg<3>();
Pointer<Byte> constants = function.Arg<4>();
SIMD::Float uvw[4];
SIMD::Float q;
SIMD::Float lodOrBias; // Explicit level-of-detail, or bias added to the implicit level-of-detail (depending on samplerMethod).
Vector4f dsx;
Vector4f dsy;
Vector4f offset;
SIMD::Float uvw[4] = {0, 0, 0, 0};
SIMD::Float q = 0;
SIMD::Float lodOrBias = 0; // Explicit level-of-detail, or bias added to the implicit level-of-detail (depending on samplerMethod).
Vector4f dsx = {0, 0, 0, 0};
Vector4f dsy = {0, 0, 0, 0};
Vector4f offset = {0, 0, 0, 0};
SamplerFunction samplerFunction = instruction.getSamplerFunction();
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