Fix scissor rect larger than render pass width/height in Metal backend
BUG=dawn:116 TEST=dawn_end2end_tests Change-Id: I3e36e19d20b271ba58652bcaea973f3999e9e7ac Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5560 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Hao Li <hao.x.li@intel.com>
This commit is contained in:
parent
5625b63202
commit
d263d752ac
|
@ -667,6 +667,15 @@ namespace dawn_native { namespace metal {
|
||||||
rect.width = cmd->width;
|
rect.width = cmd->width;
|
||||||
rect.height = cmd->height;
|
rect.height = cmd->height;
|
||||||
|
|
||||||
|
// The scissor rect x + width must be <= render pass width
|
||||||
|
if ((rect.x + rect.width) > renderPassCmd->width) {
|
||||||
|
rect.width = renderPassCmd->width - rect.x;
|
||||||
|
}
|
||||||
|
// The scissor rect y + height must be <= render pass height
|
||||||
|
if ((rect.y + rect.height > renderPassCmd->height)) {
|
||||||
|
rect.height = renderPassCmd->height - rect.y;
|
||||||
|
}
|
||||||
|
|
||||||
[encoder setScissorRect:rect];
|
[encoder setScissorRect:rect];
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue