Clamp the stencil reference to 255

Fixed: dawn:1645
Change-Id: I908fe0a2cb029c7cc6cf94b066f0f842e0f1e224
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117532
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Austin Eng
2023-01-25 20:57:49 +00:00
committed by Dawn LUCI CQ
parent 1696edfbbf
commit 97f56bd0b8
2 changed files with 1 additions and 17 deletions

View File

@@ -180,7 +180,7 @@ void RenderPassEncoder::APISetStencilReference(uint32_t reference) {
[&](CommandAllocator* allocator) -> MaybeError {
SetStencilReferenceCmd* cmd =
allocator->Allocate<SetStencilReferenceCmd>(Command::SetStencilReference);
cmd->reference = reference;
cmd->reference = reference & 255;
return {};
},