]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/pipelinestate_backend.cpp
Use correct to_present flag when creating framebuffers and pipelines
[libs/gl.git] / source / backends / vulkan / pipelinestate_backend.cpp
index 1578f9976d61452b200fd0066bb02f16ca4074e5..ab5d3dd4cd8ca10a20342eb1b063a0c29c92b8bf 100644 (file)
@@ -118,6 +118,8 @@ uint64_t VulkanPipelineState::compute_hash() const
                }
 
                result = hash_round<64>(result, format.get_samples());
+               if(format.get_samples()>1)
+                       result = hash_round<64>(result, self.blend.alpha_to_coverage);
 
                if(self.depth_test.enabled)
                {
@@ -164,6 +166,7 @@ void VulkanPipelineState::fill_graphics_creation_info(vector<char> &buffer) cons
        const FrameFormat &format = self.framebuffer->get_format();
        RenderPass render_pass;
        render_pass.framebuffer = self.framebuffer;
+       render_pass.to_present = self.framebuffer->is_presentable();
        render_pass.update(device);
 
        unsigned n_color_attachments = 0;
@@ -216,7 +219,7 @@ void VulkanPipelineState::fill_graphics_creation_info(vector<char> &buffer) cons
        multisample_info->sampleShadingEnable = VK_FALSE;
        multisample_info->minSampleShading = 1.0f;
        multisample_info->pSampleMask = 0;
-       multisample_info->alphaToCoverageEnable = VK_FALSE;
+       multisample_info->alphaToCoverageEnable = (format.get_samples()>1 && self.blend.alpha_to_coverage ? VK_TRUE : VK_FALSE);
        multisample_info->alphaToOneEnable = VK_FALSE;
 
        depth_stencil_info->sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;