Module: Mesa
Branch: main
Commit: e145912654dee5ce0ff989db3c02750bca23142e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e145912654dee5ce0ff989db3c02750bca23142e

Author: Dave Airlie <[email protected]>
Date:   Tue Apr  6 11:27:07 2021 +1000

lavapipe: enable shader clock

Reviewed-by: Mike Blumenkrantz <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17868>

---

 docs/features.txt                             | 2 +-
 docs/relnotes/new_features.txt                | 1 +
 src/gallium/frontends/lavapipe/lvp_device.c   | 8 ++++++++
 src/gallium/frontends/lavapipe/lvp_pipeline.c | 1 +
 4 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/docs/features.txt b/docs/features.txt
index 9a4a4cce1ff..9433b2cbd45 100644
--- a/docs/features.txt
+++ b/docs/features.txt
@@ -516,7 +516,7 @@ Khronos extensions that are not part of any Vulkan version:
   VK_KHR_push_descriptor                                DONE (anv, lvp, radv, 
tu)
   VK_KHR_ray_query                                      in progress
   VK_KHR_ray_tracing_pipeline                           in progress
-  VK_KHR_shader_clock                                   DONE (anv, radv)
+  VK_KHR_shader_clock                                   DONE (anv, lvp, radv)
   VK_KHR_shader_integer_dot_product                     DONE (anv, radv, tu)
   VK_KHR_shader_subgroup_uniform_control_flow           DONE (anv, radv)
   VK_KHR_shared_presentable_image                       not started
diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt
index 446ffefd274..485571c4a7f 100644
--- a/docs/relnotes/new_features.txt
+++ b/docs/relnotes/new_features.txt
@@ -1 +1,2 @@
 GL_ARB_shader_clock on llvmpipe
+VK_KHR_shader_clock on lavapipe
diff --git a/src/gallium/frontends/lavapipe/lvp_device.c 
b/src/gallium/frontends/lavapipe/lvp_device.c
index 1abbe385599..38a43ad7e2c 100644
--- a/src/gallium/frontends/lavapipe/lvp_device.c
+++ b/src/gallium/frontends/lavapipe/lvp_device.c
@@ -122,6 +122,7 @@ static const struct vk_device_extension_table 
lvp_device_extensions_supported =
    .KHR_sampler_mirror_clamp_to_edge      = true,
    .KHR_separate_depth_stencil_layouts    = true,
    .KHR_shader_atomic_int64               = true,
+   .KHR_shader_clock                      = true,
    .KHR_shader_draw_parameters            = true,
    .KHR_shader_float16_int8               = true,
    .KHR_shader_integer_dot_product        = true,
@@ -861,6 +862,13 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceFeatures2(
          features->shaderZeroInitializeWorkgroupMemory = true;
          break;
       }
+      case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+         VkPhysicalDeviceShaderClockFeaturesKHR *features =
+            (VkPhysicalDeviceShaderClockFeaturesKHR *)ext;
+         features->shaderSubgroupClock = true;
+         features->shaderDeviceClock = true;
+         break;
+      }
       case 
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
          VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *features =
             (VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *)ext;
diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c 
b/src/gallium/frontends/lavapipe/lvp_pipeline.c
index 4c4e410df11..62a3191c27c 100644
--- a/src/gallium/frontends/lavapipe/lvp_pipeline.c
+++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c
@@ -411,6 +411,7 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline,
          .device_group = true,
          .draw_parameters = true,
          .shader_viewport_index_layer = true,
+         .shader_clock = true,
          .multiview = true,
          .physical_storage_buffer_address = true,
          .int64_atomics = true,

Reply via email to