turnip: implement VK_KHR_buffer_device_address
We don't advertise bufferDeviceAddressCaptureReplay capability and neither does blob, because at the moment there is no way to allocate bo with predefined iova. There is no support of any arithmetic with addresses since shaderInt64 is not enabled. However, we could enable int64 support whenever we want. Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8717>
This commit is contained in:
committed by
Marge Bot
parent
99388f0c27
commit
d5757c965a
@@ -156,6 +156,7 @@ get_device_extensions(const struct tu_physical_device *device,
|
||||
.KHR_vulkan_memory_model = true,
|
||||
.KHR_driver_properties = true,
|
||||
.KHR_separate_depth_stencil_layouts = true,
|
||||
.KHR_buffer_device_address = true,
|
||||
#ifndef TU_USE_KGSL
|
||||
.KHR_timeline_semaphore = true,
|
||||
#endif
|
||||
@@ -560,7 +561,7 @@ tu_get_physical_device_features_1_2(struct tu_physical_device *pdevice,
|
||||
features->separateDepthStencilLayouts = true;
|
||||
features->hostQueryReset = true;
|
||||
features->timelineSemaphore = true;
|
||||
features->bufferDeviceAddress = false;
|
||||
features->bufferDeviceAddress = true;
|
||||
features->bufferDeviceAddressCaptureReplay = false;
|
||||
features->bufferDeviceAddressMultiDevice = false;
|
||||
features->vulkanMemoryModel = true;
|
||||
@@ -2574,8 +2575,9 @@ VkDeviceAddress
|
||||
tu_GetBufferDeviceAddress(VkDevice _device,
|
||||
const VkBufferDeviceAddressInfoKHR* pInfo)
|
||||
{
|
||||
tu_stub();
|
||||
return 0;
|
||||
TU_FROM_HANDLE(tu_buffer, buffer, pInfo->buffer);
|
||||
|
||||
return tu_buffer_iova(buffer);
|
||||
}
|
||||
|
||||
uint64_t tu_GetBufferOpaqueCaptureAddress(
|
||||
|
||||
@@ -81,6 +81,7 @@ tu_spirv_to_nir(struct tu_device *dev,
|
||||
.subgroup_basic = true,
|
||||
.subgroup_ballot = true,
|
||||
.subgroup_vote = true,
|
||||
.physical_storage_buffer_address = true,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -749,6 +750,10 @@ tu_shader_create(struct tu_device *dev,
|
||||
nir_var_mem_ubo | nir_var_mem_ssbo,
|
||||
nir_address_format_vec2_index_32bit_offset);
|
||||
|
||||
NIR_PASS_V(nir, nir_lower_explicit_io,
|
||||
nir_var_mem_global,
|
||||
nir_address_format_64bit_global);
|
||||
|
||||
if (nir->info.stage == MESA_SHADER_COMPUTE) {
|
||||
NIR_PASS_V(nir, nir_lower_vars_to_explicit_types,
|
||||
nir_var_mem_shared, shared_type_info);
|
||||
|
||||
Reference in New Issue
Block a user