Skip to content

Commit

Permalink
Some sanity checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 23, 2024
1 parent 622aeaa commit d260cd0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Common/GPU/Vulkan/VulkanQueueRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1703,9 +1703,8 @@ void VulkanQueueRunner::PerformBlit(const VKRStep &step, VkCommandBuffer cmd) {

// We can't copy only depth or only stencil unfortunately.
if (step.blit.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
_dbg_assert_(src->depth.image != VK_NULL_HANDLE);
_dbg_assert_(dst->depth.image != VK_NULL_HANDLE);

_assert_(src->depth.image != VK_NULL_HANDLE);
_assert_(dst->depth.image != VK_NULL_HANDLE);
SetupTransitionToTransferSrc(src->depth, VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT, &recordBarrier_);
SetupTransitionToTransferDst(dst->depth, VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT, &recordBarrier_);
}
Expand Down
11 changes: 10 additions & 1 deletion Common/GPU/Vulkan/VulkanRenderManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ void VulkanRenderManager::DestroyBackbuffers() {
VulkanRenderManager::~VulkanRenderManager() {
INFO_LOG(G3D, "VulkanRenderManager destructor");

if (useRenderThread_) {
_dbg_assert_(!renderThread_.joinable());
}

_dbg_assert_(!runCompileThread_); // StopThread should already have been called from DestroyBackbuffers.

vulkan_->WaitUntilQueueIdle();
Expand Down Expand Up @@ -1284,8 +1288,13 @@ void VulkanRenderManager::BlitFramebuffer(VKRFramebuffer *src, VkRect2D srcRect,

EndCurRenderStep();

VKRStep *step = new VKRStep{ VKRStepType::BLIT };
// Sanity check. Added an assert to try to gather more info.
if (aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
_assert_msg_(src->depth.image != VK_NULL_HANDLE, "%s", src->Tag());
_assert_msg_(dst->depth.image != VK_NULL_HANDLE, "%s", dst->Tag());
}

VKRStep *step = new VKRStep{ VKRStepType::BLIT };
step->blit.aspectMask = aspectMask;
step->blit.src = src;
step->blit.srcRect = srcRect;
Expand Down

0 comments on commit d260cd0

Please sign in to comment.