Skip to content

Commit 808309d

Browse files
authored
remove unused code (#18699)
1 parent 7dc01cb commit 808309d

File tree

8 files changed

+18
-1002
lines changed

8 files changed

+18
-1002
lines changed

native/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,6 @@ cocos_source_files(
15281528
cocos/renderer/pipeline/custom/NativeBuiltinUtils.cpp
15291529
cocos/renderer/pipeline/custom/NativeBuiltinUtils.h
15301530
cocos/renderer/pipeline/custom/NativeExecutor.cpp
1531-
cocos/renderer/pipeline/custom/NativeExecutorDescriptor.cpp
15321531
cocos/renderer/pipeline/custom/NativeExecutorDescriptor2.cpp
15331532
cocos/renderer/pipeline/custom/NativeExecutorRenderGraph.h
15341533
cocos/renderer/pipeline/custom/NativeFactory.cpp

native/cocos/renderer/pipeline/custom/NativeExecutor.cpp

Lines changed: 18 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,8 +1144,25 @@ struct RenderGraphContextCleaner {
11441144
prevFenceValue(context.nextFenceValue) {
11451145
++context.nextFenceValue;
11461146
context.clearPreviousResources(prevFenceValue);
1147-
context.renderSceneResources.clear();
11481147
context.sceneCulling.clear();
1148+
1149+
// Clear the resource graph index
1150+
// Notice: we do not call `nativeContext.resourceGraphIndex.clear()`.
1151+
// Avoid memory allocation.
1152+
for (auto& [_, index] : context.resourceGraphIndex) {
1153+
index.clear();
1154+
}
1155+
1156+
// Notice: we do not call `nativeContext.graphNodeRenderData.clear()`.
1157+
// Avoid memory allocation.
1158+
// TODO(zhouzhenglong): we should use a pool allocator for this map.
1159+
for (auto& [_, data] : context.graphNodeRenderData) {
1160+
data.clear();
1161+
CC_ENSURES(data.hasNoData());
1162+
}
1163+
1164+
// Clear the descriptor sets
1165+
context.graphNodeDescriptorSets.clear();
11491166
}
11501167
RenderGraphContextCleaner(const RenderGraphContextCleaner&) = delete;
11511168
RenderGraphContextCleaner& operator=(const RenderGraphContextCleaner&) = delete;
@@ -1282,16 +1299,6 @@ void NativePipeline::executeRenderGraph(const RenderGraph& rg) {
12821299
ppl.pipelineSceneData->getShadows());
12831300
}
12841301

1285-
// gpu driven
1286-
if constexpr (ENABLE_GPU_DRIVEN) {
1287-
// TODO(jilin): consider populating renderSceneResources here
1288-
const scene::RenderScene* const ptr = nullptr;
1289-
auto& sceneResource = ppl.nativeContext.renderSceneResources[ptr];
1290-
const auto& nameID = lg.attributeIndex.find("cc_xxxDescriptor")->second;
1291-
sceneResource.resourceIndex.emplace(nameID, ResourceType::STORAGE_BUFFER);
1292-
sceneResource.storageBuffers.emplace(nameID, nullptr);
1293-
}
1294-
12951302
// Execute all valid passes
12961303
{
12971304
boost::filtered_graph<
@@ -1325,30 +1332,6 @@ void NativePipeline::executeRenderGraph(const RenderGraph& rg) {
13251332
#endif
13261333
}
13271334

1328-
ccstd::pmr::unordered_map<
1329-
RenderGraph::vertex_descriptor,
1330-
PmrFlatMap<NameLocalID, ResourceGraph::vertex_descriptor>>
1331-
perPassResourceIndex(scratch);
1332-
1333-
ccstd::pmr::unordered_map<
1334-
RenderGraph::vertex_descriptor,
1335-
std::tuple<gfx::DescriptorSet*, gfx::DescriptorSet*>>
1336-
renderGraphDescriptorSet(scratch);
1337-
1338-
ccstd::pmr::unordered_map<
1339-
RenderGraph::vertex_descriptor, gfx::DescriptorSet*>
1340-
uiDescriptorSet(scratch);
1341-
1342-
ccstd::pmr::unordered_map<
1343-
RenderGraph::vertex_descriptor,
1344-
gfx::DescriptorSet*>
1345-
profilerPerPassDescriptorSets(scratch);
1346-
1347-
ccstd::pmr::unordered_map<
1348-
RenderGraph::vertex_descriptor,
1349-
gfx::DescriptorSet*>
1350-
perInstanceDescriptorSets(scratch);
1351-
13521335
ccstd::pmr::vector<ccstd::optional<gfx::Viewport>> viewportStack(scratch);
13531336
viewportStack.reserve(4);
13541337

@@ -1360,11 +1343,6 @@ void NativePipeline::executeRenderGraph(const RenderGraph& rg) {
13601343
validPasses,
13611344
ppl.device, submit.primaryCommandBuffer,
13621345
&ppl,
1363-
perPassResourceIndex,
1364-
renderGraphDescriptorSet,
1365-
uiDescriptorSet,
1366-
profilerPerPassDescriptorSets,
1367-
perInstanceDescriptorSets,
13681346
programLibrary,
13691347
viewportStack,
13701348
CustomRenderGraphContext{
@@ -1375,26 +1353,6 @@ void NativePipeline::executeRenderGraph(const RenderGraph& rg) {
13751353
},
13761354
scratch};
13771355

1378-
{
1379-
// Clear the resource graph index
1380-
// Notice: we do not call `nativeContext.resourceGraphIndex.clear()`.
1381-
// Avoid memory allocation.
1382-
for (auto& [_, index] : nativeContext.resourceGraphIndex) {
1383-
index.clear();
1384-
}
1385-
1386-
// Notice: we do not call `nativeContext.graphNodeRenderData.clear()`.
1387-
// Avoid memory allocation.
1388-
// TODO(zhouzhenglong): we should use a pool allocator for this map.
1389-
for (auto& [_, data] : nativeContext.graphNodeRenderData) {
1390-
data.clear();
1391-
CC_ENSURES(data.hasNoData());
1392-
}
1393-
1394-
// Clear the descriptor sets
1395-
ppl.nativeContext.graphNodeDescriptorSets.clear();
1396-
}
1397-
13981356
RenderGraphVisitor visitor{{}, ctx};
13991357
auto colors = rg.colors(scratch);
14001358
for (const auto vertID : ctx.g.sortedVertices) {

0 commit comments

Comments
 (0)