radv: implement VK_KHR_shader_clock
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 7 Oct 2019 08:26:22 +0000 (10:26 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 9 Oct 2019 06:43:14 +0000 (08:43 +0200)
NIR->LLVM and ACO already support nir_intrinsic_shader_clock.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
docs/relnotes/new_features.txt
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_extensions.py
src/amd/vulkan/radv_shader.c

index 19a958ae4a34b2d8064433fc009d0117d3fe3993..f51a9669bad897b8ad406404cf7a94adb25825e1 100644 (file)
@@ -2,7 +2,7 @@ GL_ARB_gl_spirv on i965, iris.
 GL_ARB_spirv_extensions on i965, iris.
 GL_EXT_demote_to_helper_invocation on iris, i965.
 OpenGL 4.6 on i965, iris.
-VK_KHR_shader_clock on Intel.
+VK_KHR_shader_clock on Intel, RADV.
 VK_KHR_shader_float_controls on Intel.
 VK_EXT_shader_subgroup_ballot on Intel.
 VK_EXT_shader_subgroup_vote on Intel.
index 8965530ef28f91a85f9b6ff95244bdb18adc5793..efd3eb394179933d3d12766b6191251e92204b8f 100644 (file)
@@ -1063,6 +1063,13 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->pipelineExecutableInfo = true;
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+                       VkPhysicalDeviceShaderClockFeaturesKHR *features =
+                               (VkPhysicalDeviceShaderClockFeaturesKHR *)ext;
+                       features->shaderSubgroupClock = true;
+                       features->shaderDeviceClock = false;
+                       break;
+               }
                default:
                        break;
                }
index 068ca89ade9c2081ac8cf177e3c683bfffbf2634..14d139d60b416e8d26e6b309c3f27029f1f866d5 100644 (file)
@@ -86,6 +86,7 @@ EXTENSIONS = [
     Extension('VK_KHR_sampler_mirror_clamp_to_edge',      1, True),
     Extension('VK_KHR_sampler_ycbcr_conversion',          1, True),
     Extension('VK_KHR_shader_atomic_int64',               1, 'LLVM_VERSION_MAJOR >= 9'),
+    Extension('VK_KHR_shader_clock',                      1, True),
     Extension('VK_KHR_shader_draw_parameters',            1, True),
     Extension('VK_KHR_shader_float16_int8',               1, '!device->use_aco'),
     Extension('VK_KHR_storage_buffer_storage_class',      1, True),
index ee37c06b8caba0289b2012e06d11bc6151ef8a50..91e22c9d68f810f88b860851d581fc35869e51a3 100644 (file)
@@ -357,6 +357,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
                                .physical_storage_buffer_address = true,
                                .post_depth_coverage = true,
                                .runtime_descriptor_array = true,
+                               .shader_clock = true,
                                .shader_viewport_index_layer = true,
                                .stencil_export = true,
                                .storage_8bit = !device->physical_device->use_aco,