Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Vulkan profile #1567

Merged
merged 12 commits into from
May 25, 2023
Merged

Add Vulkan profile #1567

merged 12 commits into from
May 25, 2023

Conversation

HansKristian-Work
Copy link
Owner

@HansKristian-Work HansKristian-Work commented May 22, 2023

Supersedes #1210.

This was kinda painful to write. Ended up with more profiles than expected.

  • Minimum baseline to create device (FL 11.0)
  • FL 11.1
  • FL 12.0
  • FL 12.0 with optimal descriptor implementation + SM 6.6 (the most useful baseline)
  • FL 12.1
  • FL 12.2 (w/o sampler feedback)
  • FL 12.2 with optimal descriptor implementation + SM 6.6
  • Current maximum RADV profile
  • Current maximum NV profile

The maximum profiles are intended to represent the current state of RADV and NV.

SM 6.2 denorm behavior stuff got extremely messy. I just ignored it and put it in the optimal per-vendor profiles. When NV fixes their drivers, we can do it properly ... The optional feature selection is broken it seems and I couldn't make it work.

Added an auto-generated profile Markdown.

Added some helper scripts to invoke the profiles layer so that it's possible to run the test suite with limited feature sets.
I found misc bugs that way.

Also added a way to check the profiles using the profiles solution. E.g.:

$ RADV_PERFTEST=rt ./profile-test 2>&1 | grep RESULT
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_11_0_baseline, supported: yes
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_11_0_baseline, supported: yes
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_11_1_baseline, supported: yes
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_11_1_baseline, supported: yes
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_12_0_baseline, supported: yes
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_12_0_baseline, supported: yes
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_12_0_optimal, supported: yes
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_12_0_optimal, supported: yes
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_12_1_baseline, supported: no
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_12_1_baseline, supported: yes
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_12_2_baseline, supported: no
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_12_2_baseline, supported: yes
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_12_2_optimal, supported: no
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_12_2_optimal, supported: yes
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_maximum_nv, supported: no
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_maximum_nv, supported: yes
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_maximum_radv, supported: yes
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_maximum_radv, supported: no

It can dump out debug information to report what is not supported:

Testing profile VP_D3D12_FL_11_0_baseline.
Checking device support for profile VP_D3D12_FL_11_0_baseline (deviceName=AMD Radeon RX 6800 (RADV NAVI21), driverName=radv, driverInfo=Mesa 23.2.0-devel (git-8e53b293f8)). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_11_0_baseline, supported: yes
Checking device support for profile VP_D3D12_FL_11_0_baseline (deviceName=NVIDIA GeForce RTX 3070, driverName=NVIDIA, driverInfo=525.47.24). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_11_0_baseline, supported: yes
Testing profile VP_D3D12_FL_11_1_baseline.
Checking device support for profile VP_D3D12_FL_11_1_baseline (deviceName=AMD Radeon RX 6800 (RADV NAVI21), driverName=radv, driverInfo=Mesa 23.2.0-devel (git-8e53b293f8)). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_11_1_baseline, supported: yes
Checking device support for profile VP_D3D12_FL_11_1_baseline (deviceName=NVIDIA GeForce RTX 3070, driverName=NVIDIA, driverInfo=525.47.24). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_11_1_baseline, supported: yes
Testing profile VP_D3D12_FL_12_0_baseline.
Checking device support for profile VP_D3D12_FL_12_0_baseline (deviceName=AMD Radeon RX 6800 (RADV NAVI21), driverName=radv, driverInfo=Mesa 23.2.0-devel (git-8e53b293f8)). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_12_0_baseline, supported: yes
Checking device support for profile VP_D3D12_FL_12_0_baseline (deviceName=NVIDIA GeForce RTX 3070, driverName=NVIDIA, driverInfo=525.47.24). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_12_0_baseline, supported: yes
Testing profile VP_D3D12_FL_12_0_optimal.
Checking device support for profile VP_D3D12_FL_12_0_optimal (deviceName=AMD Radeon RX 6800 (RADV NAVI21), driverName=radv, driverInfo=Mesa 23.2.0-devel (git-8e53b293f8)). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_12_0_optimal, supported: yes
Checking device support for profile VP_D3D12_FL_12_0_optimal (deviceName=NVIDIA GeForce RTX 3070, driverName=NVIDIA, driverInfo=525.47.24). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_12_0_optimal, supported: yes
Testing profile VP_D3D12_FL_12_1_baseline.
Checking device support for profile VP_D3D12_FL_12_1_baseline (deviceName=AMD Radeon RX 6800 (RADV NAVI21), driverName=radv, driverInfo=Mesa 23.2.0-devel (git-8e53b293f8)). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
Unsupported extension: VK_EXT_fragment_shader_interlock
Unsupported feature condition: VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT::fragmentShaderPixelInterlock == VK_TRUE
Unsupported feature condition: VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT::fragmentShaderSampleInterlock == VK_TRUE
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_12_1_baseline, supported: no
Checking device support for profile VP_D3D12_FL_12_1_baseline (deviceName=NVIDIA GeForce RTX 3070, driverName=NVIDIA, driverInfo=525.47.24). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_12_1_baseline, supported: yes
Testing profile VP_D3D12_FL_12_2_baseline.
Checking device support for profile VP_D3D12_FL_12_2_baseline (deviceName=AMD Radeon RX 6800 (RADV NAVI21), driverName=radv, driverInfo=Mesa 23.2.0-devel (git-8e53b293f8)). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
Unsupported extension: VK_EXT_fragment_shader_interlock
Unsupported feature condition: VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT::fragmentShaderPixelInterlock == VK_TRUE
Unsupported feature condition: VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT::fragmentShaderSampleInterlock == VK_TRUE
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_12_2_baseline, supported: no
Checking device support for profile VP_D3D12_FL_12_2_baseline (deviceName=NVIDIA GeForce RTX 3070, driverName=NVIDIA, driverInfo=525.47.24). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_12_2_baseline, supported: yes
Testing profile VP_D3D12_FL_12_2_optimal.
Checking device support for profile VP_D3D12_FL_12_2_optimal (deviceName=AMD Radeon RX 6800 (RADV NAVI21), driverName=radv, driverInfo=Mesa 23.2.0-devel (git-8e53b293f8)). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
Unsupported extension: VK_EXT_fragment_shader_interlock
Unsupported feature condition: VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT::fragmentShaderPixelInterlock == VK_TRUE
Unsupported feature condition: VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT::fragmentShaderSampleInterlock == VK_TRUE
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_FL_12_2_optimal, supported: no
Checking device support for profile VP_D3D12_FL_12_2_optimal (deviceName=NVIDIA GeForce RTX 3070, driverName=NVIDIA, driverInfo=525.47.24). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_FL_12_2_optimal, supported: yes
Testing profile VP_D3D12_maximum_nv.
Checking device support for profile VP_D3D12_maximum_nv (deviceName=AMD Radeon RX 6800 (RADV NAVI21), driverName=radv, driverInfo=Mesa 23.2.0-devel (git-8e53b293f8)). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
Unsupported extension: VK_EXT_fragment_shader_interlock
Unsupported extension: VK_EXT_pageable_device_local_memory
Unsupported extension: VK_KHR_fragment_shader_barycentric
Unsupported extension: VK_NVX_binary_import
Unsupported extension: VK_NVX_image_view_handle
Unsupported extension: VK_NV_device_diagnostic_checkpoints
Unsupported extension: VK_NV_shader_sm_builtins
Unsupported feature condition: VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT::pageableDeviceLocalMemory == VK_TRUE
Unsupported feature condition: VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR::fragmentShaderBarycentric == VK_TRUE
Unsupported feature condition: VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT::fragmentShaderPixelInterlock == VK_TRUE
Unsupported feature condition: VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT::fragmentShaderSampleInterlock == VK_TRUE
Unsupported properties condition: VkPhysicalDeviceProperties2KHR::properties.vendorID == 4318
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_maximum_nv, supported: no
Checking device support for profile VP_D3D12_maximum_nv (deviceName=NVIDIA GeForce RTX 3070, driverName=NVIDIA, driverInfo=525.47.24). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_maximum_nv, supported: yes
Testing profile VP_D3D12_maximum_radv.
Checking device support for profile VP_D3D12_maximum_radv (deviceName=AMD Radeon RX 6800 (RADV NAVI21), driverName=radv, driverInfo=Mesa 23.2.0-devel (git-8e53b293f8)). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
[RESULT] GPU: AMD Radeon RX 6800 (RADV NAVI21), Profile: VP_D3D12_maximum_radv, supported: yes
Checking device support for profile VP_D3D12_maximum_radv (deviceName=NVIDIA GeForce RTX 3070, driverName=NVIDIA, driverInfo=525.47.24). You may find the details of the capabilities of this device on https://vulkan.gpuinfo.org/
Unsupported extension: VK_AMD_device_coherent_memory
Unsupported extension: VK_AMD_shader_core_properties
Unsupported extension: VK_AMD_shader_core_properties2
Unsupported extension: VK_EXT_shader_stencil_export
Unsupported feature condition: VkPhysicalDeviceCoherentMemoryFeaturesAMD::deviceCoherentMemory == VK_TRUE
Unsupported properties condition: VkPhysicalDeviceProperties2KHR::properties.vendorID == 4098
Unsupported properties condition: VkPhysicalDeviceVulkan12Properties::denormBehaviorIndependence == VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY
Unsupported properties condition: VkPhysicalDeviceVulkan12Properties::shaderDenormFlushToZeroFloat32 contains VK_TRUE
Unsupported properties condition: VkPhysicalDeviceVulkan12Properties::shaderDenormPreserveFloat32 contains VK_TRUE
Unsupported properties condition: VkPhysicalDeviceVulkan12Properties::shaderDenormPreserveFloat64 contains VK_TRUE
[RESULT] GPU: NVIDIA GeForce RTX 3070, Profile: VP_D3D12_maximum_radv, supported: no

Try to align better with profile expectations.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Found during profiles debugging.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Rely on Vulkan 1.2 features here.
Avoids problems with profiles layer since it will expose the EXT even if
we don't declare it, since it was promoted, but enabling the EXT
requires us to enable the features.

Spec says that enabling both features is equivalent to enabling the EXT,
so this should be okay.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Modern Cbuffer layout is required feature.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
We don't fixup interpolation, so this is required.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Check that feature is supported.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
For testing profile behavior, it's useful to be able to verify that we
reject feature levels when features are limited.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
@doitsujin
Copy link
Collaborator

doitsujin commented May 25, 2023

vkd3d: Get rid of VK_EXT_shader_viewport_index_layer.

Spec says that enabling both features is equivalent to enabling the EXT,
so this should be okay.

Does it now? I remember when doing the same for DXVK we'd get validation errors until I also bumped the SPIR-V version.

@HansKristian-Work
Copy link
Owner Author

HansKristian-Work commented May 25, 2023

vkd3d: Get rid of VK_EXT_shader_viewport_index_layer.
Spec says that enabling both features is equivalent to enabling the EXT,
so this should be okay.

Does it now? I remember when doing the same for DXVK we'd get validation errors until I also bumped the SPIR-V version.

It's possible that spec was clarified, but if there's still a VVL error here, that sounds like a VVL bug if anything, but this is explicitly stated in spec.

@@ -2067,6 +2070,13 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
physical_device_info->properties2.properties.sparseProperties.residencyNonResidentStrict = VK_FALSE;
}

/* We need independent interpolation to use GPL. */
if (!physical_device_info->graphics_pipeline_library_properties.graphicsPipelineLibraryIndependentInterpolationDecoration)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required even if we compile FS and all vertex stages into one single library?

Spec wording kind of indicates that it is but I don't know if this is really the intent here, but I guess every driver that supports GPL will want to support this bit anyway.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked for an exception, but there is none. Maybe it should be clarified in spec, but most likely drivers have a separate GPL path where they don't do cross stage stuff, and conditionally adding cross stage linking if all stages are present is slightly unexpected.

@HansKristian-Work HansKristian-Work merged commit 25468e0 into master May 25, 2023
@HansKristian-Work HansKristian-Work deleted the profile branch May 25, 2023 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants