From db011d22d702da26ea3cd3a6dc4169ba765a45f7 Mon Sep 17 00:00:00 2001 From: Zeqiang Li Date: Thu, 21 Sep 2023 17:16:00 +0800 Subject: [PATCH 1/2] remove deprecated usage (#163) --- .../renderer/gfx-wgpu/WGPUCommandBuffer.cpp | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp b/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp index 1c94638d249..e2c3b045ac6 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp @@ -535,32 +535,33 @@ void CCWGPUCommandBuffer::draw(const DrawInfo &info) { bindStates(); auto *ia = static_cast(_gpuCommandBufferObj->stateCache.inputAssembler); - if (ia->getIndirectBuffer()) { - auto *indirectBuffer = static_cast(ia->getIndirectBuffer()); - bool multiDrawIndirectSupport = false; - - // indirectSupport not support, emscripten webgpu ver < 2021 - // https://github.com/gpuweb/gpuweb/issues/1354 - if (multiDrawIndirectSupport) { - // todo - } else { - if (info.indexCount) { - // indexedIndirect not supported, emsdk 2.0.26 - uint32_t drawInfoCount = indirectBuffer->getCount(); - for (size_t i = 0; i < drawInfoCount; i++) { - wgpuRenderPassEncoderDrawIndexedIndirect(_gpuCommandBufferObj->wgpuRenderPassEncoder, - indirectBuffer->gpuBufferObject()->wgpuBuffer, - indirectBuffer->getOffset() + i * sizeof(CCWGPUDrawIndexedIndirectObject)); - } - } else { - uint32_t drawInfoCount = indirectBuffer->getCount(); - for (size_t i = 0; i < drawInfoCount; i++) { - wgpuRenderPassEncoderDrawIndirect(_gpuCommandBufferObj->wgpuRenderPassEncoder, - indirectBuffer->gpuBufferObject()->wgpuBuffer, - indirectBuffer->getOffset() + i * sizeof(CCWGPUDrawIndirectObject)); - } - } - } + // TODO(Zeqiang): implement indirect drawing + if (0) { + // auto *indirectBuffer = static_cast(ia->getIndirectBuffer()); + // bool multiDrawIndirectSupport = false; + + // // indirectSupport not support, emscripten webgpu ver < 2021 + // // https://github.com/gpuweb/gpuweb/issues/1354 + // if (multiDrawIndirectSupport) { + // // todo + // } else { + // if (info.indexCount) { + // // indexedIndirect not supported, emsdk 2.0.26 + // uint32_t drawInfoCount = indirectBuffer->getCount(); + // for (size_t i = 0; i < drawInfoCount; i++) { + // wgpuRenderPassEncoderDrawIndexedIndirect(_gpuCommandBufferObj->wgpuRenderPassEncoder, + // indirectBuffer->gpuBufferObject()->wgpuBuffer, + // indirectBuffer->getOffset() + i * sizeof(CCWGPUDrawIndexedIndirectObject)); + // } + // } else { + // uint32_t drawInfoCount = indirectBuffer->getCount(); + // for (size_t i = 0; i < drawInfoCount; i++) { + // wgpuRenderPassEncoderDrawIndirect(_gpuCommandBufferObj->wgpuRenderPassEncoder, + // indirectBuffer->gpuBufferObject()->wgpuBuffer, + // indirectBuffer->getOffset() + i * sizeof(CCWGPUDrawIndirectObject)); + // } + // } + // } } else { auto *indexBuffer = static_cast(ia->getIndexBuffer()); bool drawIndexed = indexBuffer && info.indexCount; From 629c8423f05f0e3604d265951b8d90722ed8c9c1 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 21 Sep 2023 17:58:17 +0800 Subject: [PATCH 2/2] remove build engine --- package-lock.json | 1 - package.json | 1 - 2 files changed, 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 06d4a5b5ae1..58283581bb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,6 @@ "@babel/plugin-proposal-export-default-from": "^7.17.12", "@babel/preset-env": "7.8.7", "@cocos/babel-preset-cc": "2.2.0", - "@cocos/build-engine": "4.4.2", "@types/fs-extra": "^5.0.4", "@types/istanbul-lib-report": "^3.0.0", "@types/jest": "^28.1.8", diff --git a/package.json b/package.json index 563aff890a5..60f889fdbe1 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "@babel/plugin-proposal-export-default-from": "^7.17.12", "@babel/preset-env": "7.8.7", "@cocos/babel-preset-cc": "2.2.0", - "@cocos/build-engine": "4.4.2", "@types/fs-extra": "^5.0.4", "@types/istanbul-lib-report": "^3.0.0", "@types/jest": "^28.1.8",