mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-25 07:56:33 +00:00
Fix crash with imageless framebuffers
This commit is contained in:
@@ -3564,9 +3564,10 @@ FramebufferInfo::~FramebufferInfo()
|
||||
delete[] imageAttachments;
|
||||
}
|
||||
|
||||
bool FramebufferInfo::AttachmentFullyReferenced(size_t attachmentIndex, const RenderPassInfo *rpi)
|
||||
bool FramebufferInfo::AttachmentFullyReferenced(size_t attachmentIndex, VkResourceRecord *att,
|
||||
VkImageSubresourceRange viewRange,
|
||||
const RenderPassInfo *rpi)
|
||||
{
|
||||
VkResourceRecord *att = imageAttachments[attachmentIndex].record;
|
||||
// if framebuffer doesn't reference the entire image
|
||||
if(att->resInfo->imageInfo.extent.width != width || att->resInfo->imageInfo.extent.height != height)
|
||||
{
|
||||
@@ -3586,7 +3587,7 @@ bool FramebufferInfo::AttachmentFullyReferenced(size_t attachmentIndex, const Re
|
||||
uint32_t renderpass_viewmask = rpi->multiviewViewMaskTable[attachmentIndex];
|
||||
return (int)Bits::CountOnes(renderpass_viewmask) == att->resInfo->imageInfo.layerCount;
|
||||
}
|
||||
return imageAttachments[attachmentIndex].barrier.subresourceRange.layerCount == layers;
|
||||
return viewRange.layerCount == layers;
|
||||
}
|
||||
|
||||
int ImgRefs::GetAspectCount() const
|
||||
|
||||
@@ -1161,7 +1161,8 @@ struct FramebufferInfo
|
||||
FramebufferInfo(const VkFramebufferCreateInfo &ci);
|
||||
~FramebufferInfo();
|
||||
|
||||
bool AttachmentFullyReferenced(size_t attachmentIndex, const RenderPassInfo *rpi);
|
||||
bool AttachmentFullyReferenced(size_t attachmentIndex, VkResourceRecord *attachment,
|
||||
VkImageSubresourceRange viewRange, const RenderPassInfo *rpi);
|
||||
|
||||
AttachmentInfo *imageAttachments;
|
||||
|
||||
|
||||
@@ -1624,7 +1624,8 @@ void WrappedVulkan::vkCmdBeginRenderPass(VkCommandBuffer commandBuffer,
|
||||
if(att == NULL)
|
||||
break;
|
||||
|
||||
bool framebuffer_reference_entire_attachment = fbInfo->AttachmentFullyReferenced(i, rpInfo);
|
||||
bool framebuffer_reference_entire_attachment =
|
||||
fbInfo->AttachmentFullyReferenced(i, att, att->viewRange, rpInfo);
|
||||
|
||||
FrameRefType refType = eFrameRef_ReadBeforeWrite;
|
||||
|
||||
@@ -2232,7 +2233,8 @@ void WrappedVulkan::vkCmdBeginRenderPass2(VkCommandBuffer commandBuffer,
|
||||
if(att == NULL)
|
||||
break;
|
||||
|
||||
bool framebuffer_reference_entire_attachment = fbInfo->AttachmentFullyReferenced(i, rpInfo);
|
||||
bool framebuffer_reference_entire_attachment =
|
||||
fbInfo->AttachmentFullyReferenced(i, att, att->viewRange, rpInfo);
|
||||
|
||||
FrameRefType refType = eFrameRef_ReadBeforeWrite;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user