KhronosGroup / Vulkan-Portability

Apache License 2.0
40 stars 4 forks source link

VkPipelineMultisampleStateCreateInfo::minSampleShading cannot be supported in Metal #60

Open billhollings opened 2 years ago

billhollings commented 2 years ago

Vulkan requires VkPipelineMultisampleStateCreateInfo::minSampleShading to be honoured if sampleShadingEnable is enabled:

If sample shading is enabled, an implementation must invoke the fragment shader at least max(VkPipelineMultisampleStateCreateInfo::minSampleShading × VkPipelineMultisampleStateCreateInfo::rasterizationSamples, 1) times per fragment.

Metal does not support forced running of Per-Sample shading unless the shader actually uses Per-Sample built-ins.

I think we need to add a VkPhysicalDevicePortabilitySubsetFeaturesKHR::supportMinSampleShading capability, in order to allow an app to query whether the implementation honours the above Vulkan requirement.

I am not aware of any Vulkan CTS tests that covers this and will fail, but it has appeared as a user request in MoltenVK.

billhollings commented 2 years ago

Since CTS did not catch this, we should post an issue to the CTS project to request a test be added to cover this situation.

alyssarosenzweig commented 9 months ago

Inserting a storage buffer write of the sample_id should force sample shading in a way that Metal can't optimize out. MVK should work around, no need for portability change.