With this, Doom Eternal should now run with ACO on GFX8+.
The generated 8/16-bit storage code is okay but the generated int8/int16
code is currently pretty bad but it works and apparently Doom Eternal
doesn't actually use it (even though it requires it).
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4707>
GL_NV_viewport_swizzle on nvc0 (GM200+).
VK_KHR_shader_non_semantic_info on Intel, RADV.
GL_EXT_draw_instanced on gles2
+VK_KHR_8bit_storage for ACO on GFX8+
+VK_KHR_16bit_storage for ACO on GFX8+ (storageInputOutput16 is still unsupported)
+shaderInt16 for ACO on GFX9+
+VK_KHR_shader_float16_int8 for ACO on GFX8+ (shaderFloat16 is still unsupported)
.shaderCullDistance = true,
.shaderFloat64 = true,
.shaderInt64 = true,
- .shaderInt16 = pdevice->rad_info.chip_class >= GFX9 && !pdevice->use_aco,
+ .shaderInt16 = pdevice->rad_info.chip_class >= GFX9,
.sparseBinding = true,
.variableMultisampleRate = true,
.inheritedQueries = true,
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
VkPhysicalDevice16BitStorageFeatures *features =
(VkPhysicalDevice16BitStorageFeatures*)ext;
- features->storageBuffer16BitAccess = !pdevice->use_aco;
- features->uniformAndStorageBuffer16BitAccess = !pdevice->use_aco;
- features->storagePushConstant16 = !pdevice->use_aco;
+ bool enable = !pdevice->use_aco || pdevice->rad_info.chip_class >= GFX8;
+ features->storageBuffer16BitAccess = enable;
+ features->uniformAndStorageBuffer16BitAccess = enable;
+ features->storagePushConstant16 = enable;
features->storageInputOutput16 = pdevice->rad_info.has_double_rate_fp16 && !pdevice->use_aco && LLVM_VERSION_MAJOR >= 9;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
VkPhysicalDevice8BitStorageFeatures *features =
(VkPhysicalDevice8BitStorageFeatures *)ext;
- features->storageBuffer8BitAccess = !pdevice->use_aco;
- features->uniformAndStorageBuffer8BitAccess = !pdevice->use_aco;
- features->storagePushConstant8 = !pdevice->use_aco;
+ bool enable = !pdevice->use_aco || pdevice->rad_info.chip_class >= GFX8;
+ features->storageBuffer8BitAccess = enable;
+ features->uniformAndStorageBuffer8BitAccess = enable;
+ features->storagePushConstant8 = enable;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
VkPhysicalDeviceShaderFloat16Int8Features *features =
(VkPhysicalDeviceShaderFloat16Int8Features*)ext;
features->shaderFloat16 = pdevice->rad_info.has_double_rate_fp16 && !pdevice->use_aco;
- features->shaderInt8 = !pdevice->use_aco;
+ features->shaderInt8 = !pdevice->use_aco || pdevice->rad_info.chip_class >= GFX8;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
VkPhysicalDeviceVulkan11Features *features =
(VkPhysicalDeviceVulkan11Features *)ext;
- features->storageBuffer16BitAccess = !pdevice->use_aco;
- features->uniformAndStorageBuffer16BitAccess = !pdevice->use_aco;
- features->storagePushConstant16 = !pdevice->use_aco;
+ bool storage16_enable = !pdevice->use_aco || pdevice->rad_info.chip_class >= GFX8;
+ features->storageBuffer16BitAccess = storage16_enable;
+ features->uniformAndStorageBuffer16BitAccess = storage16_enable;
+ features->storagePushConstant16 = storage16_enable;
features->storageInputOutput16 = pdevice->rad_info.has_double_rate_fp16 && !pdevice->use_aco && LLVM_VERSION_MAJOR >= 9;
features->multiview = true;
features->multiviewGeometryShader = true;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
VkPhysicalDeviceVulkan12Features *features =
(VkPhysicalDeviceVulkan12Features *)ext;
+ bool int8_enable = !pdevice->use_aco || pdevice->rad_info.chip_class >= GFX8;
features->samplerMirrorClampToEdge = true;
features->drawIndirectCount = true;
- features->storageBuffer8BitAccess = !pdevice->use_aco;
- features->uniformAndStorageBuffer8BitAccess = !pdevice->use_aco;
- features->storagePushConstant8 = !pdevice->use_aco;
+ features->storageBuffer8BitAccess = int8_enable;
+ features->uniformAndStorageBuffer8BitAccess = int8_enable;
+ features->storagePushConstant8 = int8_enable;
features->shaderBufferInt64Atomics = LLVM_VERSION_MAJOR >= 9;
features->shaderSharedInt64Atomics = LLVM_VERSION_MAJOR >= 9;
features->shaderFloat16 = pdevice->rad_info.has_double_rate_fp16 && !pdevice->use_aco;
- features->shaderInt8 = !pdevice->use_aco;
+ features->shaderInt8 = int8_enable;
features->descriptorIndexing = true;
features->shaderInputAttachmentArrayDynamicIndexing = true;
features->shaderUniformTexelBufferArrayDynamicIndexing = true;
EXTENSIONS = [
Extension('VK_ANDROID_external_memory_android_hardware_buffer', 3, 'RADV_SUPPORT_ANDROID_HARDWARE_BUFFER && device->rad_info.has_syncobj_wait_for_submit'),
Extension('VK_ANDROID_native_buffer', 5, 'ANDROID && device->rad_info.has_syncobj_wait_for_submit'),
- Extension('VK_KHR_16bit_storage', 1, '!device->use_aco'),
+ Extension('VK_KHR_16bit_storage', 1, '!device->use_aco || device->rad_info.chip_class >= GFX8'),
Extension('VK_KHR_bind_memory2', 1, True),
Extension('VK_KHR_buffer_device_address', 1, True),
Extension('VK_KHR_create_renderpass2', 1, True),
Extension('VK_KHR_shader_clock', 1, True),
Extension('VK_KHR_shader_draw_parameters', 1, True),
Extension('VK_KHR_shader_float_controls', 1, True),
- Extension('VK_KHR_shader_float16_int8', 1, '!device->use_aco'),
+ Extension('VK_KHR_shader_float16_int8', 1, '!device->use_aco || device->rad_info.chip_class >= GFX8'),
Extension('VK_KHR_shader_non_semantic_info', 1, True),
Extension('VK_KHR_shader_subgroup_extended_types', 1, '!device->use_aco'),
Extension('VK_KHR_spirv_1_4', 1, True),
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->use_aco'),
+ Extension('VK_KHR_8bit_storage', 1, '!device->use_aco || device->rad_info.chip_class >= GFX8'),
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),
for ext in EXTENSIONS:
if ext.type == 'device':
+ ext.enable = '(' + ext.enable + ')'
for dep in extra_deps(ext):
ext.enable += ' && ' + dep
}
}
}
+ bool int8_int16_enable = !device->physical_device->use_aco ||
+ device->physical_device->rad_info.chip_class >= GFX8;
const struct spirv_to_nir_options spirv_options = {
.lower_ubo_ssbo_access_to_offsets = true,
.caps = {
.image_ms_array = true,
.image_read_without_format = true,
.image_write_without_format = true,
- .int8 = !device->physical_device->use_aco,
- .int16 = !device->physical_device->use_aco,
+ .int8 = int8_int16_enable,
+ .int16 = int8_int16_enable,
.int64 = true,
.int64_atomics = true,
.multiview = true,
.shader_clock = true,
.shader_viewport_index_layer = true,
.stencil_export = true,
- .storage_8bit = !device->physical_device->use_aco,
- .storage_16bit = !device->physical_device->use_aco,
+ .storage_8bit = int8_int16_enable,
+ .storage_16bit = int8_int16_enable,
.storage_image_ms = true,
.subgroup_arithmetic = true,
.subgroup_ballot = true,