| 1147 | } |
| 1148 | |
| 1149 | void TaskGraph::copy_buffer_to_buffer(TaskBufferCopyInfo const & info) |
| 1150 | { |
| 1151 | ImplTaskGraph & impl = *reinterpret_cast<ImplTaskGraph *>(this->object); |
| 1152 | auto src = validate_and_translate_view(impl, info.src_buffer); |
| 1153 | auto dst = validate_and_translate_view(impl, info.dst_buffer); |
| 1154 | |
| 1155 | auto src_i = TaskBufferAttachmentIndex{0}; |
| 1156 | auto dst_i = TaskBufferAttachmentIndex{1}; |
| 1157 | |
| 1158 | auto name = info.name.size() > 0 ? std::string(info.name) : std::string("copy ") + std::string(impl.resources[src.index].name) + " to " + std::string(impl.resources[dst.index].name); |
| 1159 | |
| 1160 | add_task( |
| 1161 | InlineTask::Transfer(name) |
| 1162 | .reads(src) |
| 1163 | .writes(dst) |
| 1164 | .uses_queue(info.queue) |
| 1165 | .executes( |
| 1166 | [=](TaskInterface ti) |
| 1167 | { |
| 1168 | DAXA_DBG_ASSERT_TRUE_M(ti.info(src_i).value().size == ti.info(dst_i).value().size, "given src and dst must have the same size"); |
| 1169 | ti.recorder.copy_buffer_to_buffer(BufferCopyInfo{ |
| 1170 | .src_buffer = ti.get(src_i).id, |
| 1171 | .dst_buffer = ti.get(src_i).id, |
| 1172 | .size = ti.info(src_i).value().size, |
| 1173 | }); |
| 1174 | })); |
| 1175 | } |
| 1176 | |
| 1177 | void TaskGraph::copy_image_to_image(TaskImageCopyInfo const & info) |
| 1178 | { |
no test coverage detected