| 2182 | } |
| 2183 | |
| 2184 | void RenderingDeviceGraph::add_texture_update(RDD::TextureID p_dst, ResourceTracker *p_dst_tracker, VectorView<RecordedBufferToTextureCopy> p_buffer_copies, VectorView<ResourceTracker *> p_buffer_trackers) { |
| 2185 | DEV_ASSERT(p_dst_tracker != nullptr); |
| 2186 | |
| 2187 | int32_t command_index; |
| 2188 | uint64_t command_size = sizeof(RecordedTextureUpdateCommand) + p_buffer_copies.size() * sizeof(RecordedBufferToTextureCopy); |
| 2189 | RecordedTextureUpdateCommand *command = static_cast<RecordedTextureUpdateCommand *>(_allocate_command(command_size, command_index)); |
| 2190 | command->type = RecordedCommand::TYPE_TEXTURE_UPDATE; |
| 2191 | command->self_stages = RDD::PIPELINE_STAGE_COPY_BIT; |
| 2192 | command->to_texture = p_dst; |
| 2193 | command->buffer_to_texture_copies_count = p_buffer_copies.size(); |
| 2194 | |
| 2195 | RecordedBufferToTextureCopy *buffer_to_texture_copies = command->buffer_to_texture_copies(); |
| 2196 | for (uint32_t i = 0; i < command->buffer_to_texture_copies_count; i++) { |
| 2197 | buffer_to_texture_copies[i] = p_buffer_copies[i]; |
| 2198 | } |
| 2199 | |
| 2200 | if (p_buffer_trackers.size() > 0) { |
| 2201 | // Add the optional buffer trackers if they were provided. |
| 2202 | thread_local LocalVector<ResourceTracker *> trackers; |
| 2203 | thread_local LocalVector<ResourceUsage> usages; |
| 2204 | trackers.clear(); |
| 2205 | usages.clear(); |
| 2206 | for (uint32_t i = 0; i < p_buffer_trackers.size(); i++) { |
| 2207 | trackers.push_back(p_buffer_trackers[i]); |
| 2208 | usages.push_back(RESOURCE_USAGE_COPY_FROM); |
| 2209 | } |
| 2210 | |
| 2211 | trackers.push_back(p_dst_tracker); |
| 2212 | usages.push_back(RESOURCE_USAGE_COPY_TO); |
| 2213 | |
| 2214 | _add_command_to_graph(trackers.ptr(), usages.ptr(), trackers.size(), command_index, command); |
| 2215 | } else { |
| 2216 | ResourceUsage usage = RESOURCE_USAGE_COPY_TO; |
| 2217 | _add_command_to_graph(&p_dst_tracker, &usage, 1, command_index, command); |
| 2218 | } |
| 2219 | } |
| 2220 | |
| 2221 | void RenderingDeviceGraph::add_capture_timestamp(RDD::QueryPoolID p_query_pool, uint32_t p_index) { |
| 2222 | int32_t command_index; |
no test coverage detected