MCPcopy Create free account
hub / github.com/Ipotrick/Daxa / daxa_cmd_clear_buffer

Function daxa_cmd_clear_buffer

src/impl_command_recorder.cpp:442–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442auto daxa_cmd_clear_buffer(daxa_CommandRecorder self, daxa_BufferClearInfo const * info) -> daxa_Result
443{
444 DAXA_CHECK_UNCOMPLETED(self)
445 daxa_cmd_flush_barriers(self);
446 DAXA_CHECK_AND_REMEMBER_IDS(self, info->buffer)
447 ImplBufferSlot const & dst_slot = self->device->slot(info->buffer);
448 bool const in_bounds = ((static_cast<u64>(info->offset) + static_cast<u64>(info->size)) <= static_cast<u64>(dst_slot.info.size));
449 if (!in_bounds)
450 {
451 _DAXA_RETURN_IF_ERROR(DAXA_RESULT_ERROR_COPY_OUT_OF_BOUNDS, DAXA_RESULT_ERROR_COPY_OUT_OF_BOUNDS);
452 }
453 vkCmdFillBuffer(
454 self->command_arena->vk_command_buffer,
455 self->device->hot_slot(info->buffer).vk_buffer,
456 static_cast<VkDeviceSize>(info->offset),
457 static_cast<VkDeviceSize>(info->size),
458 info->clear_value);
459 return DAXA_RESULT_SUCCESS;
460}
461
462auto daxa_cmd_clear_image(daxa_CommandRecorder self, daxa_ImageClearInfo const * info) -> daxa_Result
463{

Callers

nothing calls this directly

Calls 3

daxa_cmd_flush_barriersFunction · 0.85
slotMethod · 0.80
hot_slotMethod · 0.80

Tested by

no test coverage detected