X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=inline;f=source%2Fbackends%2Fvulkan%2Fpipelinecache.cpp;h=3f8e55008223484036b3e5c4760ae5c5bd09d047;hb=0bcebf9930e4baada774a16c0e7637a22a410bb4;hp=e24c72dbba4944dc6f3180b61af8557f6ac0a8ec;hpb=99ca354f18119f82f1adeca100cd665a8f640317;p=libs%2Fgl.git diff --git a/source/backends/vulkan/pipelinecache.cpp b/source/backends/vulkan/pipelinecache.cpp index e24c72db..3f8e5500 100644 --- a/source/backends/vulkan/pipelinecache.cpp +++ b/source/backends/vulkan/pipelinecache.cpp @@ -44,11 +44,11 @@ PipelineCache::~PipelineCache() vk.DestroyDescriptorPool(descriptor_pool); } -VkRenderPass PipelineCache::get_render_pass(const FrameFormat &format, bool is_cleared, bool to_present) +VkRenderPass PipelineCache::get_render_pass(const FrameFormat &format, bool clear, bool discard, bool to_present) { const VulkanFunctions &vk = device.get_functions(); - uint64_t key = hash<64>(static_cast(is_cleared | (to_present*2))); + uint64_t key = hash<64>(static_cast(clear | (discard*2) | (to_present*4))); for(FrameAttachment a: format) key = hash_update<64>(key, a); @@ -69,11 +69,11 @@ VkRenderPass PipelineCache::get_render_pass(const FrameFormat &format, bool is_c { attachments[i].format = static_cast(get_vulkan_pixelformat(get_attachment_pixelformat(a))); attachments[i].samples = vk_samples; - attachments[i].loadOp = (is_cleared ? VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_LOAD); + attachments[i].loadOp = (clear ? discard ? VK_ATTACHMENT_LOAD_OP_DONT_CARE : VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_LOAD); attachments[i].storeOp = VK_ATTACHMENT_STORE_OP_STORE; attachments[i].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD; attachments[i].stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE; - attachments[i].initialLayout = (is_cleared ? VK_IMAGE_LAYOUT_UNDEFINED : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); + attachments[i].initialLayout = (clear ? VK_IMAGE_LAYOUT_UNDEFINED : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); attachments[i].finalLayout = (to_present ? VK_IMAGE_LAYOUT_PRESENT_SRC_KHR : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); unsigned attach_pt = get_attach_point(a);