mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-04-24 10:38:53 +00:00
Vulkan: Detect and enable fragment shading rate features at individual per-feature granularity
(cherry picked from commit 638ae85c6c420160e022af171304717adb14f1f2)
This commit is contained in:
parent
f434a650db
commit
bc658e4203
1 changed files with 13 additions and 7 deletions
|
@ -225,7 +225,9 @@ private:
|
|||
#if USE_OPTICK
|
||||
VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME,
|
||||
#endif
|
||||
#if defined( VK_KHR_format_feature_flags2 )
|
||||
VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME,
|
||||
#endif
|
||||
VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME
|
||||
},
|
||||
};
|
||||
|
@ -821,10 +823,17 @@ bool DeviceManager_VK::createDevice()
|
|||
auto meshletFeatures = vk::PhysicalDeviceMeshShaderFeaturesNV()
|
||||
.setTaskShader( true )
|
||||
.setMeshShader( true );
|
||||
|
||||
// SRS - get/set shading rate features which are detected individually by nvrhi (not just at extension level)
|
||||
vk::PhysicalDeviceFeatures2 actualDeviceFeatures2;
|
||||
vk::PhysicalDeviceFragmentShadingRateFeaturesKHR fragmentShadingRateFeatures;
|
||||
actualDeviceFeatures2.pNext = &fragmentShadingRateFeatures;
|
||||
m_VulkanPhysicalDevice.getFeatures2( &actualDeviceFeatures2 );
|
||||
|
||||
auto vrsFeatures = vk::PhysicalDeviceFragmentShadingRateFeaturesKHR()
|
||||
.setPipelineFragmentShadingRate( true )
|
||||
.setPrimitiveFragmentShadingRate( true )
|
||||
.setAttachmentFragmentShadingRate( true );
|
||||
.setPipelineFragmentShadingRate( fragmentShadingRateFeatures.pipelineFragmentShadingRate )
|
||||
.setPrimitiveFragmentShadingRate( fragmentShadingRateFeatures.primitiveFragmentShadingRate )
|
||||
.setAttachmentFragmentShadingRate( fragmentShadingRateFeatures.attachmentFragmentShadingRate );
|
||||
|
||||
auto sync2Features = vk::PhysicalDeviceSynchronization2FeaturesKHR()
|
||||
.setSynchronization2( true );
|
||||
|
@ -850,12 +859,9 @@ bool DeviceManager_VK::createDevice()
|
|||
APPEND_EXTENSION( sync2Supported, sync2Features )
|
||||
#undef APPEND_EXTENSION
|
||||
|
||||
vk::PhysicalDeviceFeatures actualDeviceFeatures;
|
||||
m_VulkanPhysicalDevice.getFeatures( &actualDeviceFeatures );
|
||||
|
||||
auto deviceFeatures = vk::PhysicalDeviceFeatures()
|
||||
.setShaderImageGatherExtended( true )
|
||||
.setShaderStorageImageReadWithoutFormat( actualDeviceFeatures.shaderStorageImageReadWithoutFormat )
|
||||
.setShaderStorageImageReadWithoutFormat( actualDeviceFeatures2.features.shaderStorageImageReadWithoutFormat )
|
||||
.setSamplerAnisotropy( true )
|
||||
.setTessellationShader( true )
|
||||
.setTextureCompressionBC( true )
|
||||
|
|
Loading…
Reference in a new issue