Fix uniformity issue in CopyTextureForBrowserHelper
Calls to textureSample() must only happen in uniform control flow, so move them to before the conditional discard. Bug: tint:880 Change-Id: Idd6ca35a7acaa6917753da8deb6e9266284afe86 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88463 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
adc97421ae
commit
32f55426f2
|
@ -130,14 +130,15 @@ static const char sCopyTextureForBrowserShader[] = R"(
|
||||||
// Clamp the texcoord and discard the out-of-bound pixels.
|
// Clamp the texcoord and discard the out-of-bound pixels.
|
||||||
var clampedTexcoord =
|
var clampedTexcoord =
|
||||||
clamp(texcoord, vec2<f32>(0.0, 0.0), vec2<f32>(1.0, 1.0));
|
clamp(texcoord, vec2<f32>(0.0, 0.0), vec2<f32>(1.0, 1.0));
|
||||||
if (!all(clampedTexcoord == texcoord)) {
|
|
||||||
discard;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Swizzling of texture formats when sampling / rendering is handled by the
|
// Swizzling of texture formats when sampling / rendering is handled by the
|
||||||
// hardware so we don't need special logic in this shader. This is covered by tests.
|
// hardware so we don't need special logic in this shader. This is covered by tests.
|
||||||
var color = textureSample(myTexture, mySampler, texcoord);
|
var color = textureSample(myTexture, mySampler, texcoord);
|
||||||
|
|
||||||
|
if (!all(clampedTexcoord == texcoord)) {
|
||||||
|
discard;
|
||||||
|
}
|
||||||
|
|
||||||
let kUnpremultiplyStep = 0x01u;
|
let kUnpremultiplyStep = 0x01u;
|
||||||
let kDecodeToLinearStep = 0x02u;
|
let kDecodeToLinearStep = 0x02u;
|
||||||
let kConvertToDstGamutStep = 0x04u;
|
let kConvertToDstGamutStep = 0x04u;
|
||||||
|
|
Loading…
Reference in New Issue