tu: Support VK_KHR_ray_query

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28447>
This commit is contained in:
Connor Abbott 2024-03-28 09:11:04 -04:00 committed by Marge Bot
parent 671e3a65a6
commit 36e46b4ada
6 changed files with 1058 additions and 1 deletions

View file

@ -554,7 +554,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_KHR_pipeline_executable_properties DONE (anv, nvk, panvk, hasvk, radv, tu, v3dv)
VK_KHR_pipeline_library DONE (anv, lvp, nvk, panvk, radv, tu, vn)
VK_KHR_present_wait DONE (anv, nvk, radv, tu, x11/display)
VK_KHR_ray_query DONE (anv/gfx12.5+, lvp, radv/gfx10.3+)
VK_KHR_ray_query DONE (anv/gfx12.5+, lvp, radv/gfx10.3+, tu/a740+)
VK_KHR_ray_tracing_maintenance1 DONE (anv/gfx12.5+, radv/gfx10.3+)
VK_KHR_ray_tracing_pipeline DONE (anv/gfx12.5+, lvp, radv/gfx10.3+)
VK_KHR_ray_tracing_position_fetch DONE (anv, radv/gfx10.3+)

View file

@ -39,6 +39,7 @@ libtu_files = files(
'tu_knl.cc',
'tu_lrz.cc',
'tu_nir_lower_multiview.cc',
'tu_nir_lower_ray_query.cc',
'tu_pass.cc',
'tu_pipeline.cc',
'tu_sampler.cc',

View file

@ -213,6 +213,7 @@ get_device_extensions(const struct tu_physical_device *device,
wsi_common_vk_instance_supports_present_wait(&device->instance->vk)),
#endif
.KHR_push_descriptor = true,
.KHR_ray_query = has_raytracing,
.KHR_relaxed_block_layout = true,
.KHR_sampler_mirror_clamp_to_edge = true,
.KHR_sampler_ycbcr_conversion = true,
@ -695,6 +696,9 @@ tu_get_features(struct tu_physical_device *pdevice,
features->rasterizationOrderDepthAttachmentAccess = true;
features->rasterizationOrderStencilAttachmentAccess = true;
/* VK_KHR_ray_query */
features->rayQuery = true;
/* VK_EXT_robustness2 */
features->robustBufferAccess2 = true;
features->robustImageAccess2 = true;

File diff suppressed because it is too large Load diff

View file

@ -110,6 +110,14 @@ tu_spirv_to_nir(struct tu_device *dev,
NIR_PASS_V(nir, nir_opt_copy_prop_vars);
NIR_PASS_V(nir, nir_opt_dce);
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
if (nir->info.ray_queries > 0) {
NIR_PASS(_, nir, nir_opt_ray_queries);
NIR_PASS(_, nir, nir_opt_ray_query_ranges);
NIR_PASS(_, nir, tu_nir_lower_ray_queries);
}
NIR_PASS_V(nir, nir_split_var_copies);
NIR_PASS_V(nir, nir_lower_var_copies);

View file

@ -119,6 +119,9 @@ extern const struct vk_pipeline_cache_object_ops tu_shader_ops;
bool
tu_nir_lower_multiview(nir_shader *nir, uint32_t mask, struct tu_device *dev);
bool
tu_nir_lower_ray_queries(nir_shader *nir);
nir_shader *
tu_spirv_to_nir(struct tu_device *dev,
void *mem_ctx,