From 0e72e9ee3b0201f05e5d74917b17c8a427b14d9f Mon Sep 17 00:00:00 2001 From: egdaniel Date: Fri, 22 Jul 2016 14:41:30 -0700 Subject: 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 --- src/gpu/vk/GrVkPipeline.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/gpu/vk/GrVkPipeline.cpp') 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(); -- cgit v1.2.3