| 725 | } |
| 726 | |
| 727 | auto daxa_cmd_trace_rays(daxa_CommandRecorder self, daxa_TraceRaysInfo const * info) -> daxa_Result |
| 728 | { |
| 729 | DAXA_CHECK_UNCOMPLETED(self) |
| 730 | daxa_Result result = DAXA_RESULT_SUCCESS; |
| 731 | result = validate_queue_type(self->info.queue_type, DAXA_QUEUE_TYPE_COMPUTE); |
| 732 | _DAXA_RETURN_IF_ERROR(result, result); |
| 733 | // TODO: Check if those offsets are in range? |
| 734 | if (!daxa::holds_alternative<daxa_RayTracingPipeline>(self->current_pipeline)) |
| 735 | { |
| 736 | _DAXA_RETURN_IF_ERROR(DAXA_RESULT_NO_RAYTRACING_PIPELINE_SET, DAXA_RESULT_NO_RAYTRACING_PIPELINE_SET); |
| 737 | } |
| 738 | auto const & binding_table = info->shader_binding_table; |
| 739 | auto raygen_handle = binding_table.raygen_region; |
| 740 | raygen_handle.deviceAddress += binding_table.raygen_region.stride * info->raygen_handle_offset; |
| 741 | auto miss_handle = binding_table.miss_region; |
| 742 | miss_handle.deviceAddress += binding_table.miss_region.stride * info->miss_handle_offset; |
| 743 | auto hit_handle = binding_table.hit_region; |
| 744 | hit_handle.deviceAddress += binding_table.hit_region.stride * info->hit_handle_offset; |
| 745 | auto call_handle = binding_table.callable_region; |
| 746 | call_handle.deviceAddress += binding_table.callable_region.stride * info->callable_handle_offset; |
| 747 | self->device->vkCmdTraceRaysKHR( |
| 748 | self->command_arena->vk_command_buffer, |
| 749 | &raygen_handle, |
| 750 | &miss_handle, |
| 751 | &hit_handle, |
| 752 | &call_handle, |
| 753 | info->width, info->height, info->depth); |
| 754 | return DAXA_RESULT_SUCCESS; |
| 755 | } |
| 756 | |
| 757 | auto daxa_cmd_trace_rays_indirect(daxa_CommandRecorder self, daxa_TraceRaysIndirectInfo const * info) -> daxa_Result |
| 758 | { |
nothing calls this directly
no test coverage detected