MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / add_texture_copy

Method add_texture_copy

servers/rendering/rendering_device_graph.cpp:2113–2134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2111}
2112
2113void RenderingDeviceGraph::add_texture_copy(RDD::TextureID p_src, ResourceTracker *p_src_tracker, RDD::TextureID p_dst, ResourceTracker *p_dst_tracker, VectorView<RDD::TextureCopyRegion> p_texture_copy_regions) {
2114 DEV_ASSERT(p_src_tracker != nullptr);
2115 DEV_ASSERT(p_dst_tracker != nullptr);
2116
2117 int32_t command_index;
2118 uint64_t command_size = sizeof(RecordedTextureCopyCommand) + p_texture_copy_regions.size() * sizeof(RDD::TextureCopyRegion);
2119 RecordedTextureCopyCommand *command = static_cast<RecordedTextureCopyCommand *>(_allocate_command(command_size, command_index));
2120 command->type = RecordedCommand::TYPE_TEXTURE_COPY;
2121 command->self_stages = RDD::PIPELINE_STAGE_COPY_BIT;
2122 command->from_texture = p_src;
2123 command->to_texture = p_dst;
2124 command->texture_copy_regions_count = p_texture_copy_regions.size();
2125
2126 RDD::TextureCopyRegion *texture_copy_regions = command->texture_copy_regions();
2127 for (uint32_t i = 0; i < command->texture_copy_regions_count; i++) {
2128 texture_copy_regions[i] = p_texture_copy_regions[i];
2129 }
2130
2131 ResourceTracker *trackers[2] = { p_dst_tracker, p_src_tracker };
2132 ResourceUsage usages[2] = { RESOURCE_USAGE_COPY_TO, RESOURCE_USAGE_COPY_FROM };
2133 _add_command_to_graph(trackers, usages, 2, command_index, command);
2134}
2135
2136void RenderingDeviceGraph::add_texture_get_data(RDD::TextureID p_src, ResourceTracker *p_src_tracker, RDD::BufferID p_dst, VectorView<RDD::BufferTextureCopyRegion> p_buffer_texture_copy_regions, ResourceTracker *p_dst_tracker) {
2137 DEV_ASSERT(p_src_tracker != nullptr);

Callers 2

_texture_copy_sharedMethod · 0.80
texture_copyMethod · 0.80

Calls 1

sizeMethod · 0.65

Tested by

no test coverage detected