dzn: Add a driconf entry for enabling 8bit loads and stores
authorJesse Natalie <jenatali@microsoft.com>
Fri, 27 Jan 2023 21:05:33 +0000 (13:05 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 6 Apr 2023 22:08:28 +0000 (22:08 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>

src/microsoft/vulkan/dzn_device.c
src/util/00-mesa-defaults.conf
src/util/driconf.h

index b09622b..1ad89cd 100644 (file)
@@ -387,6 +387,9 @@ dzn_physical_device_create(struct vk_instance *instance,
    }
 
    dzn_physical_device_get_extensions(pdev);
+   if (driQueryOptionb(&dzn_instance->dri_options, "dzn_enable_8bit_loads_stores") &&
+       pdev->options4.Native16BitShaderOpsSupported)
+      pdev->vk.supported_extensions.KHR_8bit_storage = true;
 
    return VK_SUCCESS;
 }
@@ -1132,6 +1135,7 @@ dzn_enumerate_physical_devices(struct vk_instance *instance)
 static const driOptionDescription dzn_dri_options[] = {
    DRI_CONF_SECTION_DEBUG
       DRI_CONF_DZN_CLAIM_WIDE_LINES(false)
+      DRI_CONF_DZN_ENABLE_8BIT_LOADS_STORES(false)
    DRI_CONF_SECTION_END
 };
 
@@ -1383,17 +1387,19 @@ dzn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
    };
 
    bool support_descriptor_indexing = pdev->shader_model >= D3D_SHADER_MODEL_6_6;
+   bool support_8bit = driQueryOptionb(&instance->dri_options, "dzn_enable_8bit_loads_stores") &&
+      pdev->options4.Native16BitShaderOpsSupported;
    const VkPhysicalDeviceVulkan12Features core_1_2 = {
       .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES,
       .samplerMirrorClampToEdge           = false,
       .drawIndirectCount                  = true,
-      .storageBuffer8BitAccess            = false,
-      .uniformAndStorageBuffer8BitAccess  = false,
-      .storagePushConstant8               = false,
+      .storageBuffer8BitAccess            = support_8bit,
+      .uniformAndStorageBuffer8BitAccess  = support_8bit,
+      .storagePushConstant8               = support_8bit,
       .shaderBufferInt64Atomics           = false,
       .shaderSharedInt64Atomics           = false,
       .shaderFloat16                      = pdev->options4.Native16BitShaderOpsSupported,
-      .shaderInt8                         = false,
+      .shaderInt8                         = support_8bit,
 
       .descriptorIndexing                                   = support_descriptor_indexing,
       .shaderInputAttachmentArrayDynamicIndexing            = true,
index ffae6b9..3452f16 100644 (file)
@@ -1041,6 +1041,10 @@ TODO: document the other workarounds.
         </engine>
     </device>
     <device driver="dzn">
+        <application name="DOOMEternal" executable="DOOMEternalx64vk.exe">
+            <option name="dzn_enable_8bit_loads_stores" value="true" />
+            <option name="dzn_claim_wide_lines" value="true" />
+        </application>
         <application name="No Man's Sky" executable="NMS.exe">
             <option name="dzn_claim_wide_lines" value="true" />
         </application>
index fecff85..83b2533 100644 (file)
 #define DRI_CONF_DZN_CLAIM_WIDE_LINES(def) \
    DRI_CONF_OPT_B(dzn_claim_wide_lines, def, "Claim wide line support")
 
+#define DRI_CONF_DZN_ENABLE_8BIT_LOADS_STORES(def) \
+   DRI_CONF_OPT_B(dzn_enable_8bit_loads_stores, def, "Enable VK_KHR_8bit_loads_stores")
+
 #endif