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

Author: Faith Ekstrand <faith.ekstr...@collabora.com>
Date:   Thu Nov 23 11:12:03 2023 -0600

nvk: Enable 8 and 16-bit integer types

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26348>

---

 docs/features.txt                        |  4 ++--
 src/nouveau/vulkan/nvk_physical_device.c | 12 +++++++++++-
 src/nouveau/vulkan/nvk_shader.c          |  4 ++++
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/docs/features.txt b/docs/features.txt
index 1a80192d55c..2f502a661d7 100644
--- a/docs/features.txt
+++ b/docs/features.txt
@@ -422,7 +422,7 @@ Vulkan 1.0 -- all DONE: anv, dzn, lvp, nvk, radv, tu, v3dv, 
vn
 
 Vulkan 1.1 -- all DONE: anv, lvp, radv, tu, vn
 
-  VK_KHR_16bit_storage                                  DONE (anv/gen8+, dzn, 
hasvk, lvp, radv, tu/a650, v3dv, vn)
+  VK_KHR_16bit_storage                                  DONE (anv/gen8+, dzn, 
hasvk, lvp, nvk, radv, tu/a650, v3dv, vn)
   VK_KHR_bind_memory2                                   DONE (anv, dzn, hasvk, 
lvp, nvk, pvr, radv, tu, v3dv, vn)
   VK_KHR_dedicated_allocation                           DONE (anv, dzn, hasvk, 
lvp, nvk, radv, tu, v3dv, vn)
   VK_KHR_descriptor_update_template                     DONE (anv, dzn, hasvk, 
lvp, nvk, panvk, radv, tu, v3dv, vn)
@@ -448,7 +448,7 @@ Vulkan 1.1 -- all DONE: anv, lvp, radv, tu, vn
 
 Vulkan 1.2 -- all DONE: anv, tu, vn
 
-  VK_KHR_8bit_storage                                   DONE (anv/gen8+, dzn, 
hasvk, lvp, radv, v3dv, vn)
+  VK_KHR_8bit_storage                                   DONE (anv/gen8+, dzn, 
hasvk, lvp, nvk, radv, v3dv, vn)
   VK_KHR_buffer_device_address                          DONE (anv/gen8+, 
hasvk, lvp, nvk, radv, tu, v3dv, vn)
   VK_KHR_create_renderpass2                             DONE (anv, dzn, hasvk, 
lvp, nvk, radv, tu, v3dv, vn)
   VK_KHR_depth_stencil_resolve                          DONE (anv, dzn, hasvk, 
lvp, nvk, radv, tu, v3dv, vn)
diff --git a/src/nouveau/vulkan/nvk_physical_device.c 
b/src/nouveau/vulkan/nvk_physical_device.c
index 1817f04b67c..0fc3ccc213f 100644
--- a/src/nouveau/vulkan/nvk_physical_device.c
+++ b/src/nouveau/vulkan/nvk_physical_device.c
@@ -75,6 +75,8 @@ nvk_get_device_extensions(const struct nv_device_info *info,
                           struct vk_device_extension_table *ext)
 {
    *ext = (struct vk_device_extension_table) {
+      .KHR_8bit_storage = true,
+      .KHR_16bit_storage = true,
       .KHR_bind_memory2 = true,
       .KHR_buffer_device_address = true,
       .KHR_copy_commands2 = true,
@@ -112,6 +114,7 @@ nvk_get_device_extensions(const struct nv_device_info *info,
       .KHR_separate_depth_stencil_layouts = true,
       .KHR_shader_clock = true,
       .KHR_shader_draw_parameters = true,
+      .KHR_shader_float16_int8 = true,
       .KHR_shader_non_semantic_info = true,
       .KHR_shader_terminate_invocation =
          (nvk_nak_stages(info) & VK_SHADER_STAGE_FRAGMENT_BIT) != 0,
@@ -220,7 +223,7 @@ nvk_get_device_features(const struct nv_device_info *info,
       .shaderCullDistance = true,
       /* TODO: shaderFloat64 */
       /* TODO: shaderInt64 */
-      /* TODO: shaderInt16 */
+      .shaderInt16 = true,
       /* TODO: shaderResourceResidency */
       .shaderResourceMinLod = true,
       .sparseBinding = true,
@@ -231,6 +234,9 @@ nvk_get_device_features(const struct nv_device_info *info,
       .inheritedQueries = true,
 
       /* Vulkan 1.1 */
+      .storageBuffer16BitAccess = true,
+      .uniformAndStorageBuffer16BitAccess = true,
+      .storagePushConstant16 = true,
       .multiview = true,
       .multiviewGeometryShader = true,
       .multiviewTessellationShader = true,
@@ -243,6 +249,10 @@ nvk_get_device_features(const struct nv_device_info *info,
       .samplerMirrorClampToEdge = true,
       .descriptorIndexing = true,
       .drawIndirectCount = info->cls_eng3d >= TURING_A,
+      .storageBuffer8BitAccess = true,
+      .uniformAndStorageBuffer8BitAccess = true,
+      .storagePushConstant8 = true,
+      .shaderInt8 = true,
       .shaderInputAttachmentArrayDynamicIndexing = true,
       .shaderUniformTexelBufferArrayDynamicIndexing = true,
       .shaderStorageTexelBufferArrayDynamicIndexing = true,
diff --git a/src/nouveau/vulkan/nvk_shader.c b/src/nouveau/vulkan/nvk_shader.c
index f1667fdecb3..97b206147d7 100644
--- a/src/nouveau/vulkan/nvk_shader.c
+++ b/src/nouveau/vulkan/nvk_shader.c
@@ -144,12 +144,16 @@ nvk_physical_device_spirv_options(const struct 
nvk_physical_device *pdev,
          .geometry_streams = true,
          .image_read_without_format = true,
          .image_write_without_format = true,
+         .int8 = true,
+         .int16 = true,
          .min_lod = true,
          .multiview = true,
          .physical_storage_buffer_address = true,
          .runtime_descriptor_array = true,
          .shader_clock = true,
          .shader_viewport_index_layer = true,
+         .storage_8bit = true,
+         .storage_16bit = true,
          .subgroup_arithmetic = true,
          .subgroup_ballot = true,
          .subgroup_basic = true,

Reply via email to