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

Method clear_buffer

src/utils/impl_task_graph.cpp:1103–1123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1101 }
1102
1103 void TaskGraph::clear_buffer(TaskBufferClearInfo const & info)
1104 {
1105 ImplTaskGraph & impl = *reinterpret_cast<ImplTaskGraph *>(this->object);
1106
1107 auto const view = validate_and_translate_view(impl, info.buffer);
1108
1109 auto name = info.name.size() > 0 ? std::string(info.name) : std::string("clear buffer: ") + std::string(impl.resources[view.index].name);
1110
1111 TaskBufferClearInfo cinfo = info;
1112 add_task(InlineTask::Transfer(name).writes(view).uses_queue(info.queue).executes([=](TaskInterface ti)
1113 {
1114 auto actual_size = ti.info(TaskBufferAttachmentIndex{0}).value().size;
1115 DAXA_DBG_ASSERT_TRUE_M(cinfo.offset < actual_size, "clear buffer offset must be smaller then actual buffer size");
1116 auto size = std::min(actual_size, cinfo.size) - cinfo.offset;
1117 ti.recorder.clear_buffer(BufferClearInfo{
1118 .buffer = ti.get(TaskBufferAttachmentIndex{0}).id,
1119 .offset = cinfo.offset,
1120 .size = size,
1121 .clear_value = cinfo.clear_value,
1122 }); }));
1123 }
1124
1125 void TaskGraph::clear_image(TaskImageClearInfo const & info)
1126 {

Callers 3

executeMethod · 0.80
record_sim_task_graphFunction · 0.80

Calls 7

executesMethod · 0.80
sizeMethod · 0.45
writesMethod · 0.45
valueMethod · 0.45
infoMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected