Remove asserts on scissor size in Vulkan
These are asserts are firing from a recent change to our scissor code. Since these asserts were added, the Vulkan spec has been updated to no longer require the scissor is insides the bounds of the image, just that x + width does not overflow. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2171283004 Review-Url: https://codereview.chromium.org/2171283004
This commit is contained in:
parent
8e4373f40b
commit
0e72e9ee3b
@ -495,7 +495,7 @@ void set_dynamic_scissor_state(GrVkGpu* gpu,
|
|||||||
!scissorState.rect().contains(0, 0, target.width(), target.height())) {
|
!scissorState.rect().contains(0, 0, target.width(), target.height())) {
|
||||||
// This all assumes the scissorState has previously been clipped to the device space render
|
// This all assumes the scissorState has previously been clipped to the device space render
|
||||||
// target.
|
// target.
|
||||||
scissor.offset.x = scissorState.rect().fLeft;
|
scissor.offset.x = SkTMax(scissorState.rect().fLeft, 0);
|
||||||
scissor.extent.width = scissorState.rect().width();
|
scissor.extent.width = scissorState.rect().width();
|
||||||
if (kTopLeft_GrSurfaceOrigin == target.origin()) {
|
if (kTopLeft_GrSurfaceOrigin == target.origin()) {
|
||||||
scissor.offset.y = scissorState.rect().fTop;
|
scissor.offset.y = scissorState.rect().fTop;
|
||||||
@ -503,12 +503,11 @@ void set_dynamic_scissor_state(GrVkGpu* gpu,
|
|||||||
SkASSERT(kBottomLeft_GrSurfaceOrigin == target.origin());
|
SkASSERT(kBottomLeft_GrSurfaceOrigin == target.origin());
|
||||||
scissor.offset.y = target.height() - scissorState.rect().fBottom;
|
scissor.offset.y = target.height() - scissorState.rect().fBottom;
|
||||||
}
|
}
|
||||||
|
scissor.offset.y = SkTMax(scissor.offset.y, 0);
|
||||||
scissor.extent.height = scissorState.rect().height();
|
scissor.extent.height = scissorState.rect().height();
|
||||||
|
|
||||||
SkASSERT(scissor.offset.x >= 0);
|
SkASSERT(scissor.offset.x >= 0);
|
||||||
SkASSERT(scissor.offset.x + scissor.extent.width <= (uint32_t)target.width());
|
|
||||||
SkASSERT(scissor.offset.y >= 0);
|
SkASSERT(scissor.offset.y >= 0);
|
||||||
SkASSERT(scissor.offset.y + scissor.extent.height <= (uint32_t)target.height());
|
|
||||||
} else {
|
} else {
|
||||||
scissor.extent.width = target.width();
|
scissor.extent.width = target.width();
|
||||||
scissor.extent.height = target.height();
|
scissor.extent.height = target.height();
|
||||||
|
Loading…
Reference in New Issue
Block a user