forked from MoonsideGames/Refresh
Compare commits
2 Commits
5166ae87b2
...
2706b6fe43
Author | SHA1 | Date |
---|---|---|
Caleb Cornett | 2706b6fe43 | |
TheSpydog | c4b9798fc1 |
|
@ -5446,7 +5446,7 @@ static VulkanRenderTarget* VULKAN_INTERNAL_CreateRenderTarget(
|
|||
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 */
|
||||
|
@ -5810,7 +5810,9 @@ static VkRenderPass VULKAN_INTERNAL_CreateTransientRenderPass(
|
|||
attachmentDescriptions[attachmentDescriptionCount].format = RefreshToVK_SurfaceFormat[
|
||||
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].storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
||||
attachmentDescriptions[attachmentDescriptionCount].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||
|
@ -8307,6 +8309,7 @@ static void VULKAN_BeginRenderPass(
|
|||
VulkanTexture *texture;
|
||||
VkClearValue *clearValues;
|
||||
uint32_t clearCount = colorAttachmentCount;
|
||||
uint32_t multisampleAttachmentCount = 0;
|
||||
uint32_t i;
|
||||
VkImageAspectFlags depthAspectFlags;
|
||||
Refresh_Viewport defaultViewport;
|
||||
|
@ -8393,6 +8396,12 @@ static void VULKAN_BeginRenderPass(
|
|||
&texture->resourceAccessType
|
||||
);
|
||||
|
||||
if (colorAttachmentInfos[i].sampleCount > 1)
|
||||
{
|
||||
clearCount += 1;
|
||||
multisampleAttachmentCount += 1;
|
||||
}
|
||||
|
||||
VULKAN_INTERNAL_TrackTexture(renderer, vulkanCommandBuffer, texture);
|
||||
}
|
||||
|
||||
|
@ -8430,12 +8439,21 @@ static void VULKAN_BeginRenderPass(
|
|||
|
||||
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[1] = colorAttachmentInfos[i].clearColor.y;
|
||||
clearValues[i].color.float32[2] = colorAttachmentInfos[i].clearColor.z;
|
||||
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)
|
||||
|
@ -10549,6 +10567,7 @@ static uint8_t VULKAN_INTERNAL_CreateLogicalDevice(
|
|||
deviceFeatures.occlusionQueryPrecise = VK_TRUE;
|
||||
deviceFeatures.fillModeNonSolid = VK_TRUE;
|
||||
deviceFeatures.depthClamp = VK_TRUE;
|
||||
deviceFeatures.samplerAnisotropy = VK_TRUE;
|
||||
|
||||
/* creating the logical device */
|
||||
|
||||
|
|
Loading…
Reference in New Issue