aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkPipeline.cpp
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2016-07-22 14:41:30 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-22 14:41:30 -0700
commit0e72e9ee3b0201f05e5d74917b17c8a427b14d9f (patch)
tree53fc34485c9a9f0fc68a769543398cd7056aca53 /src/gpu/vk/GrVkPipeline.cpp
parent8e4373f40be3362a2756c6522df3541253d0edb0 (diff)
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
Diffstat (limited to 'src/gpu/vk/GrVkPipeline.cpp')
-rw-r--r--src/gpu/vk/GrVkPipeline.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp
index 055bb94d6f..e401d8d9f9 100644
--- a/src/gpu/vk/GrVkPipeline.cpp
+++ b/src/gpu/vk/GrVkPipeline.cpp
@@ -495,7 +495,7 @@ void set_dynamic_scissor_state(GrVkGpu* gpu,
!scissorState.rect().contains(0, 0, target.width(), target.height())) {
// This all assumes the scissorState has previously been clipped to the device space render
// target.
- scissor.offset.x = scissorState.rect().fLeft;
+ scissor.offset.x = SkTMax(scissorState.rect().fLeft, 0);
scissor.extent.width = scissorState.rect().width();
if (kTopLeft_GrSurfaceOrigin == target.origin()) {
scissor.offset.y = scissorState.rect().fTop;
@@ -503,12 +503,11 @@ void set_dynamic_scissor_state(GrVkGpu* gpu,
SkASSERT(kBottomLeft_GrSurfaceOrigin == target.origin());
scissor.offset.y = target.height() - scissorState.rect().fBottom;
}
+ scissor.offset.y = SkTMax(scissor.offset.y, 0);
scissor.extent.height = scissorState.rect().height();
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 + scissor.extent.height <= (uint32_t)target.height());
} else {
scissor.extent.width = target.width();
scissor.extent.height = target.height();