fixed a few msaa validation errors
continuous-integration/drone/pr Build is passing Details

pull/25/head
Caleb Cornett 2022-11-02 18:49:01 -04:00
parent c4b9798fc1
commit 2706b6fe43
1 changed files with 21 additions and 3 deletions

View File

@ -5446,7 +5446,7 @@ static VulkanRenderTarget* VULKAN_INTERNAL_CreateRenderTarget(
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT
); );
renderTarget->multisampleCount = multisampleCount; renderTarget->multisampleCount = RefreshToVK_SampleCount[multisampleCount];
} }
/* create framebuffer compatible views for RenderTarget */ /* create framebuffer compatible views for RenderTarget */
@ -5810,7 +5810,9 @@ static VkRenderPass VULKAN_INTERNAL_CreateTransientRenderPass(
attachmentDescriptions[attachmentDescriptionCount].format = RefreshToVK_SurfaceFormat[ attachmentDescriptions[attachmentDescriptionCount].format = RefreshToVK_SurfaceFormat[
attachmentDescription.format attachmentDescription.format
]; ];
attachmentDescriptions[attachmentDescriptionCount].samples = VK_SAMPLE_COUNT_1_BIT; attachmentDescriptions[attachmentDescriptionCount].samples = RefreshToVK_SampleCount[
attachmentDescription.sampleCount
];
attachmentDescriptions[attachmentDescriptionCount].loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; attachmentDescriptions[attachmentDescriptionCount].loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
attachmentDescriptions[attachmentDescriptionCount].storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; attachmentDescriptions[attachmentDescriptionCount].storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
attachmentDescriptions[attachmentDescriptionCount].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; attachmentDescriptions[attachmentDescriptionCount].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
@ -8307,6 +8309,7 @@ static void VULKAN_BeginRenderPass(
VulkanTexture *texture; VulkanTexture *texture;
VkClearValue *clearValues; VkClearValue *clearValues;
uint32_t clearCount = colorAttachmentCount; uint32_t clearCount = colorAttachmentCount;
uint32_t multisampleAttachmentCount = 0;
uint32_t i; uint32_t i;
VkImageAspectFlags depthAspectFlags; VkImageAspectFlags depthAspectFlags;
Refresh_Viewport defaultViewport; Refresh_Viewport defaultViewport;
@ -8393,6 +8396,12 @@ static void VULKAN_BeginRenderPass(
&texture->resourceAccessType &texture->resourceAccessType
); );
if (colorAttachmentInfos[i].sampleCount > 1)
{
clearCount += 1;
multisampleAttachmentCount += 1;
}
VULKAN_INTERNAL_TrackTexture(renderer, vulkanCommandBuffer, texture); VULKAN_INTERNAL_TrackTexture(renderer, vulkanCommandBuffer, texture);
} }
@ -8430,12 +8439,21 @@ static void VULKAN_BeginRenderPass(
clearValues = SDL_stack_alloc(VkClearValue, clearCount); clearValues = SDL_stack_alloc(VkClearValue, clearCount);
for (i = 0; i < colorAttachmentCount; i += 1) for (i = 0; i < colorAttachmentCount + multisampleAttachmentCount; i += 1)
{ {
clearValues[i].color.float32[0] = colorAttachmentInfos[i].clearColor.x; clearValues[i].color.float32[0] = colorAttachmentInfos[i].clearColor.x;
clearValues[i].color.float32[1] = colorAttachmentInfos[i].clearColor.y; clearValues[i].color.float32[1] = colorAttachmentInfos[i].clearColor.y;
clearValues[i].color.float32[2] = colorAttachmentInfos[i].clearColor.z; clearValues[i].color.float32[2] = colorAttachmentInfos[i].clearColor.z;
clearValues[i].color.float32[3] = colorAttachmentInfos[i].clearColor.w; clearValues[i].color.float32[3] = colorAttachmentInfos[i].clearColor.w;
if (colorAttachmentInfos[i].sampleCount > 0)
{
i += 1;
clearValues[i].color.float32[0] = colorAttachmentInfos[i].clearColor.x;
clearValues[i].color.float32[1] = colorAttachmentInfos[i].clearColor.y;
clearValues[i].color.float32[2] = colorAttachmentInfos[i].clearColor.z;
clearValues[i].color.float32[3] = colorAttachmentInfos[i].clearColor.w;
}
} }
if (depthStencilAttachmentInfo != NULL) if (depthStencilAttachmentInfo != NULL)