| 1649 | } |
| 1650 | |
| 1651 | void RenderingDeviceGraph::add_buffer_copy(RDD::BufferID p_src, ResourceTracker *p_src_tracker, RDD::BufferID p_dst, ResourceTracker *p_dst_tracker, RDD::BufferCopyRegion p_region) { |
| 1652 | // Source tracker is allowed to be null as it could be a read-only buffer. |
| 1653 | DEV_ASSERT(p_dst_tracker != nullptr); |
| 1654 | |
| 1655 | int32_t command_index; |
| 1656 | RecordedBufferCopyCommand *command = static_cast<RecordedBufferCopyCommand *>(_allocate_command(sizeof(RecordedBufferCopyCommand), command_index)); |
| 1657 | command->type = RecordedCommand::TYPE_BUFFER_COPY; |
| 1658 | command->self_stages = RDD::PIPELINE_STAGE_COPY_BIT; |
| 1659 | command->source = p_src; |
| 1660 | command->destination = p_dst; |
| 1661 | command->region = p_region; |
| 1662 | |
| 1663 | ResourceTracker *trackers[2] = { p_dst_tracker, p_src_tracker }; |
| 1664 | ResourceUsage usages[2] = { RESOURCE_USAGE_COPY_TO, RESOURCE_USAGE_COPY_FROM }; |
| 1665 | _add_command_to_graph(trackers, usages, p_src_tracker != nullptr ? 2 : 1, command_index, command); |
| 1666 | } |
| 1667 | |
| 1668 | void RenderingDeviceGraph::add_buffer_get_data(RDD::BufferID p_src, ResourceTracker *p_src_tracker, RDD::BufferID p_dst, RDD::BufferCopyRegion p_region) { |
| 1669 | // Source tracker is allowed to be null as it could be a read-only buffer. |