Permalink
Browse files

Vulkan: The validation layers don't like zero-size blits.

  • Loading branch information...
hrydgard committed Nov 6, 2017
1 parent 944cc94 commit 4f4eb6f0246d8e9c676fba1e1e3d73b6b5e9f9a4
Showing with 7 additions and 1 deletion.
  1. +1 −1 GPU/Common/FramebufferCommon.cpp
  2. +6 −0 ext/native/thin3d/VulkanRenderManager.cpp
@@ -2081,7 +2081,7 @@ void FramebufferManagerCommon::DownloadFramebufferForClut(u32 fb_address, u32 lo
FlushBeforeCopy();
// No need to download if we already have it.
if (!vfb->memoryUpdated && vfb->clutUpdatedBytes < loadBytes) {
if (w > 0 && h > 0 && !vfb->memoryUpdated && vfb->clutUpdatedBytes < loadBytes) {
// We intentionally don't call OptimizeDownloadRange() here - we don't want to over download.
// CLUT framebuffers are often incorrectly estimated in size.
if (x == 0 && y == 0 && w == vfb->width && h == vfb->height) {
@@ -586,11 +586,17 @@ void VulkanRenderManager::BlitFramebuffer(VKRFramebuffer *src, VkRect2D srcRect,
_dbg_assert_msg_(G3D, srcRect.offset.x + srcRect.extent.width <= (uint32_t)src->width, "srcrect offset x + extent > width");
_dbg_assert_msg_(G3D, srcRect.offset.y + srcRect.extent.height <= (uint32_t)src->height, "srcrect offset y + extent > height");
_dbg_assert_msg_(G3D, srcRect.extent.width > 0, "blit srcwidth == 0");
_dbg_assert_msg_(G3D, srcRect.extent.height > 0, "blit srcheight == 0");
_dbg_assert_msg_(G3D, dstRect.offset.x >= 0, "dstrect offset x < 0");
_dbg_assert_msg_(G3D, dstRect.offset.y >= 0, "dstrect offset y < 0");
_dbg_assert_msg_(G3D, dstRect.offset.x + dstRect.extent.width <= (uint32_t)dst->width, "dstrect offset x + extent > width");
_dbg_assert_msg_(G3D, dstRect.offset.y + dstRect.extent.height <= (uint32_t)dst->height, "dstrect offset y + extent > height");
_dbg_assert_msg_(G3D, dstRect.extent.width > 0, "blit dstwidth == 0");
_dbg_assert_msg_(G3D, dstRect.extent.height > 0, "blit dstheight == 0");
VKRStep *step = new VKRStep{ VKRStepType::BLIT };
step->blit.aspectMask = aspectMask;

0 comments on commit 4f4eb6f

Please sign in to comment.