v3dv: expose KHR_variable_pointers

We only support the VariablePointersStorageBuffer feature for now,
which is the only one that is mandatory, and for which we seem to
be passing all the relevant tests already.

Exposing the optional VariablePointers feature would require that
we support non-constant indexing on UBO/SSBO first.

Relevant CTS tests:
dEQP-VK.*pointer*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11257>
This commit is contained in:
Iago Toral Quiroga 2021-06-08 11:05:36 +02:00 committed by Marge Bot
parent f05dfddeb1
commit d84cd611eb
3 changed files with 12 additions and 2 deletions

View File

@ -443,7 +443,7 @@ Vulkan 1.1 -- all DONE: anv, lvp, radv, tu, vn
VK_KHR_sampler_ycbcr_conversion DONE (anv, radv, tu, vn)
VK_KHR_shader_draw_parameters DONE (anv, lvp, radv, tu, vn)
VK_KHR_storage_buffer_storage_class DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_variable_pointers DONE (anv, lvp, radv, tu, vn)
VK_KHR_variable_pointers DONE (anv, lvp, radv, tu, v3dv, vn)
Vulkan 1.2 -- all DONE: anv, vn

View File

@ -125,6 +125,7 @@ get_device_extensions(const struct v3dv_physical_device *device,
#ifdef V3DV_HAS_SURFACE
.KHR_swapchain = true,
#endif
.KHR_variable_pointers = true,
.EXT_external_memory_dma_buf = true,
.EXT_private_data = true,
};
@ -1012,7 +1013,15 @@ v3dv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
features->privateData = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
VkPhysicalDeviceVariablePointersFeatures *features = (void *) ext;
features->variablePointersStorageBuffer = true;
/* FIXME: for this we need to support non-constant indexing on
* UBO/SSBO.
*/
features->variablePointers = false;
break;
}
default:
v3dv_debug_ignored_stype(ext->sType);
break;

View File

@ -174,6 +174,7 @@ v3dv_DestroyPipeline(VkDevice _device,
static const struct spirv_to_nir_options default_spirv_options = {
.caps = {
.device_group = true,
.variable_pointers = true,
},
.ubo_addr_format = nir_address_format_32bit_index_offset,
.ssbo_addr_format = nir_address_format_32bit_index_offset,