Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1655)

Unified Diff: src/gpu/vk/GrVkPipeline.cpp

Issue 2171283004: Remove asserts on scissor size in Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clamp to x,y to 0 Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkPipeline.cpp
diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp
index 055bb94d6f961e160b3f96246707e0ee5da20507..e401d8d9f9d28965d6aaf55a28e521d39005393b 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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698