transition the multisample texture when creating a render pass

msaa
Caleb Cornett 2022-11-03 15:45:40 -04:00
parent 2706b6fe43
commit 0f47f5bc54
1 changed files with 21 additions and 0 deletions

View File

@ -5540,6 +5540,7 @@ static VulkanRenderTarget* VULKAN_INTERNAL_FetchRenderTarget(
static VkRenderPass VULKAN_INTERNAL_CreateRenderPass(
VulkanRenderer *renderer,
VulkanCommandBuffer *commandBuffer,
Refresh_ColorAttachmentInfo *colorAttachmentInfos,
uint32_t colorAttachmentCount,
Refresh_DepthStencilAttachmentInfo *depthStencilAttachmentInfo
@ -5575,6 +5576,23 @@ static VkRenderPass VULKAN_INTERNAL_CreateRenderPass(
colorAttachmentInfos[i].sampleCount
);
if (renderTarget->multisampleTexture != NULL)
{
VULKAN_INTERNAL_ImageMemoryBarrier(
renderer,
commandBuffer->commandBuffer,
RESOURCE_ACCESS_COLOR_ATTACHMENT_WRITE,
VK_IMAGE_ASPECT_COLOR_BIT,
0,
renderTarget->multisampleTexture->layerCount,
0,
renderTarget->multisampleTexture->levelCount,
0,
renderTarget->multisampleTexture->image,
&renderTarget->multisampleTexture->resourceAccessType
);
}
if (renderTarget->multisampleCount > VK_SAMPLE_COUNT_1_BIT)
{
multisampling = 1;
@ -7982,6 +8000,7 @@ static void VULKAN_QueueDestroyGraphicsPipeline(
static VkRenderPass VULKAN_INTERNAL_FetchRenderPass(
VulkanRenderer *renderer,
VulkanCommandBuffer *commandBuffer,
Refresh_ColorAttachmentInfo *colorAttachmentInfos,
uint32_t colorAttachmentCount,
Refresh_DepthStencilAttachmentInfo *depthStencilAttachmentInfo
@ -8032,6 +8051,7 @@ static VkRenderPass VULKAN_INTERNAL_FetchRenderPass(
renderPass = VULKAN_INTERNAL_CreateRenderPass(
renderer,
commandBuffer,
colorAttachmentInfos,
colorAttachmentCount,
depthStencilAttachmentInfo
@ -8359,6 +8379,7 @@ static void VULKAN_BeginRenderPass(
renderPass = VULKAN_INTERNAL_FetchRenderPass(
renderer,
vulkanCommandBuffer,
colorAttachmentInfos,
colorAttachmentCount,
depthStencilAttachmentInfo