Skip to content

Commit b11bbf4

Browse files
amaioranomibrunin
authored andcommitted
[Backport] Security bug 378541479
Cherry-pick of patch originally reviewed on https://dawn-review.googlesource.com/c/dawn/+/214514: IR: Fix robustness transform on textureLoad of sampled and depth textures For sampled and depth textures, which contain a 'level' argument, the robustness transform is supposed to clamp 'coords' using the dimensions at the clamped level, but it was looking up dimensions at level 0 instead. Bug: 42250751 Bug: 42251045 Bug: 378541479 Change-Id: I0e7fd6148417b248a9b584ae19818e9027306b63 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/214514 Reviewed-by: James Price <jrprice@google.com> Commit-Queue: dan sinclair <dsinclair@chromium.org> Commit-Queue: James Price <jrprice@google.com> Auto-Submit: Antonio Maiorano <amaiorano@google.com> Reviewed-by: dan sinclair <dsinclair@chromium.org> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/215154 Commit-Queue: David Neto <dneto@google.com> Reviewed-by: David Neto <dneto@google.com> Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/611745 Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
1 parent f9d5f1d commit b11bbf4

File tree

1 file changed

+1
-1
lines changed
  • chromium/third_party/dawn/src/tint/lang/core/ir/transform

1 file changed

+1
-1
lines changed

chromium/third_party/dawn/src/tint/lang/core/ir/transform/robustness.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,14 @@ struct State {
309309
break;
310310
}
311311
case core::BuiltinFn::kTextureLoad: {
312-
clamp_coords(1u);
313312
uint32_t next_arg = 2u;
314313
if (type::IsTextureArray(texture->Dim())) {
315314
clamp_array_index(next_arg++);
316315
}
317316
if (texture->IsAnyOf<type::SampledTexture, type::DepthTexture>()) {
318317
clamp_level(next_arg++);
319318
}
319+
clamp_coords(1u); // Must run after clamp_level
320320
break;
321321
}
322322
case core::BuiltinFn::kTextureStore: {

0 commit comments

Comments
 (0)