]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/pipelinestate_backend.cpp
Add support for alpha to coverage
[libs/gl.git] / source / backends / vulkan / pipelinestate_backend.cpp
index 1578f9976d61452b200fd0066bb02f16ca4074e5..9c695b3d1a5d281abda8ccc0d8a2df4b1e60b775 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)
                {
@@ -216,7 +218,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;