1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[dxvk] Only enable dynamic MSAA state if sample shading is enabled

Otherwise, create a more specialized fragment output library on demand.
May help RADV since dynamic alpha-to-coverage triggers a less efficient
code path.
This commit is contained in:
Philip Rebohle 2023-04-04 17:32:28 +02:00
parent 306919047b
commit f212cc8f7d
3 changed files with 8 additions and 2 deletions

View File

@ -4954,7 +4954,8 @@ namespace dxvk {
if (m_device->features().core.features.depthBounds) if (m_device->features().core.features.depthBounds)
m_flags.set(DxvkContextFlag::GpDynamicDepthBounds); m_flags.set(DxvkContextFlag::GpDynamicDepthBounds);
if (m_device->features().extExtendedDynamicState3.extendedDynamicState3RasterizationSamples if (m_state.gp.flags.test(DxvkGraphicsPipelineFlag::HasSampleRateShading)
&& m_device->features().extExtendedDynamicState3.extendedDynamicState3RasterizationSamples
&& m_device->features().extExtendedDynamicState3.extendedDynamicState3SampleMask) && m_device->features().extExtendedDynamicState3.extendedDynamicState3SampleMask)
m_flags.set(DxvkContextFlag::GpDynamicMultisampleState); m_flags.set(DxvkContextFlag::GpDynamicMultisampleState);
} else { } else {

View File

@ -397,7 +397,8 @@ namespace dxvk {
std::array<VkDynamicState, 4> dynamicStates = { }; std::array<VkDynamicState, 4> dynamicStates = { };
if (m_device->features().extExtendedDynamicState3.extendedDynamicState3RasterizationSamples if (m_device->features().extExtendedDynamicState3.extendedDynamicState3RasterizationSamples
&& m_device->features().extExtendedDynamicState3.extendedDynamicState3SampleMask) { && m_device->features().extExtendedDynamicState3.extendedDynamicState3SampleMask
&& state.msInfo.sampleShadingEnable) {
dynamicStates[dynamicStateCount++] = VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT; dynamicStates[dynamicStateCount++] = VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT;
dynamicStates[dynamicStateCount++] = VK_DYNAMIC_STATE_SAMPLE_MASK_EXT; dynamicStates[dynamicStateCount++] = VK_DYNAMIC_STATE_SAMPLE_MASK_EXT;
@ -891,6 +892,9 @@ namespace dxvk {
if (m_barrier.access & VK_ACCESS_SHADER_WRITE_BIT) if (m_barrier.access & VK_ACCESS_SHADER_WRITE_BIT)
m_flags.set(DxvkGraphicsPipelineFlag::HasStorageDescriptors); m_flags.set(DxvkGraphicsPipelineFlag::HasStorageDescriptors);
if (m_shaders.fs != nullptr && m_shaders.fs->flags().test(DxvkShaderFlag::HasSampleRateShading))
m_flags.set(DxvkGraphicsPipelineFlag::HasSampleRateShading);
} }

View File

@ -30,6 +30,7 @@ namespace dxvk {
HasRasterizerDiscard, HasRasterizerDiscard,
HasTransformFeedback, HasTransformFeedback,
HasStorageDescriptors, HasStorageDescriptors,
HasSampleRateShading,
}; };
using DxvkGraphicsPipelineFlags = Flags<DxvkGraphicsPipelineFlag>; using DxvkGraphicsPipelineFlags = Flags<DxvkGraphicsPipelineFlag>;