radv: enable VK_KHR_8bit_storage
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 6 Dec 2018 13:33:48 +0000 (13:33 +0000)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 21 Mar 2019 08:02:27 +0000 (09:02 +0100)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
docs/features.txt
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_extensions.py
src/amd/vulkan/radv_shader.c

index 6c2b6d59377370427693e47c876492d65f1f6b12..ded753b0182d1b6469df3886d8023bf94a1aa82a 100644 (file)
@@ -439,7 +439,7 @@ Vulkan 1.1 -- all DONE: anv, radv
   VK_KHR_variable_pointers                              DONE (anv, radv)
 
 Khronos extensions that are not part of any Vulkan version:
-  VK_KHR_8bit_storage                                   DONE (anv)
+  VK_KHR_8bit_storage                                   DONE (anv, radv)
   VK_KHR_android_surface                                not started
   VK_KHR_create_renderpass2                             DONE (anv, radv)
   VK_KHR_display                                        DONE (anv, radv)
index 5a54c5842abaee170ca55d847d5ccb2f4d5c7657..433b8542029f0e3202428cb3e015eb1b7a675a3a 100644 (file)
@@ -895,6 +895,15 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->hostQueryReset = true;
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR: {
+                       VkPhysicalDevice8BitStorageFeaturesKHR *features =
+                           (VkPhysicalDevice8BitStorageFeaturesKHR*)ext;
+                       bool enabled = pdevice->rad_info.chip_class >= VI;
+                       features->storageBuffer8BitAccess = enabled;
+                       features->uniformAndStorageBuffer8BitAccess = enabled;
+                       features->storagePushConstant8 = enabled;
+                       break;
+               }
                default:
                        break;
                }
index 88d5780fe8d4c712e5dedbff132dcd07bdd3691f..421f8b926ea817d6c582d6901349a50e40967fed 100644 (file)
@@ -92,6 +92,7 @@ EXTENSIONS = [
     Extension('VK_KHR_xlib_surface',                      6, 'VK_USE_PLATFORM_XLIB_KHR'),
     Extension('VK_KHR_multiview',                         1, True),
     Extension('VK_KHR_display',                          23, 'VK_USE_PLATFORM_DISPLAY_KHR'),
+    Extension('VK_KHR_8bit_storage',                      1, 'device->rad_info.chip_class >= VI'),
     Extension('VK_EXT_direct_mode_display',               1, 'VK_USE_PLATFORM_DISPLAY_KHR'),
     Extension('VK_EXT_acquire_xlib_display',              1, 'VK_USE_PLATFORM_XLIB_XRANDR_EXT'),
     Extension('VK_EXT_buffer_device_address',             1, True),
index a1612c829b89d0542361b7caad357ec62e4134d8..eecbc6ae7599afe848bebafc5fa903522a379b53 100644 (file)
@@ -249,6 +249,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
                                .transform_feedback = true,
                                .trinary_minmax = true,
                                .variable_pointers = true,
+                               .storage_8bit = true,
                        },
                        .ubo_ptr_type = glsl_vector_type(GLSL_TYPE_UINT, 2),
                        .ssbo_ptr_type = glsl_vector_type(GLSL_TYPE_UINT, 2),