From c3f2f4a1cb894017f7d7efc753de8db68a931e53 Mon Sep 17 00:00:00 2001 From: Cocos Robot <48829427+cocos-robot@users.noreply.github.com> Date: Wed, 9 Mar 2022 13:38:22 +0800 Subject: [PATCH] [ci skip][AUTO]: Automated clang-format update: 3b49861e5f453e86df3eff22b2e03b95dbe1f1e5 (#10261) (#10267) Co-authored-by: cocos-robot --- native/cocos/bindings/auto/jsb_cocos_auto.h | 2 +- native/cocos/main/EmptyMain.cpp | 4 +- native/cocos/platform/BasePlatform.cpp | 2 +- native/cocos/platform/empty/EmptyPlatform.h | 8 +-- .../platform/empty/modules/Accelerometer.cpp | 2 +- .../CanvasRenderingContext2DDelegate.cpp | 2 +- .../cocos/platform/empty/modules/System.cpp | 8 +-- native/cocos/platform/empty/modules/System.h | 4 +- .../platform/empty/modules/SystemWindow.h | 6 +- native/cocos/platform/linux/LinuxPlatform.cpp | 2 +- .../cocos/platform/linux/modules/Screen.cpp | 2 +- native/cocos/platform/qnx/QNXPlatform.cpp | 4 +- native/cocos/renderer/gfx-base/GFXDevice.h | 2 +- native/cocos/renderer/gfx-base/GFXTexture.cpp | 4 +- .../cocos/renderer/gfx-empty/EmptyDevice.cpp | 2 +- .../cocos/renderer/gfx-gles2/GLES2Texture.cpp | 4 +- .../cocos/renderer/gfx-gles3/GLES3Texture.cpp | 6 +- .../cocos/renderer/gfx-vulkan/VKCommands.cpp | 4 +- native/cocos/renderer/gfx-vulkan/VKDevice.h | 2 +- native/cocos/renderer/gfx-wgpu/WGPUBuffer.h | 20 +++--- native/cocos/renderer/gfx-wgpu/WGPUDef.h | 30 ++++---- .../renderer/gfx-wgpu/WGPUDescriptorSet.cpp | 68 +++++++++--------- .../renderer/gfx-wgpu/WGPUDescriptorSet.h | 10 +-- .../gfx-wgpu/WGPUDescriptorSetLayout.cpp | 22 +++--- .../gfx-wgpu/WGPUDescriptorSetLayout.h | 10 +-- native/cocos/renderer/gfx-wgpu/WGPUDevice.cpp | 72 +++++++++---------- .../renderer/gfx-wgpu/WGPUFrameBuffer.cpp | 10 +-- .../cocos/renderer/gfx-wgpu/WGPUFrameBuffer.h | 6 +- .../renderer/gfx-wgpu/WGPUInputAssembler.cpp | 4 +- .../renderer/gfx-wgpu/WGPUInputAssembler.h | 8 +-- native/cocos/renderer/gfx-wgpu/WGPUObject.h | 28 ++++---- .../renderer/gfx-wgpu/WGPUPipelineLayout.cpp | 6 +- .../renderer/gfx-wgpu/WGPUPipelineLayout.h | 8 +-- .../renderer/gfx-wgpu/WGPUPipelineState.cpp | 32 ++++----- .../renderer/gfx-wgpu/WGPUPipelineState.h | 14 ++-- .../cocos/renderer/gfx-wgpu/WGPUQueryPool.cpp | 4 +- native/cocos/renderer/gfx-wgpu/WGPUQueue.cpp | 4 +- native/cocos/renderer/gfx-wgpu/WGPUQueue.h | 8 +-- .../renderer/gfx-wgpu/WGPURenderPass.cpp | 6 +- .../cocos/renderer/gfx-wgpu/WGPURenderPass.h | 10 +-- .../cocos/renderer/gfx-wgpu/WGPUSampler.cpp | 8 +-- native/cocos/renderer/gfx-wgpu/WGPUSampler.h | 4 +- native/cocos/renderer/gfx-wgpu/WGPUShader.cpp | 12 ++-- native/cocos/renderer/gfx-wgpu/WGPUShader.h | 8 +-- .../cocos/renderer/gfx-wgpu/WGPUSwapchain.cpp | 22 +++--- .../cocos/renderer/gfx-wgpu/WGPUSwapchain.h | 16 ++--- native/cocos/renderer/gfx-wgpu/WGPUTexture.h | 16 ++--- native/cocos/renderer/gfx-wgpu/WGPUUtils.h | 2 +- native/cocos/scene/Model.cpp | 2 +- native/cocos/scene/Model.h | 2 +- 50 files changed, 271 insertions(+), 271 deletions(-) diff --git a/native/cocos/bindings/auto/jsb_cocos_auto.h b/native/cocos/bindings/auto/jsb_cocos_auto.h index 63965f47f9..12535a8267 100644 --- a/native/cocos/bindings/auto/jsb_cocos_auto.h +++ b/native/cocos/bindings/auto/jsb_cocos_auto.h @@ -174,4 +174,4 @@ SE_DECLARE_FUNC(js_engine_CCObject_destroy); SE_DECLARE_FUNC(js_engine_CCObject_destroyImmediate); SE_DECLARE_FUNC(js_engine_CCObject_toString); SE_DECLARE_FUNC(js_engine_CCObject_deferredDestroy); - // clang-format on \ No newline at end of file +// clang-format on \ No newline at end of file diff --git a/native/cocos/main/EmptyMain.cpp b/native/cocos/main/EmptyMain.cpp index 6c8daf643b..b3816b1a9c 100644 --- a/native/cocos/main/EmptyMain.cpp +++ b/native/cocos/main/EmptyMain.cpp @@ -26,6 +26,6 @@ #include "platform/BasePlatform.h" -int main(int argc, char** argv) { - START_PLATFORM(argc, (const char**)argv); +int main(int argc, char **argv) { + START_PLATFORM(argc, (const char **)argv); } \ No newline at end of file diff --git a/native/cocos/platform/BasePlatform.cpp b/native/cocos/platform/BasePlatform.cpp index 8025ee2999..07f54030ac 100644 --- a/native/cocos/platform/BasePlatform.cpp +++ b/native/cocos/platform/BasePlatform.cpp @@ -46,7 +46,7 @@ namespace cc { BasePlatform::BasePlatform() = default; BasePlatform::~BasePlatform() = default; -BasePlatform* BasePlatform::getPlatform() { +BasePlatform *BasePlatform::getPlatform() { #if defined(CC_SERVER_MODE) static EmptyPlatform platform; #elif (CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/platform/empty/EmptyPlatform.h b/native/cocos/platform/empty/EmptyPlatform.h index 8352a385b5..88b9a66ace 100644 --- a/native/cocos/platform/empty/EmptyPlatform.h +++ b/native/cocos/platform/empty/EmptyPlatform.h @@ -46,10 +46,10 @@ public: int32_t loop() override; // override from SystemWindow::Delegate - bool createWindow(const char* title, - int x, int y, int w, - int h, int flags) override; - uintptr_t getWindowHandler() const override; + bool createWindow(const char *title, + int x, int y, int w, + int h, int flags) override; + uintptr_t getWindowHandler() const override; private: void pollEvent() override; diff --git a/native/cocos/platform/empty/modules/Accelerometer.cpp b/native/cocos/platform/empty/modules/Accelerometer.cpp index 8c70eb7a60..96bed8de1b 100644 --- a/native/cocos/platform/empty/modules/Accelerometer.cpp +++ b/native/cocos/platform/empty/modules/Accelerometer.cpp @@ -32,7 +32,7 @@ void Accelerometer::setAccelerometerEnabled(bool isEnabled) { void Accelerometer::setAccelerometerInterval(float interval) { } -const Accelerometer::MotionValue& Accelerometer::getDeviceMotionValue() { +const Accelerometer::MotionValue &Accelerometer::getDeviceMotionValue() { static MotionValue motionValue; return motionValue; } diff --git a/native/cocos/platform/empty/modules/CanvasRenderingContext2DDelegate.cpp b/native/cocos/platform/empty/modules/CanvasRenderingContext2DDelegate.cpp index da1953a76d..38c959dd5d 100644 --- a/native/cocos/platform/empty/modules/CanvasRenderingContext2DDelegate.cpp +++ b/native/cocos/platform/empty/modules/CanvasRenderingContext2DDelegate.cpp @@ -34,7 +34,7 @@ namespace { namespace cc { //static const char gdefaultFontName[] = "-*-helvetica-medium-o-*-*-24-*-*-*-*-*-iso8859-*"; //static const char gdefaultFontName[] = "lucidasanstypewriter-bold-24"; -static const char gdefaultFontName[] = "lucidasans-24"; +static const char gdefaultFontName[] = "lucidasans-24"; CanvasRenderingContext2DDelegate::CanvasRenderingContext2DDelegate() { } diff --git a/native/cocos/platform/empty/modules/System.cpp b/native/cocos/platform/empty/modules/System.cpp index b8e9f53f22..5b39466db8 100644 --- a/native/cocos/platform/empty/modules/System.cpp +++ b/native/cocos/platform/empty/modules/System.cpp @@ -40,7 +40,7 @@ std::string System::getDeviceModel() const { } System::LanguageType System::getCurrentLanguage() const { - char* pLanguageName = getenv("LANG"); + char *pLanguageName = getenv("LANG"); if (!pLanguageName) { return LanguageType::ENGLISH; } @@ -54,7 +54,7 @@ System::LanguageType System::getCurrentLanguage() const { std::string System::getCurrentLanguageCode() const { static char code[3] = {0}; - char* pLanguageName = getenv("LANG"); + char * pLanguageName = getenv("LANG"); if (!pLanguageName) { return "en"; } @@ -71,11 +71,11 @@ std::string System::getSystemVersion() const { return "empty"; } -bool System::openURL(const std::string& url) { +bool System::openURL(const std::string &url) { return true; } -System::LanguageType System::getLanguageTypeByISO2(const char* code) const { +System::LanguageType System::getLanguageTypeByISO2(const char *code) const { // this function is used by all platforms to get system language // except windows: cocos/platform/win32/CCApplication-win32.cpp LanguageType ret = LanguageType::ENGLISH; diff --git a/native/cocos/platform/empty/modules/System.h b/native/cocos/platform/empty/modules/System.h index 50646c402a..9914a82bb1 100644 --- a/native/cocos/platform/empty/modules/System.h +++ b/native/cocos/platform/empty/modules/System.h @@ -59,10 +59,10 @@ public: @param String with url to open. @return True if the resource located by the URL was successfully opened; otherwise false. */ - bool openURL(const std::string& url) override; + bool openURL(const std::string &url) override; private: - LanguageType getLanguageTypeByISO2(const char* code) const; + LanguageType getLanguageTypeByISO2(const char *code) const; }; } // namespace cc diff --git a/native/cocos/platform/empty/modules/SystemWindow.h b/native/cocos/platform/empty/modules/SystemWindow.h index 5e836c2319..e49ad509dd 100644 --- a/native/cocos/platform/empty/modules/SystemWindow.h +++ b/native/cocos/platform/empty/modules/SystemWindow.h @@ -42,13 +42,13 @@ public: class Delegate { public: virtual ~Delegate() = default; - virtual bool createWindow(const char* title, + virtual bool createWindow(const char *title, int x, int y, int w, int h, int flags) = 0; virtual uintptr_t getWindowHandler() const = 0; }; - bool createWindow(const char* title, + bool createWindow(const char *title, int x, int y, int w, int h, int flags) override; uintptr_t getWindowHandler() const override; @@ -58,7 +58,7 @@ public: @brief enable/disable(lock) the cursor, default is enabled */ void setCursorEnabled(bool value) override; - void copyTextToClipboard(const std::string& text) override; + void copyTextToClipboard(const std::string &text) override; private: int _width{0}; diff --git a/native/cocos/platform/linux/LinuxPlatform.cpp b/native/cocos/platform/linux/LinuxPlatform.cpp index 0ed8af73bf..d75281b2b4 100644 --- a/native/cocos/platform/linux/LinuxPlatform.cpp +++ b/native/cocos/platform/linux/LinuxPlatform.cpp @@ -189,7 +189,7 @@ int32_t LinuxPlatform::loop() { onResume(); while (!_quit) { curTime = getCurrentMillSecond(); - desiredInterval = static_cast(1000.0 / getFps()); + desiredInterval = static_cast(1000.0 / getFps()); pollEvent(); actualInterval = curTime - lastTime; if (actualInterval >= desiredInterval) { diff --git a/native/cocos/platform/linux/modules/Screen.cpp b/native/cocos/platform/linux/modules/Screen.cpp index cf307ed6cd..258b0db58c 100644 --- a/native/cocos/platform/linux/modules/Screen.cpp +++ b/native/cocos/platform/linux/modules/Screen.cpp @@ -24,9 +24,9 @@ ****************************************************************************/ #include "platform/linux/modules/Screen.h" +#include #include "base/Macros.h" #include "cocos/bindings/jswrapper/SeApi.h" -#include namespace cc { diff --git a/native/cocos/platform/qnx/QNXPlatform.cpp b/native/cocos/platform/qnx/QNXPlatform.cpp index 8ae44550df..1f3d4d2879 100644 --- a/native/cocos/platform/qnx/QNXPlatform.cpp +++ b/native/cocos/platform/qnx/QNXPlatform.cpp @@ -189,8 +189,8 @@ int32_t QnxPlatform::loop() { onResume(); while (!_quit) { curTime = getCurrentMillSecond(); - desiredInterval = static_cast(1000.0 / getFps()); - + desiredInterval = static_cast(1000.0 / getFps()); + // pollEvent(); actualInterval = curTime - lastTime; if (actualInterval >= desiredInterval) { diff --git a/native/cocos/renderer/gfx-base/GFXDevice.h b/native/cocos/renderer/gfx-base/GFXDevice.h index 3101ca96fd..80c6f5a027 100644 --- a/native/cocos/renderer/gfx-base/GFXDevice.h +++ b/native/cocos/renderer/gfx-base/GFXDevice.h @@ -41,10 +41,10 @@ #include "GFXShader.h" #include "GFXSwapchain.h" #include "GFXTexture.h" +#include "base/RefCounted.h" #include "states/GFXGeneralBarrier.h" #include "states/GFXSampler.h" #include "states/GFXTextureBarrier.h" -#include "base/RefCounted.h" namespace cc { namespace gfx { diff --git a/native/cocos/renderer/gfx-base/GFXTexture.cpp b/native/cocos/renderer/gfx-base/GFXTexture.cpp index b360eda1cd..25684f9678 100644 --- a/native/cocos/renderer/gfx-base/GFXTexture.cpp +++ b/native/cocos/renderer/gfx-base/GFXTexture.cpp @@ -125,8 +125,8 @@ void Texture::initialize(const SwapchainTextureInfo &info, Texture *out) { out->_info.samples = SampleCount::ONE; out->_info.flags = TextureFlagBit::NONE; out->_info.usage = GFX_FORMAT_INFOS[toNumber(info.format)].hasDepth - ? TextureUsageBit::DEPTH_STENCIL_ATTACHMENT - : TextureUsageBit::COLOR_ATTACHMENT; + ? TextureUsageBit::DEPTH_STENCIL_ATTACHMENT + : TextureUsageBit::COLOR_ATTACHMENT; out->_swapchain = info.swapchain; out->_size = formatSize(info.format, info.width, info.height, 1); diff --git a/native/cocos/renderer/gfx-empty/EmptyDevice.cpp b/native/cocos/renderer/gfx-empty/EmptyDevice.cpp index 9289d588a0..02dbecd16d 100644 --- a/native/cocos/renderer/gfx-empty/EmptyDevice.cpp +++ b/native/cocos/renderer/gfx-empty/EmptyDevice.cpp @@ -73,7 +73,7 @@ bool EmptyDevice::doInit(const DeviceInfo & /*info*/) { _formatFeatures.fill(static_cast(-1)); // allow all usages for all formats _formatFeatures[toNumber(Format::UNKNOWN)] = FormatFeature::NONE; - _formatFeatures[toNumber(Format::COUNT)] = FormatFeature::NONE; + _formatFeatures[toNumber(Format::COUNT)] = FormatFeature::NONE; CC_LOG_INFO("Empty device initialized."); diff --git a/native/cocos/renderer/gfx-gles2/GLES2Texture.cpp b/native/cocos/renderer/gfx-gles2/GLES2Texture.cpp index bae5adfe75..4ca1676155 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Texture.cpp +++ b/native/cocos/renderer/gfx-gles2/GLES2Texture.cpp @@ -64,8 +64,8 @@ void GLES2Texture::doInit(const TextureInfo & /*info*/) { } } -void GLES2Texture::doInit(const TextureViewInfo& info) { - _gpuTexture = static_cast(info.texture)->gpuTexture(); +void GLES2Texture::doInit(const TextureViewInfo &info) { + _gpuTexture = static_cast(info.texture)->gpuTexture(); } void GLES2Texture::doDestroy() { diff --git a/native/cocos/renderer/gfx-gles3/GLES3Texture.cpp b/native/cocos/renderer/gfx-gles3/GLES3Texture.cpp index c6023bffcc..6e01231325 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Texture.cpp +++ b/native/cocos/renderer/gfx-gles3/GLES3Texture.cpp @@ -68,8 +68,8 @@ void GLES3Texture::doInit(const TextureInfo & /*info*/) { createTextureView(); } -void GLES3Texture::doInit(const TextureViewInfo& /*info*/) { - _gpuTexture = static_cast(_viewInfo.texture)->gpuTexture(); +void GLES3Texture::doInit(const TextureViewInfo & /*info*/) { + _gpuTexture = static_cast(_viewInfo.texture)->gpuTexture(); CCASSERT(_viewInfo.texture->getFormat() == _viewInfo.format, "Invalid TextureView fromat"); @@ -140,7 +140,7 @@ void GLES3Texture::doInit(const SwapchainTextureInfo & /*info*/) { _gpuTexture->size = _size; _gpuTexture->memoryless = true; _gpuTexture->swapchain = static_cast(_swapchain)->gpuSwapchain(); - _gpuTextureView = CC_NEW(GLES3GPUTextureView); + _gpuTextureView = CC_NEW(GLES3GPUTextureView); createTextureView(); } diff --git a/native/cocos/renderer/gfx-vulkan/VKCommands.cpp b/native/cocos/renderer/gfx-vulkan/VKCommands.cpp index c20eb0ae02..3c0039983b 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommands.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKCommands.cpp @@ -453,7 +453,7 @@ void cmdFuncCCVKCreateRenderPass(CCVKDevice *device, CCVKGPURenderPass *gpuRende VkImageAspectFlags aspect = GFX_FORMAT_INFOS[toNumber(dsFormat)].hasStencil ? VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT : VK_IMAGE_ASPECT_DEPTH_BIT; - VkImageLayout layout = isGeneralLayout ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + VkImageLayout layout = isGeneralLayout ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; attachmentReferences.push_back({VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, nullptr, subpassInfo.depthStencil, layout, aspect}); } @@ -473,7 +473,7 @@ void cmdFuncCCVKCreateRenderPass(CCVKDevice *device, CCVKGPURenderPass *gpuRende VkImageAspectFlags aspect = GFX_FORMAT_INFOS[toNumber(dsFormat)].hasStencil ? VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT : VK_IMAGE_ASPECT_DEPTH_BIT; - VkImageLayout layout = isGeneralLayout ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + VkImageLayout layout = isGeneralLayout ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; attachmentReferences.push_back({VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, nullptr, subpassInfo.depthStencilResolve, layout, aspect}); } diff --git a/native/cocos/renderer/gfx-vulkan/VKDevice.h b/native/cocos/renderer/gfx-vulkan/VKDevice.h index 13448584b3..56c3dc3a54 100644 --- a/native/cocos/renderer/gfx-vulkan/VKDevice.h +++ b/native/cocos/renderer/gfx-vulkan/VKDevice.h @@ -126,7 +126,7 @@ protected: PipelineState * createPipelineState() override; Sampler * createSampler(const SamplerInfo &info) override; - GeneralBarrier * createGeneralBarrier(const GeneralBarrierInfo &info) override; + GeneralBarrier *createGeneralBarrier(const GeneralBarrierInfo &info) override; TextureBarrier *createTextureBarrier(const TextureBarrierInfo &info) override; void copyBuffersToTexture(const uint8_t *const *buffers, Texture *dst, const BufferTextureCopy *regions, uint32_t count) override; diff --git a/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h b/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h index be4cb85ee7..1d77d8160b 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h @@ -39,22 +39,22 @@ public: CCWGPUBuffer(); ~CCWGPUBuffer() = default; - void update(const void* buffer, uint size) override; + void update(const void *buffer, uint size) override; - inline CCWGPUBufferObject* gpuBufferObject() const { return _gpuBufferObject; } + inline CCWGPUBufferObject *gpuBufferObject() const { return _gpuBufferObject; } - static CCWGPUBuffer* defaultUniformBuffer(); + static CCWGPUBuffer *defaultUniformBuffer(); - static CCWGPUBuffer* defaultStorageBuffer(); + static CCWGPUBuffer *defaultStorageBuffer(); inline uint getOffset() const { return _offset; } - void update(const emscripten::val& v, uint size) { + void update(const emscripten::val &v, uint size) { std::vector buffer = emscripten::convertJSArrayToNumberVector(v); - update(reinterpret_cast(buffer.data()), size); + update(reinterpret_cast(buffer.data()), size); } - void update(const DrawInfoList& drawInfos); + void update(const DrawInfoList &drawInfos); // used before unmap? void check(); @@ -66,12 +66,12 @@ public: inline bool internalChanged() const { return _internalChanged; } protected: - void doInit(const BufferInfo& info) override; - void doInit(const BufferViewInfo& info) override; + void doInit(const BufferInfo &info) override; + void doInit(const BufferViewInfo &info) override; void doDestroy() override; void doResize(uint size, uint count) override; - CCWGPUBufferObject* _gpuBufferObject = nullptr; + CCWGPUBufferObject *_gpuBufferObject = nullptr; bool _internalChanged = false; }; diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDef.h b/native/cocos/renderer/gfx-wgpu/WGPUDef.h index d1c3ec6414..5234510beb 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDef.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUDef.h @@ -55,7 +55,7 @@ public: inline void setLayerCount(uint layerCount) { info.layerCount = layerCount; } inline void setSamples(SampleCount sample) { info.samples = sample; } inline void setDepth(uint32_t depth) { info.depth = depth; } - inline void setImageBuffer(intptr_t imgBuff) { info.externalRes = reinterpret_cast(imgBuff); } + inline void setImageBuffer(intptr_t imgBuff) { info.externalRes = reinterpret_cast(imgBuff); } explicit operator const TextureInfo() const { return info; } @@ -67,7 +67,7 @@ class TextureViewInfoInstance { public: TextureViewInfoInstance() = default; - inline void setTexture(Texture* tex) { info.texture = tex; } + inline void setTexture(Texture *tex) { info.texture = tex; } inline void setType(TextureType type) { info.type = type; } inline void setFormat(Format format) { info.format = format; } inline void setBaseLevel(uint baseLevel) { info.baseLevel = baseLevel; } @@ -85,7 +85,7 @@ class SwapchainInfoInstance { public: SwapchainInfoInstance() = default; - inline void setWindowHandle(uintptr_t hwnd) { info.windowHandle = reinterpret_cast(hwnd); } + inline void setWindowHandle(uintptr_t hwnd) { info.windowHandle = reinterpret_cast(hwnd); } inline void setVsyncMode(VsyncMode mode) { info.vsyncMode = mode; } inline void setWidth(uint32_t width) { info.width = width; } inline void setHeight(uint32_t height) { info.height = height; } @@ -100,9 +100,9 @@ class FramebufferInfoInstance { public: FramebufferInfoInstance() = default; - inline void setRenderPass(RenderPass* renderPass) { info.renderPass = renderPass; } + inline void setRenderPass(RenderPass *renderPass) { info.renderPass = renderPass; } inline void setColorTextures(TextureList colors) { info.colorTextures = colors; } - inline void setDepthStencilTexture(Texture* tex) { info.depthStencilTexture = tex; } + inline void setDepthStencilTexture(Texture *tex) { info.depthStencilTexture = tex; } explicit operator const FramebufferInfo() const { return info; } @@ -114,7 +114,7 @@ class BufferViewInfoInstance { public: BufferViewInfoInstance() = default; - inline void setBuffer(Buffer* buffer) { info.buffer = buffer; } + inline void setBuffer(Buffer *buffer) { info.buffer = buffer; } inline void setOffset(uint32_t offset) { info.offset = offset; } inline void setRange(uint32_t range) { info.range = range; } @@ -127,7 +127,7 @@ private: class DescriptorSetInfoInstance { public: DescriptorSetInfoInstance() = default; - inline void setDescriptorSetLayout(DescriptorSetLayout* layout) { info.layout = layout; } + inline void setDescriptorSetLayout(DescriptorSetLayout *layout) { info.layout = layout; } explicit operator const DescriptorSetInfo() const { return info; } @@ -137,9 +137,9 @@ private: class PipelineStateInfoInstance { public: - inline void setShader(Shader* shader) { info.shader = shader; } - inline void setPipelineLayout(PipelineLayout* pipelineLayout) { info.pipelineLayout = pipelineLayout; } - inline void setRenderPass(RenderPass* renderPass) { info.renderPass = renderPass; } + inline void setShader(Shader *shader) { info.shader = shader; } + inline void setPipelineLayout(PipelineLayout *pipelineLayout) { info.pipelineLayout = pipelineLayout; } + inline void setRenderPass(RenderPass *renderPass) { info.renderPass = renderPass; } inline void setInputState(InputState inputState) { info.inputState = inputState; } inline void setRasterizerState(RasterizerState rasterizerState) { info.rasterizerState = rasterizerState; } inline void setDepthStencilState(DepthStencilState depthStencilState) { info.depthStencilState = depthStencilState; } @@ -159,8 +159,8 @@ class InputAssemblerInfoInstance { public: inline void setAttributes(AttributeList attributes) { info.attributes = attributes; } inline void setBuffers(BufferList buffers) { info.vertexBuffers = buffers; } - inline void setIndexBuffer(Buffer* buffer) { info.indexBuffer = buffer; } - inline void setIndirectBuffer(Buffer* buffer) { info.indirectBuffer = buffer; } + inline void setIndexBuffer(Buffer *buffer) { info.indexBuffer = buffer; } + inline void setIndirectBuffer(Buffer *buffer) { info.indirectBuffer = buffer; } explicit operator const InputAssemblerInfo() const { return info; } @@ -170,7 +170,7 @@ private: class CommandBufferInfoInstance { public: - inline void setQueue(Queue* q) { info.queue = q; } + inline void setQueue(Queue *q) { info.queue = q; } inline void setType(CommandBufferType type) { info.type = type; } explicit operator const CommandBufferInfo() const { return info; } @@ -184,7 +184,7 @@ public: inline void setGroupCountX(uint32_t groupCountX) { info.groupCountX = groupCountX; } inline void setGroupCountY(uint32_t groupCountY) { info.groupCountY = groupCountY; } inline void setGroupCountZ(uint32_t groupCountZ) { info.groupCountZ = groupCountZ; } - inline void setIndirectBuffer(Buffer* indirectBuffer) { info.indirectBuffer = indirectBuffer; } + inline void setIndirectBuffer(Buffer *indirectBuffer) { info.indirectBuffer = indirectBuffer; } inline void setIndirectOffset(uint32_t offset) { info.indirectOffset = offset; } explicit operator const DispatchInfo() const { return info; } @@ -199,7 +199,7 @@ public: std::vector spv; inline void setStage(ShaderStageFlagBit stageIn) { stage = stageIn; } - inline void setSPVData(const emscripten::val& v) { spv = emscripten::convertJSArrayToNumberVector(v); } + inline void setSPVData(const emscripten::val &v) { spv = emscripten::convertJSArrayToNumberVector(v); } }; class SPVShaderInfoInstance { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp index a2409c2d78..4957f09620 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp @@ -45,18 +45,18 @@ using namespace emscripten; CCWGPUDescriptorSet::CCWGPUDescriptorSet() : wrapper(val::object()) { } -void CCWGPUDescriptorSet::doInit(const DescriptorSetInfo& info) { +void CCWGPUDescriptorSet::doInit(const DescriptorSetInfo &info) { _gpuBindGroupObj = CC_NEW(CCWGPUBindGroupObject); - auto* dsLayout = static_cast(_layout); - CCWGPUBindGroupLayoutObject* layoutEntries = dsLayout->gpuLayoutEntryObject(); - const auto& bindings = dsLayout->getBindings(); - CCWGPUDeviceObject* deviceObj = CCWGPUDevice::getInstance()->gpuDeviceObject(); + auto * dsLayout = static_cast(_layout); + CCWGPUBindGroupLayoutObject *layoutEntries = dsLayout->gpuLayoutEntryObject(); + const auto & bindings = dsLayout->getBindings(); + CCWGPUDeviceObject * deviceObj = CCWGPUDevice::getInstance()->gpuDeviceObject(); for (size_t i = 0; i < bindings.size(); i++) { // effect.ts: INPUT_ATTACHMENT as combined texture but no sampler_texture desc type. if (hasFlag(COMBINED_ST_IN_USE, bindings[i].descriptorType)) { //1. texture - CCWGPUTexture* texture = deviceObj->defaultResources.commonTexture; + CCWGPUTexture * texture = deviceObj->defaultResources.commonTexture; WGPUBindGroupEntry texEntry = { .binding = bindings[i].binding, .textureView = texture->gpuTextureObject()->selfView, @@ -66,7 +66,7 @@ void CCWGPUDescriptorSet::doInit(const DescriptorSetInfo& info) { dsLayout->updateLayout(texEntry.binding, nullptr, texture); // 2. sampler - CCWGPUSampler* sampler = deviceObj->defaultResources.sampler; + CCWGPUSampler * sampler = deviceObj->defaultResources.sampler; WGPUBindGroupEntry smpEntry = { .binding = bindings[i].binding + CC_WGPU_MAX_ATTACHMENTS, .sampler = sampler->gpuSampler(), @@ -75,7 +75,7 @@ void CCWGPUDescriptorSet::doInit(const DescriptorSetInfo& info) { _samplerIdxMap.insert(std::make_pair(bindings[i].binding, _gpuBindGroupObj->bindGroupEntries.size() - 1)); dsLayout->updateLayout(smpEntry.binding, nullptr, nullptr, sampler); } else if (hasFlag(DESCRIPTOR_BUFFER_TYPE, bindings[i].descriptorType)) { - CCWGPUBuffer* buffer = hasFlag(DescriptorType::DYNAMIC_STORAGE_BUFFER | DescriptorType::STORAGE_BUFFER, bindings[i].descriptorType) + CCWGPUBuffer * buffer = hasFlag(DescriptorType::DYNAMIC_STORAGE_BUFFER | DescriptorType::STORAGE_BUFFER, bindings[i].descriptorType) ? deviceObj->defaultResources.storageBuffer : deviceObj->defaultResources.uniformBuffer; WGPUBindGroupEntry bufferEntry = { @@ -90,7 +90,7 @@ void CCWGPUDescriptorSet::doInit(const DescriptorSetInfo& info) { } _gpuBindGroupObj->bindGroupEntries.push_back(bufferEntry); } else if (bindings[i].descriptorType == DescriptorType::STORAGE_IMAGE) { - CCWGPUTexture* texture = deviceObj->defaultResources.storageTexture; + CCWGPUTexture * texture = deviceObj->defaultResources.storageTexture; WGPUBindGroupEntry texEntry = { .binding = bindings[i].binding, .textureView = texture->gpuTextureObject()->selfView, @@ -116,16 +116,16 @@ void CCWGPUDescriptorSet::update() { if (!_isDirty) { return; } - auto* dsLayout = static_cast(_layout); - const auto& bindings = dsLayout->getBindings(); + auto * dsLayout = static_cast(_layout); + const auto &bindings = dsLayout->getBindings(); for (size_t i = 0; i < bindings.size(); i++) { - const auto& binding = bindings[i]; + const auto &binding = bindings[i]; uint8_t resourceIndex = _layout->getDescriptorIndices()[i]; if (hasFlag(DESCRIPTOR_BUFFER_TYPE, bindings[i].descriptorType)) { if (_buffers[resourceIndex]) { - auto* buffer = static_cast(_buffers[resourceIndex]); - auto& bindGroupEntry = _gpuBindGroupObj->bindGroupEntries[i]; + auto *buffer = static_cast(_buffers[resourceIndex]); + auto &bindGroupEntry = _gpuBindGroupObj->bindGroupEntries[i]; buffer->check(); bindGroupEntry.binding = binding.binding; bindGroupEntry.buffer = buffer->gpuBufferObject()->wgpuBuffer; @@ -148,16 +148,16 @@ void CCWGPUDescriptorSet::update() { uint8_t textureIdx = texIter != _textureIdxMap.end() ? texIter->second : 255; uint8_t samplerIdx = smpIter != _samplerIdxMap.end() ? smpIter->second : 255; if (textureIdx != 255 && _textures[resourceIndex]) { - auto& bindGroupEntry = _gpuBindGroupObj->bindGroupEntries[textureIdx]; - auto* texture = static_cast(_textures[resourceIndex]); + auto &bindGroupEntry = _gpuBindGroupObj->bindGroupEntries[textureIdx]; + auto *texture = static_cast(_textures[resourceIndex]); bindGroupEntry.binding = binding.binding; bindGroupEntry.textureView = texture->gpuTextureObject()->selfView; dsLayout->updateLayout(bindGroupEntry.binding, nullptr, texture); _gpuBindGroupObj->bindingSet.insert(binding.binding); } if (samplerIdx != 255 && _samplers[resourceIndex]) { - auto& bindGroupEntry = _gpuBindGroupObj->bindGroupEntries[samplerIdx]; - auto* sampler = static_cast(_samplers[resourceIndex]); + auto &bindGroupEntry = _gpuBindGroupObj->bindGroupEntries[samplerIdx]; + auto *sampler = static_cast(_samplers[resourceIndex]); bindGroupEntry.binding = binding.binding + CC_WGPU_MAX_ATTACHMENTS; bindGroupEntry.sampler = sampler->gpuSampler(); dsLayout->updateLayout(bindGroupEntry.binding, nullptr, nullptr, sampler); @@ -165,8 +165,8 @@ void CCWGPUDescriptorSet::update() { } } else if (DescriptorType::STORAGE_IMAGE == bindings[i].descriptorType) { if (_textures[resourceIndex]) { - auto& bindGroupEntry = _gpuBindGroupObj->bindGroupEntries[resourceIndex]; - auto* texture = static_cast(_textures[resourceIndex]); + auto &bindGroupEntry = _gpuBindGroupObj->bindGroupEntries[resourceIndex]; + auto *texture = static_cast(_textures[resourceIndex]); bindGroupEntry.binding = binding.binding; bindGroupEntry.textureView = texture->gpuTextureObject()->selfView; dsLayout->updateLayout(bindGroupEntry.binding, nullptr, texture); @@ -176,11 +176,11 @@ void CCWGPUDescriptorSet::update() { } void CCWGPUDescriptorSet::prepare() { - auto buffIter = std::find_if(_buffers.begin(), _buffers.end(), [](const Buffer* buffer) { - return buffer ? static_cast(buffer)->internalChanged() : false; + auto buffIter = std::find_if(_buffers.begin(), _buffers.end(), [](const Buffer *buffer) { + return buffer ? static_cast(buffer)->internalChanged() : false; }); - auto texIter = std::find_if(_textures.begin(), _textures.end(), [](const Texture* texture) { - return texture ? static_cast(texture)->internalChanged() : false; + auto texIter = std::find_if(_textures.begin(), _textures.end(), [](const Texture *texture) { + return texture ? static_cast(texture)->internalChanged() : false; }); bool forceUpdate = buffIter != _buffers.end() || texIter != _textures.end(); @@ -190,7 +190,7 @@ void CCWGPUDescriptorSet::prepare() { } if (_isDirty || forceUpdate || !_gpuBindGroupObj->bindgroup) { - auto* dsLayout = static_cast(_layout); + auto *dsLayout = static_cast(_layout); dsLayout->prepare(forceUpdate); // std::vector // bindGroupEntries; @@ -201,7 +201,7 @@ void CCWGPUDescriptorSet::prepare() { // }), // bindGroupEntries.end()); - const auto& entries = _gpuBindGroupObj->bindGroupEntries; + const auto &entries = _gpuBindGroupObj->bindGroupEntries; // for (size_t j = 0; j < entries.size(); j++) { // const auto& entry = entries[j]; @@ -210,7 +210,7 @@ void CCWGPUDescriptorSet::prepare() { // } // } - CCWGPUDeviceObject* deviceObj = CCWGPUDevice::getInstance()->gpuDeviceObject(); + CCWGPUDeviceObject *deviceObj = CCWGPUDevice::getInstance()->gpuDeviceObject(); if (_gpuBindGroupObj->bindgroup && _gpuBindGroupObj->bindgroup != anoymous::defaultBindGroup) { wgpuBindGroupRelease(_gpuBindGroupObj->bindgroup); } @@ -232,14 +232,14 @@ void CCWGPUDescriptorSet::prepare() { } _isDirty = false; if (buffIter != _buffers.end()) - std::for_each(_buffers.begin(), _buffers.end(), [](Buffer* buffer) { + std::for_each(_buffers.begin(), _buffers.end(), [](Buffer *buffer) { if (buffer) - static_cast(buffer)->stamp(); + static_cast(buffer)->stamp(); }); if (texIter != _textures.end()) - std::for_each(_textures.begin(), _textures.end(), [](Texture* texture) { + std::for_each(_textures.begin(), _textures.end(), [](Texture *texture) { if (texture) - static_cast(texture)->stamp(); + static_cast(texture)->stamp(); }); } } @@ -248,11 +248,11 @@ uint8_t CCWGPUDescriptorSet::dynamicOffsetCount() const { return _dynamicOffsets.size(); } -void* CCWGPUDescriptorSet::defaultBindGroup() { - CCWGPUDeviceObject* deviceObj = CCWGPUDevice::getInstance()->gpuDeviceObject(); +void *CCWGPUDescriptorSet::defaultBindGroup() { + CCWGPUDeviceObject *deviceObj = CCWGPUDevice::getInstance()->gpuDeviceObject(); if (!anoymous::defaultBindGroup) { - CCWGPUBuffer* buffer = deviceObj->defaultResources.uniformBuffer; + CCWGPUBuffer * buffer = deviceObj->defaultResources.uniformBuffer; WGPUBindGroupEntry bufferEntry = { .binding = 0, .buffer = buffer->gpuBufferObject()->wgpuBuffer, diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h index 66e5d627d4..e9d099bfe0 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h @@ -42,7 +42,7 @@ public: CCWGPUDescriptorSet(); ~CCWGPUDescriptorSet() = default; - inline CCWGPUBindGroupObject* gpuBindGroupObject() { return _gpuBindGroupObj; } + inline CCWGPUBindGroupObject *gpuBindGroupObject() { return _gpuBindGroupObj; } void update() override; @@ -50,19 +50,19 @@ public: void prepare(); - static void* defaultBindGroup(); + static void *defaultBindGroup(); - inline Pairs& dynamicOffsets() { return _dynamicOffsets; } + inline Pairs &dynamicOffsets() { return _dynamicOffsets; } // void* bgl() const{return _bgl;} // DescriptorSetLayout* local()const {return _local;} protected: - void doInit(const DescriptorSetInfo& info) override; + void doInit(const DescriptorSetInfo &info) override; void doDestroy() override; - CCWGPUBindGroupObject* _gpuBindGroupObj = nullptr; + CCWGPUBindGroupObject *_gpuBindGroupObj = nullptr; // seperate combined sampler-texture index std::map _textureIdxMap; diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp index d0c1edc1d0..c09490049c 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp @@ -49,7 +49,7 @@ using namespace anoymous; CCWGPUDescriptorSetLayout::CCWGPUDescriptorSetLayout() : wrapper(val::object()) { } -void CCWGPUDescriptorSetLayout::doInit(const DescriptorSetLayoutInfo& info) { +void CCWGPUDescriptorSetLayout::doInit(const DescriptorSetLayoutInfo &info) { _gpuLayoutEntryObj = CC_NEW(CCWGPUBindGroupLayoutObject); for (size_t i = 0; i < _bindings.size(); i++) { if (_bindings[i].descriptorType == DescriptorType::UNKNOWN) @@ -128,8 +128,8 @@ void CCWGPUDescriptorSetLayout::doInit(const DescriptorSetLayoutInfo& info) { (void)defaultBindGroupLayout(); } -void CCWGPUDescriptorSetLayout::updateLayout(uint8_t binding, const CCWGPUBuffer* buffer, const CCWGPUTexture* tex, const CCWGPUSampler* sampler) { - auto iter = std::find_if(_gpuLayoutEntryObj->bindGroupLayoutEntries.begin(), _gpuLayoutEntryObj->bindGroupLayoutEntries.end(), [binding](const WGPUBindGroupLayoutEntry& entry) { +void CCWGPUDescriptorSetLayout::updateLayout(uint8_t binding, const CCWGPUBuffer *buffer, const CCWGPUTexture *tex, const CCWGPUSampler *sampler) { + auto iter = std::find_if(_gpuLayoutEntryObj->bindGroupLayoutEntries.begin(), _gpuLayoutEntryObj->bindGroupLayoutEntries.end(), [binding](const WGPUBindGroupLayoutEntry &entry) { return entry.binding == binding; }); @@ -138,7 +138,7 @@ void CCWGPUDescriptorSetLayout::updateLayout(uint8_t binding, const CCWGPUBuffer // } if (sampler) { - const SamplerInfo& info = sampler->getInfo(); + const SamplerInfo &info = sampler->getInfo(); if (info.minFilter == Filter::POINT && info.magFilter == Filter::POINT && info.mipFilter == Filter::POINT) (*iter).sampler.type = WGPUSamplerBindingType::WGPUSamplerBindingType_NonFiltering; else @@ -154,7 +154,7 @@ void CCWGPUDescriptorSetLayout::updateLayout(uint8_t binding, const CCWGPUBuffer } else { (*iter).texture.nextInChain = nullptr; (*iter).texture.sampleType = textureSampleTypeTrait(tex->getFormat()); - const CCWGPUTexture* ccTex = static_cast(tex->isTextureView() ? tex->getViewInfo().texture : tex); + const CCWGPUTexture *ccTex = static_cast(tex->isTextureView() ? tex->getViewInfo().texture : tex); TextureType type = ccTex->getViewInfo().type; (*iter).texture.viewDimension = toWGPUTextureViewDimension(type); (*iter).texture.multisampled = ccTex->getInfo().samples != SampleCount::ONE; @@ -164,7 +164,7 @@ void CCWGPUDescriptorSetLayout::updateLayout(uint8_t binding, const CCWGPUBuffer } size_t CCWGPUDescriptorSetLayout::hash() const { - const auto& entries = _gpuLayoutEntryObj->bindGroupLayoutEntries; + const auto &entries = _gpuLayoutEntryObj->bindGroupLayoutEntries; // size_t seed = 129; // boost::hash_combine(seed, entries.size()); // for(size_t i = 0; i < entries.size(); i++) { @@ -180,7 +180,7 @@ size_t CCWGPUDescriptorSetLayout::hash() const { std::size_t seed = entries.size(); for (size_t i = 0; i < entries.size(); i++) { - const auto& entry = entries[i]; + const auto &entry = entries[i]; hashStr += std::to_string(entry.binding); hashStr += std::to_string(entry.visibility); if (entry.buffer.type != WGPUBufferBindingType_Undefined) { @@ -209,9 +209,9 @@ size_t CCWGPUDescriptorSetLayout::hash() const { void CCWGPUDescriptorSetLayout::print() const { size_t hashVal = this->hash(); printf("pr this %p %p %zu\n", _gpuLayoutEntryObj, this, hashVal); - const auto& entries = _gpuLayoutEntryObj->bindGroupLayoutEntries; + const auto &entries = _gpuLayoutEntryObj->bindGroupLayoutEntries; for (size_t j = 0; j < entries.size(); j++) { - const auto& entry = entries[j]; + const auto &entry = entries[j]; if ((entry.buffer.type != WGPUBufferBindingType_Undefined) + (entry.sampler.type != WGPUSamplerBindingType_Undefined) + (entry.texture.sampleType != WGPUTextureSampleType_Undefined) + @@ -253,7 +253,7 @@ void CCWGPUDescriptorSetLayout::prepare(bool forceUpdate) { _gpuLayoutEntryObj->bindGroupLayout = iter->second; return; } - const auto& entries = _gpuLayoutEntryObj->bindGroupLayoutEntries; + const auto &entries = _gpuLayoutEntryObj->bindGroupLayoutEntries; // for (size_t j = 0; j < entries.size(); j++) { // const auto& entry = entries[j]; @@ -282,7 +282,7 @@ void CCWGPUDescriptorSetLayout::prepare(bool forceUpdate) { layoutPool.insert({hashVal, _gpuLayoutEntryObj->bindGroupLayout}); } -void* CCWGPUDescriptorSetLayout::defaultBindGroupLayout() { +void *CCWGPUDescriptorSetLayout::defaultBindGroupLayout() { if (!anoymous::defaultBindgroupLayout) { // default bindgroupLayout: for empty set WGPUBindGroupLayoutEntry layout = { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.h b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.h index 267d7fb3a7..dc148f3e9d 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.h @@ -43,25 +43,25 @@ public: CCWGPUDescriptorSetLayout(); ~CCWGPUDescriptorSetLayout() = default; - inline CCWGPUBindGroupLayoutObject* gpuLayoutEntryObject() { return _gpuLayoutEntryObj; } + inline CCWGPUBindGroupLayoutObject *gpuLayoutEntryObject() { return _gpuLayoutEntryObj; } - void updateLayout(uint8_t binding, const CCWGPUBuffer* buffer = nullptr, const CCWGPUTexture* tex = nullptr, const CCWGPUSampler* sampler = nullptr); + void updateLayout(uint8_t binding, const CCWGPUBuffer *buffer = nullptr, const CCWGPUTexture *tex = nullptr, const CCWGPUSampler *sampler = nullptr); void prepare(bool forceUpdate = false); inline uint8_t dynamicOffsetCount() { return _dynamicOffsetCount; } - static void* defaultBindGroupLayout(); + static void *defaultBindGroupLayout(); void print() const; protected: - void doInit(const DescriptorSetLayoutInfo& info) override; + void doInit(const DescriptorSetLayoutInfo &info) override; void doDestroy() override; size_t hash() const; - CCWGPUBindGroupLayoutObject* _gpuLayoutEntryObj = nullptr; + CCWGPUBindGroupLayoutObject *_gpuLayoutEntryObj = nullptr; uint8_t _dynamicOffsetCount = 0; }; diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDevice.cpp b/native/cocos/renderer/gfx-wgpu/WGPUDevice.cpp index bd4f550e5d..e7c332dbc2 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDevice.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUDevice.cpp @@ -50,16 +50,16 @@ namespace cc { namespace gfx { struct BufferMapData { - Semaphore* semaphore = nullptr; + Semaphore * semaphore = nullptr; WGPUBuffer buffer = wgpuDefaultHandle; - emscripten::val* retBuffer = nullptr; + emscripten::val *retBuffer = nullptr; uint64_t size = 0; bool finished = false; }; -CCWGPUDevice* CCWGPUDevice::instance = nullptr; +CCWGPUDevice *CCWGPUDevice::instance = nullptr; -CCWGPUDevice* CCWGPUDevice::getInstance() { +CCWGPUDevice *CCWGPUDevice::getInstance() { // if JS if (!instance) { instance = new CCWGPUDevice(); @@ -83,7 +83,7 @@ CCWGPUDevice::~CCWGPUDevice() { delete this; } -bool CCWGPUDevice::doInit(const DeviceInfo& info) { +bool CCWGPUDevice::doInit(const DeviceInfo &info) { _gpuDeviceObj = CC_NEW(CCWGPUDeviceObject); _gpuDeviceObj->wgpuDevice = emscripten_webgpu_get_device(); _gpuDeviceObj->wgpuQueue = wgpuDeviceGetQueue(_gpuDeviceObj->wgpuDevice); @@ -110,62 +110,62 @@ bool CCWGPUDevice::doInit(const DeviceInfo& info) { void CCWGPUDevice::doDestroy() { } -Swapchain* CCWGPUDevice::createSwapchain() { +Swapchain *CCWGPUDevice::createSwapchain() { return new CCWGPUSwapchain(this); } -Queue* CCWGPUDevice::createQueue() { +Queue *CCWGPUDevice::createQueue() { return CC_NEW(CCWGPUQueue); } -Buffer* CCWGPUDevice::createBuffer() { +Buffer *CCWGPUDevice::createBuffer() { return CC_NEW(CCWGPUBuffer); } -Texture* CCWGPUDevice::createTexture() { +Texture *CCWGPUDevice::createTexture() { return CC_NEW(CCWGPUTexture); } -Shader* CCWGPUDevice::createShader() { +Shader *CCWGPUDevice::createShader() { return CC_NEW(CCWGPUShader); } -InputAssembler* CCWGPUDevice::createInputAssembler() { +InputAssembler *CCWGPUDevice::createInputAssembler() { return CC_NEW(CCWGPUInputAssembler); } -RenderPass* CCWGPUDevice::createRenderPass() { +RenderPass *CCWGPUDevice::createRenderPass() { return CC_NEW(CCWGPURenderPass); } -Framebuffer* CCWGPUDevice::createFramebuffer() { +Framebuffer *CCWGPUDevice::createFramebuffer() { return CC_NEW(CCWGPUFramebuffer); } -DescriptorSet* CCWGPUDevice::createDescriptorSet() { +DescriptorSet *CCWGPUDevice::createDescriptorSet() { return CC_NEW(CCWGPUDescriptorSet); } -DescriptorSetLayout* CCWGPUDevice::createDescriptorSetLayout() { +DescriptorSetLayout *CCWGPUDevice::createDescriptorSetLayout() { return CC_NEW(CCWGPUDescriptorSetLayout); } -PipelineLayout* CCWGPUDevice::createPipelineLayout() { +PipelineLayout *CCWGPUDevice::createPipelineLayout() { return CC_NEW(CCWGPUPipelineLayout); } -PipelineState* CCWGPUDevice::createPipelineState() { +PipelineState *CCWGPUDevice::createPipelineState() { return CC_NEW(CCWGPUPipelineState); } -CommandBuffer* CCWGPUDevice::createCommandBuffer(const CommandBufferInfo& info, bool hasAgent) { +CommandBuffer *CCWGPUDevice::createCommandBuffer(const CommandBufferInfo &info, bool hasAgent) { return CC_NEW(CCWGPUCommandBuffer); } -void CCWGPUDevice::copyBuffersToTexture(const uint8_t* const* buffers, Texture* dst, const BufferTextureCopy* regions, uint count) { +void CCWGPUDevice::copyBuffersToTexture(const uint8_t *const *buffers, Texture *dst, const BufferTextureCopy *regions, uint count) { Format dstFormat = dst->getFormat(); uint32_t pxSize = GFX_FORMAT_INFOS[static_cast(dstFormat)].size; - auto* texture = static_cast(dst); + auto * texture = static_cast(dst); for (size_t i = 0; i < count; i++) { uint32_t bufferSize = pxSize * regions[i].texExtent.width * regions[i].texExtent.height; @@ -212,16 +212,16 @@ void CCWGPUDevice::copyBuffersToTexture(const uint8_t* const* buffers, Texture* } } -void onQueueDone(WGPUQueueWorkDoneStatus status, void* userdata) { +void onQueueDone(WGPUQueueWorkDoneStatus status, void *userdata) { printf("Q done beg\n"); if (status == WGPUQueueWorkDoneStatus_Success) { printf("Q done beg0\n"); - auto* bufferMapData = static_cast(userdata); + auto *bufferMapData = static_cast(userdata); printf("Q done beg1\n"); // auto* mappedBuffer = wgpuBufferGetMappedRange(bufferMapData->buffer, 0, bufferMapData->size); - auto* mappedBuffer = (uint8_t*)malloc(static_cast(bufferMapData->size)); + auto *mappedBuffer = (uint8_t *)malloc(static_cast(bufferMapData->size)); printf("Q done beg2\n"); - *bufferMapData->retBuffer = emscripten::val(emscripten::typed_memory_view(bufferMapData->size, static_cast(mappedBuffer))); + *bufferMapData->retBuffer = emscripten::val(emscripten::typed_memory_view(bufferMapData->size, static_cast(mappedBuffer))); printf("Q suc %d\n", bufferMapData->size); bufferMapData->finished = true; // memcpy(bufferMapData->dst, mappedBuffer, bufferMapData->size); @@ -229,13 +229,13 @@ void onQueueDone(WGPUQueueWorkDoneStatus status, void* userdata) { printf("Q done\n"); } -emscripten::val CCWGPUDevice::copyTextureToBuffers(Texture* src, const BufferTextureCopyList& regions) { - auto* texture = static_cast(src); +emscripten::val CCWGPUDevice::copyTextureToBuffers(Texture *src, const BufferTextureCopyList ®ions) { + auto * texture = static_cast(src); Format dstFormat = src->getFormat(); uint32_t pxSize = GFX_FORMAT_INFOS[static_cast(dstFormat)].size; auto wgpuCommandEncoder = wgpuDeviceCreateCommandEncoder(CCWGPUDevice::getInstance()->gpuDeviceObject()->wgpuDevice, nullptr); - uint64_t size = std::accumulate(regions.begin(), regions.end(), 0, [pxSize](uint64_t initVal, const BufferTextureCopy& in) { + uint64_t size = std::accumulate(regions.begin(), regions.end(), 0, [pxSize](uint64_t initVal, const BufferTextureCopy &in) { uint32_t bytesPerRow = (pxSize * in.texExtent.width + 255) / 256 * 256; uint32_t bufferSize = bytesPerRow * in.texExtent.height * in.texExtent.depth; return initVal + bufferSize; @@ -288,7 +288,7 @@ emscripten::val CCWGPUDevice::copyTextureToBuffers(Texture* src, const BufferTex wgpuQueueSubmit(CCWGPUDevice::getInstance()->gpuDeviceObject()->wgpuQueue, 1, &wgpuCommandBuffer); printf("Q submit\n"); Semaphore sem{0}; - BufferMapData* bufferMapData = new BufferMapData{ + BufferMapData *bufferMapData = new BufferMapData{ &sem, buffer, nullptr, @@ -305,33 +305,33 @@ emscripten::val CCWGPUDevice::copyTextureToBuffers(Texture* src, const BufferTex return *bufferMapData->retBuffer; } -void CCWGPUDevice::copyTextureToBuffers(Texture* src, uint8_t* const* buffers, const BufferTextureCopy* region, uint count) { +void CCWGPUDevice::copyTextureToBuffers(Texture *src, uint8_t *const *buffers, const BufferTextureCopy *region, uint count) { } -void CCWGPUDevice::acquire(Swapchain* const* swapchains, uint32_t count) { - for (auto* swapchain : _swapchains) { +void CCWGPUDevice::acquire(Swapchain *const *swapchains, uint32_t count) { + for (auto *swapchain : _swapchains) { swapchain->update(); } } -Shader* CCWGPUDevice::createShader(const SPVShaderInfoInstance& info) { - CCWGPUShader* shader = CC_NEW(CCWGPUShader); +Shader *CCWGPUDevice::createShader(const SPVShaderInfoInstance &info) { + CCWGPUShader *shader = CC_NEW(CCWGPUShader); shader->initialize(info); return shader; } -QueryPool* CCWGPUDevice::createQueryPool() { +QueryPool *CCWGPUDevice::createQueryPool() { return CC_NEW(CCWGPUQueryPool); } -Sampler* CCWGPUDevice::createSampler(const SamplerInfo& info) { +Sampler *CCWGPUDevice::createSampler(const SamplerInfo &info) { return new CCWGPUSampler(info); } void CCWGPUDevice::present() { } -void CCWGPUDevice::getQueryPoolResults(QueryPool* queryPool) { +void CCWGPUDevice::getQueryPoolResults(QueryPool *queryPool) { // _cmdBuff->getQueryPoolResults(queryPool); } diff --git a/native/cocos/renderer/gfx-wgpu/WGPUFrameBuffer.cpp b/native/cocos/renderer/gfx-wgpu/WGPUFrameBuffer.cpp index 42b9005dae..5479d4a66c 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUFrameBuffer.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUFrameBuffer.cpp @@ -33,10 +33,10 @@ namespace gfx { CCWGPUFramebuffer::CCWGPUFramebuffer() : wrapper(val::object()) { } -void CCWGPUFramebuffer::doInit(const FramebufferInfo& info) { - for (auto* tex : info.colorTextures) { - auto* ccTex = static_cast(tex); - CCWGPUSwapchain* swapchain = ccTex->swapchain(); +void CCWGPUFramebuffer::doInit(const FramebufferInfo &info) { + for (auto *tex : info.colorTextures) { + auto * ccTex = static_cast(tex); + CCWGPUSwapchain *swapchain = ccTex->swapchain(); if (swapchain) { _swapchain = swapchain; break; @@ -44,7 +44,7 @@ void CCWGPUFramebuffer::doInit(const FramebufferInfo& info) { } if (_depthStencilTexture) { - CCWGPUSwapchain* swapchain = static_cast(_depthStencilTexture)->swapchain(); + CCWGPUSwapchain *swapchain = static_cast(_depthStencilTexture)->swapchain(); if (swapchain) { _swapchain = swapchain; } diff --git a/native/cocos/renderer/gfx-wgpu/WGPUFrameBuffer.h b/native/cocos/renderer/gfx-wgpu/WGPUFrameBuffer.h index 199455a093..a66ddbef64 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUFrameBuffer.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUFrameBuffer.h @@ -37,13 +37,13 @@ public: CCWGPUFramebuffer(); ~CCWGPUFramebuffer() = default; - inline CCWGPUSwapchain* swapchain() { return _swapchain; } + inline CCWGPUSwapchain *swapchain() { return _swapchain; } protected: - void doInit(const FramebufferInfo& info) override; + void doInit(const FramebufferInfo &info) override; void doDestroy() override; - CCWGPUSwapchain* _swapchain = nullptr; + CCWGPUSwapchain *_swapchain = nullptr; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-wgpu/WGPUInputAssembler.cpp b/native/cocos/renderer/gfx-wgpu/WGPUInputAssembler.cpp index bb018df445..c8594d934e 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUInputAssembler.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUInputAssembler.cpp @@ -33,7 +33,7 @@ namespace gfx { CCWGPUInputAssembler::CCWGPUInputAssembler() : wrapper(val::object()) { } -void CCWGPUInputAssembler::doInit(const InputAssemblerInfo& info) { +void CCWGPUInputAssembler::doInit(const InputAssemblerInfo &info) { _gpuInputAssemblerObj = CC_NEW(CCWGPUInputAssemblerObject); // // typedef struct WGPUVertexState { // // WGPUChainedStruct const * nextInChain; @@ -50,7 +50,7 @@ void CCWGPUInputAssembler::doInit(const InputAssemblerInfo& info) { void CCWGPUInputAssembler::doDestroy() { } -void CCWGPUInputAssembler::update(const DrawInfo& info) { +void CCWGPUInputAssembler::update(const DrawInfo &info) { _drawInfo = info; } diff --git a/native/cocos/renderer/gfx-wgpu/WGPUInputAssembler.h b/native/cocos/renderer/gfx-wgpu/WGPUInputAssembler.h index fa0aaab3a8..65a9db4fe7 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUInputAssembler.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUInputAssembler.h @@ -37,16 +37,16 @@ public: CCWGPUInputAssembler(); ~CCWGPUInputAssembler() = default; - inline CCWGPUInputAssemblerObject* gpuInputAssemblerObject() { return _gpuInputAssemblerObj; } + inline CCWGPUInputAssemblerObject *gpuInputAssemblerObject() { return _gpuInputAssemblerObj; } // ems export - void update(const DrawInfo& info); + void update(const DrawInfo &info); protected: - void doInit(const InputAssemblerInfo& info) override; + void doInit(const InputAssemblerInfo &info) override; void doDestroy() override; - CCWGPUInputAssemblerObject* _gpuInputAssemblerObj = nullptr; + CCWGPUInputAssemblerObject *_gpuInputAssemblerObj = nullptr; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-wgpu/WGPUObject.h b/native/cocos/renderer/gfx-wgpu/WGPUObject.h index b803ab69a3..8296e8a9b4 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUObject.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUObject.h @@ -54,13 +54,13 @@ class CCWGPUDescriptorSet; class CCWGPUInputAssembler; struct CCWGPUResource { - CCWGPUBuffer* uniformBuffer = nullptr; - CCWGPUBuffer* storageBuffer = nullptr; + CCWGPUBuffer *uniformBuffer = nullptr; + CCWGPUBuffer *storageBuffer = nullptr; - CCWGPUTexture* commonTexture = nullptr; - CCWGPUTexture* storageTexture = nullptr; + CCWGPUTexture *commonTexture = nullptr; + CCWGPUTexture *storageTexture = nullptr; - CCWGPUSampler* sampler = nullptr; + CCWGPUSampler *sampler = nullptr; }; struct CCWGPUDeviceObject { @@ -75,15 +75,15 @@ struct CCWGPUSwapchainObject { WGPUSurface wgpuSurface = wgpuDefaultHandle; WGPUInstance wgpuInstance = wgpuDefaultHandle; - CCWGPUTexture* swapchainColor = nullptr; - CCWGPUTexture* swapchainDepthStencil = nullptr; + CCWGPUTexture *swapchainColor = nullptr; + CCWGPUTexture *swapchainDepthStencil = nullptr; }; struct CCWGPURenderPassObject { RenderPassInfo info; String label; uint8_t sampleCount = 1; - WGPURenderPassDescriptor* wgpuRenderPassDesc = wgpuDefaultHandle; + WGPURenderPassDescriptor *wgpuRenderPassDesc = wgpuDefaultHandle; }; struct CCWGPUTextureObject { @@ -189,9 +189,9 @@ struct CCWGPUQueueObject { struct CCWGPUDescriptorSetObject { uint32_t index = 0; - CCWGPUDescriptorSet* descriptorSet = nullptr; + CCWGPUDescriptorSet *descriptorSet = nullptr; uint32_t dynamicOffsetCount = 0; - const uint32_t* dynamicOffsets = nullptr; + const uint32_t * dynamicOffsets = nullptr; }; struct CCWGPUStencilMasks { @@ -201,8 +201,8 @@ struct CCWGPUStencilMasks { }; struct CCWGPUStateCache { - CCWGPUPipelineState* pipelineState = nullptr; - CCWGPUInputAssembler* inputAssembler = nullptr; + CCWGPUPipelineState * pipelineState = nullptr; + CCWGPUInputAssembler *inputAssembler = nullptr; float depthBiasConstant = 0.0f; float depthBiasClamp = 0.0f; @@ -228,12 +228,12 @@ struct CCWGPUCommandBufferObject { WGPURenderPassEncoder wgpuRenderPassEncoder = wgpuDefaultHandle; WGPUComputePassEncoder wgpuComputeEncoder = wgpuDefaultHandle; CommandBufferType type = CommandBufferType::PRIMARY; - CCWGPUQueue* queue = nullptr; + CCWGPUQueue * queue = nullptr; WGPURenderPassDescriptor renderPassDescriptor; CCWGPUStateCache stateCache; - std::map redundantVertexBufferMap; + std::map redundantVertexBufferMap; }; struct CCWGPUQueryPoolObject { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp index 6347c7e253..98218ea125 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp @@ -37,15 +37,15 @@ using namespace emscripten; CCWGPUPipelineLayout::CCWGPUPipelineLayout() : wrapper(val::object()) { } -void CCWGPUPipelineLayout::doInit(const PipelineLayoutInfo& info) { +void CCWGPUPipelineLayout::doInit(const PipelineLayoutInfo &info) { _gpuPipelineLayoutObj = CC_NEW(CCWGPUPipelineLayoutObject); } -void CCWGPUPipelineLayout::prepare(const std::set& setInUse) { +void CCWGPUPipelineLayout::prepare(const std::set &setInUse) { std::vector layouts; // _bgLayouts.clear(); for (size_t i = 0; i < _setLayouts.size(); i++) { - auto* descriptorSetLayout = static_cast(_setLayouts[i]); + auto *descriptorSetLayout = static_cast(_setLayouts[i]); if (setInUse.find(i) == setInUse.end()) { // give it default bindgrouplayout if not in use layouts.push_back(static_cast(CCWGPUDescriptorSetLayout::defaultBindGroupLayout())); diff --git a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h index e61440cdf2..7e54c3df3a 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h @@ -38,18 +38,18 @@ public: CCWGPUPipelineLayout(); ~CCWGPUPipelineLayout() = default; - inline CCWGPUPipelineLayoutObject* gpuPipelineLayoutObject() { return _gpuPipelineLayoutObj; } + inline CCWGPUPipelineLayoutObject *gpuPipelineLayoutObject() { return _gpuPipelineLayoutObj; } //bindgroup not ready yet so delay creation - void prepare(const std::set& setInUse); + void prepare(const std::set &setInUse); // const std::vector & layouts()const{return _bgLayouts;} protected: - void doInit(const PipelineLayoutInfo& info) override; + void doInit(const PipelineLayoutInfo &info) override; void doDestroy() override; - CCWGPUPipelineLayoutObject* _gpuPipelineLayoutObj = nullptr; + CCWGPUPipelineLayoutObject *_gpuPipelineLayoutObj = nullptr; // std::vector _bgLayouts; }; diff --git a/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp b/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp index 6d3709ae4f..461b76af88 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp @@ -42,31 +42,31 @@ using namespace emscripten; CCWGPUPipelineState::CCWGPUPipelineState() : wrapper(val::object()) { } -void CCWGPUPipelineState::doInit(const PipelineStateInfo& info) { +void CCWGPUPipelineState::doInit(const PipelineStateInfo &info) { _gpuPipelineStateObj = CC_NEW(CCWGPUPipelineStateObject); } -void CCWGPUPipelineState::check(RenderPass* renderPass) { +void CCWGPUPipelineState::check(RenderPass *renderPass) { if (_renderPass != renderPass) { _renderPass = renderPass; _forceUpdate = true; } } -void CCWGPUPipelineState::prepare(const std::set& setInUse) { - auto* pipelineLayout = static_cast(_pipelineLayout); +void CCWGPUPipelineState::prepare(const std::set &setInUse) { + auto *pipelineLayout = static_cast(_pipelineLayout); - const DepthStencilAttachment& dsAttachment = _renderPass->getDepthStencilAttachment(); + const DepthStencilAttachment &dsAttachment = _renderPass->getDepthStencilAttachment(); if (_bindPoint == PipelineBindPoint::GRAPHICS) { if (_gpuPipelineStateObj->wgpuRenderPipeline && !_forceUpdate) { return; } - auto maxStreamAttr = std::max_element(_inputState.attributes.begin(), _inputState.attributes.end(), [&](const Attribute& lhs, const Attribute& rhs) { + auto maxStreamAttr = std::max_element(_inputState.attributes.begin(), _inputState.attributes.end(), [&](const Attribute &lhs, const Attribute &rhs) { return lhs.stream < rhs.stream; }); - auto longestAttr = std::max_element(_inputState.attributes.begin(), _inputState.attributes.end(), [&](const Attribute& lhs, const Attribute& rhs) { + auto longestAttr = std::max_element(_inputState.attributes.begin(), _inputState.attributes.end(), [&](const Attribute &lhs, const Attribute &rhs) { return GFX_FORMAT_INFOS[static_cast(lhs.format)].size < GFX_FORMAT_INFOS[static_cast(rhs.format)].size; }); uint8_t mostToleranceStream = (*longestAttr).stream; @@ -76,7 +76,7 @@ void CCWGPUPipelineState::prepare(const std::set& setInUse) { std::vector vbLayouts(streamCount); std::vector> wgpuAttrsVec(streamCount); - const AttributeList& attrs = _shader->getAttributes(); + const AttributeList &attrs = _shader->getAttributes(); uint64_t offset[256] = {0}; // std::vector wgpuAttrs; bool isInstance = attrs.empty() ? false : attrs[0].isInstanced; @@ -85,7 +85,7 @@ void CCWGPUPipelineState::prepare(const std::set& setInUse) { // wgpuAttrsVec[0] ∪ wgpuAttrsVec[1] ∪ ... ∪ wgpuAttrsVec[n] == shader.attrs for (size_t i = 0; i < attrs.size(); i++) { String attrName = attrs[i].name; - auto iter = std::find_if(_inputState.attributes.begin(), _inputState.attributes.end(), [attrName](const Attribute& attr) { + auto iter = std::find_if(_inputState.attributes.begin(), _inputState.attributes.end(), [attrName](const Attribute &attr) { return strcmp(attrName.c_str(), attr.name.c_str()) == 0; }); @@ -123,8 +123,8 @@ void CCWGPUPipelineState::prepare(const std::set& setInUse) { // input state has attr which shader hasnt. for (size_t i = 0; i < _inputState.attributes.size(); ++i) { String attrName = _inputState.attributes[i].name; - const auto& attribute = _inputState.attributes[i]; - auto iter = std::find_if(attrs.begin(), attrs.end(), [attrName](const Attribute& attr) { + const auto &attribute = _inputState.attributes[i]; + auto iter = std::find_if(attrs.begin(), attrs.end(), [attrName](const Attribute &attr) { return strcmp(attrName.c_str(), attr.name.c_str()) == 0; }); if (iter == attrs.end()) { @@ -156,7 +156,7 @@ void CCWGPUPipelineState::prepare(const std::set& setInUse) { WGPUVertexState vertexState = { .nextInChain = nullptr, - .module = static_cast(_shader)->gpuShaderObject()->wgpuShaderVertexModule, + .module = static_cast(_shader)->gpuShaderObject()->wgpuShaderVertexModule, .entryPoint = "main", .bufferCount = vbLayouts.size(), .buffers = vbLayouts.data(), @@ -203,12 +203,12 @@ void CCWGPUPipelineState::prepare(const std::set& setInUse) { }; WGPUMultisampleState msState = { - .count = static_cast(_renderPass)->gpuRenderPassObject()->sampleCount, + .count = static_cast(_renderPass)->gpuRenderPassObject()->sampleCount, .mask = 0xFFFFFFFF, .alphaToCoverageEnabled = _blendState.isA2C != 0, }; - const ColorAttachmentList& colors = _renderPass->getColorAttachments(); + const ColorAttachmentList & colors = _renderPass->getColorAttachments(); std::vector colorTargetStates(colors.size()); std::vector blendState(colors.size()); @@ -233,7 +233,7 @@ void CCWGPUPipelineState::prepare(const std::set& setInUse) { } WGPUFragmentState fragmentState = { - .module = static_cast(_shader)->gpuShaderObject()->wgpuShaderFragmentModule, + .module = static_cast(_shader)->gpuShaderObject()->wgpuShaderFragmentModule, .entryPoint = "main", .targetCount = colorTargetStates.size(), .targets = colorTargetStates.data(), @@ -266,7 +266,7 @@ void CCWGPUPipelineState::prepare(const std::set& setInUse) { if (_gpuPipelineStateObj->wgpuComputePipeline) return; WGPUProgrammableStageDescriptor psDesc = { - .module = static_cast(_shader)->gpuShaderObject()->wgpuShaderComputeModule, + .module = static_cast(_shader)->gpuShaderObject()->wgpuShaderComputeModule, .entryPoint = "main", }; pipelineLayout->prepare(setInUse); diff --git a/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.h b/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.h index 1a13fe4a85..8fb1ccae45 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.h @@ -38,21 +38,21 @@ public: CCWGPUPipelineState(); ~CCWGPUPipelineState() = default; - inline CCWGPUPipelineStateObject* gpuPipelineStateObject() { return _gpuPipelineStateObj; } + inline CCWGPUPipelineStateObject *gpuPipelineStateObject() { return _gpuPipelineStateObj; } - void check(RenderPass* renderPass); + void check(RenderPass *renderPass); - void prepare(const std::set& setInUse); + void prepare(const std::set &setInUse); - void* ppl() const { return _ppl; } + void *ppl() const { return _ppl; } protected: - void doInit(const PipelineStateInfo& info) override; + void doInit(const PipelineStateInfo &info) override; void doDestroy() override; - CCWGPUPipelineStateObject* _gpuPipelineStateObj = nullptr; + CCWGPUPipelineStateObject *_gpuPipelineStateObj = nullptr; - void* _ppl = nullptr; + void *_ppl = nullptr; bool _forceUpdate = false; }; diff --git a/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.cpp b/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.cpp index 9dd871770a..f85c6d44b1 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.cpp @@ -39,8 +39,8 @@ CCWGPUQueryPool::~CCWGPUQueryPool() { destroy(); } -void CCWGPUQueryPool::doInit(const QueryPoolInfo& /*info*/) { - CCWGPUDevice* device = CCWGPUDevice::getInstance(); +void CCWGPUQueryPool::doInit(const QueryPoolInfo & /*info*/) { + CCWGPUDevice *device = CCWGPUDevice::getInstance(); _gpuQueryPool = CC_NEW(CCWGPUQueryPoolObject); _gpuQueryPool->type = _type; _gpuQueryPool->maxQueryObjects = _maxQueryObjects; diff --git a/native/cocos/renderer/gfx-wgpu/WGPUQueue.cpp b/native/cocos/renderer/gfx-wgpu/WGPUQueue.cpp index 8a48623ec4..0a8c7e4477 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUQueue.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUQueue.cpp @@ -39,7 +39,7 @@ using namespace emscripten; CCWGPUQueue::CCWGPUQueue() : wrapper(val::object()) { } -void CCWGPUQueue::doInit(const QueueInfo& info) { +void CCWGPUQueue::doInit(const QueueInfo &info) { _gpuQueueObject = CC_NEW(CCWGPUQueueObject); _gpuQueueObject->type = info.type; _gpuQueueObject->wgpuQueue = wgpuDeviceGetQueue(CCWGPUDevice::getInstance()->gpuDeviceObject()->wgpuDevice); @@ -54,7 +54,7 @@ void CCWGPUQueue::doDestroy() { } } -void CCWGPUQueue::submit(CommandBuffer* const* cmdBuffs, uint count) { +void CCWGPUQueue::submit(CommandBuffer *const *cmdBuffs, uint count) { // std::vector commandBuffs(count); // for (size_t i = 0; i < count; i++) { // auto* commandBuff = static_cast(cmdBuffs[i]); diff --git a/native/cocos/renderer/gfx-wgpu/WGPUQueue.h b/native/cocos/renderer/gfx-wgpu/WGPUQueue.h index 943de1fdf1..2f12ce0747 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUQueue.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUQueue.h @@ -39,15 +39,15 @@ public: CCWGPUQueue(); ~CCWGPUQueue() = default; - void submit(CommandBuffer* const* cmdBuffs, uint count) override; + void submit(CommandBuffer *const *cmdBuffs, uint count) override; - inline CCWGPUQueueObject* gpuQueueObject() { return _gpuQueueObject; } + inline CCWGPUQueueObject *gpuQueueObject() { return _gpuQueueObject; } protected: - void doInit(const QueueInfo& info) override; + void doInit(const QueueInfo &info) override; void doDestroy() override; - CCWGPUQueueObject* _gpuQueueObject = nullptr; + CCWGPUQueueObject *_gpuQueueObject = nullptr; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-wgpu/WGPURenderPass.cpp b/native/cocos/renderer/gfx-wgpu/WGPURenderPass.cpp index 94f39aedc8..bfc52b5cb6 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPURenderPass.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPURenderPass.cpp @@ -36,7 +36,7 @@ using namespace emscripten; class CCWGPURenderPassHelper { public: - explicit CCWGPURenderPassHelper(const RenderPassInfo& info) { + explicit CCWGPURenderPassHelper(const RenderPassInfo &info) { SampleCount samples = SampleCount::ONE; for (size_t i = 0; i < info.colorAttachments.size(); i++) { colors[i].loadOp = toWGPULoadOp(info.colorAttachments[i].loadOp); @@ -77,14 +77,14 @@ public: std::array colors; std::array depthStencils; - WGPURenderPassDescriptor* renderPassDesc = nullptr; + WGPURenderPassDescriptor * renderPassDesc = nullptr; int sampleCount = 1; }; CCWGPURenderPass::CCWGPURenderPass() : wrapper(val::object()) { } -void CCWGPURenderPass::doInit(const RenderPassInfo& info) { +void CCWGPURenderPass::doInit(const RenderPassInfo &info) { _renderPassObject = new CCWGPURenderPassObject(); _rpHelper = new CCWGPURenderPassHelper(info); _renderPassObject->wgpuRenderPassDesc = _rpHelper->renderPassDesc; diff --git a/native/cocos/renderer/gfx-wgpu/WGPURenderPass.h b/native/cocos/renderer/gfx-wgpu/WGPURenderPass.h index 97bca92d25..fb35d6a673 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPURenderPass.h +++ b/native/cocos/renderer/gfx-wgpu/WGPURenderPass.h @@ -40,17 +40,17 @@ public: CCWGPURenderPass(); ~CCWGPURenderPass() = default; - inline CCWGPURenderPassObject* gpuRenderPassObject() { return _renderPassObject; } + inline CCWGPURenderPassObject *gpuRenderPassObject() { return _renderPassObject; } protected: - void doInit(const RenderPassInfo& info) override; + void doInit(const RenderPassInfo &info) override; void doDestroy() override; - CCWGPURenderPassObject* _renderPassObject = nullptr; - CCWGPURenderPassHelper* _rpHelper = nullptr; + CCWGPURenderPassObject *_renderPassObject = nullptr; + CCWGPURenderPassHelper *_rpHelper = nullptr; }; -inline CCWGPURenderPass* getThis(CCWGPURenderPass* that) { +inline CCWGPURenderPass *getThis(CCWGPURenderPass *that) { return that; } diff --git a/native/cocos/renderer/gfx-wgpu/WGPUSampler.cpp b/native/cocos/renderer/gfx-wgpu/WGPUSampler.cpp index 1b5f6d2a0d..fc3b486e06 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUSampler.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUSampler.cpp @@ -33,12 +33,12 @@ namespace cc { namespace gfx { namespace anoymous { -CCWGPUSampler* defaultSampler = nullptr; +CCWGPUSampler *defaultSampler = nullptr; } using namespace emscripten; -CCWGPUSampler::CCWGPUSampler(const SamplerInfo& info) : wrapper(val::object(), info) { +CCWGPUSampler::CCWGPUSampler(const SamplerInfo &info) : wrapper(val::object(), info) { WGPUSamplerDescriptor descriptor = { .nextInChain = nullptr, .label = nullptr, @@ -54,7 +54,7 @@ CCWGPUSampler::CCWGPUSampler(const SamplerInfo& info) : wrapper(val::ob .maxAnisotropy = static_cast(info.maxAnisotropy), }; - auto* device = CCWGPUDevice::getInstance(); + auto *device = CCWGPUDevice::getInstance(); _wgpuSampler = wgpuDeviceCreateSampler(device->gpuDeviceObject()->wgpuDevice, &descriptor); } @@ -62,7 +62,7 @@ CCWGPUSampler::~CCWGPUSampler() { wgpuSamplerRelease(_wgpuSampler); } -CCWGPUSampler* CCWGPUSampler::defaultSampler() { +CCWGPUSampler *CCWGPUSampler::defaultSampler() { if (!anoymous::defaultSampler) { SamplerInfo info = { .minFilter = Filter::LINEAR, diff --git a/native/cocos/renderer/gfx-wgpu/WGPUSampler.h b/native/cocos/renderer/gfx-wgpu/WGPUSampler.h index 287eb260a9..b49737d854 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUSampler.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUSampler.h @@ -35,12 +35,12 @@ namespace gfx { class CCWGPUSampler final : public emscripten::wrapper { public: EMSCRIPTEN_WRAPPER(CCWGPUSampler); - explicit CCWGPUSampler(const SamplerInfo& info); + explicit CCWGPUSampler(const SamplerInfo &info); ~CCWGPUSampler(); inline WGPUSampler gpuSampler() { return _wgpuSampler; } - static CCWGPUSampler* defaultSampler(); + static CCWGPUSampler *defaultSampler(); //stamp current state void stamp() {} diff --git a/native/cocos/renderer/gfx-wgpu/WGPUShader.cpp b/native/cocos/renderer/gfx-wgpu/WGPUShader.cpp index f37aaaac35..d616819195 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUShader.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUShader.cpp @@ -37,9 +37,9 @@ using namespace emscripten; CCWGPUShader::CCWGPUShader() : wrapper(val::object()) { } -void CCWGPUShader::initialize(const SPVShaderInfoInstance& spvInfo) { +void CCWGPUShader::initialize(const SPVShaderInfoInstance &spvInfo) { _gpuShaderObject = CC_NEW(CCWGPUShaderObject); - const ShaderInfo& info = spvInfo.info; + const ShaderInfo &info = spvInfo.info; _name = info.name; _stages = info.stages; @@ -54,8 +54,8 @@ void CCWGPUShader::initialize(const SPVShaderInfoInstance& spvInfo) { _gpuShaderObject->name = info.name; for (size_t i = 0; i < spvInfo.stages.size(); i++) { - const auto& stage = spvInfo.stages[i]; - auto* spvData = spvInfo.stages[i].spv.data(); + const auto &stage = spvInfo.stages[i]; + auto * spvData = spvInfo.stages[i].spv.data(); size_t size = spvInfo.stages[i].spv.size(); WGPUShaderModuleSPIRVDescriptor spv = {}; @@ -63,7 +63,7 @@ void CCWGPUShader::initialize(const SPVShaderInfoInstance& spvInfo) { spv.codeSize = size; spv.code = spvData; WGPUShaderModuleDescriptor desc = {}; - desc.nextInChain = reinterpret_cast(&spv); + desc.nextInChain = reinterpret_cast(&spv); desc.label = nullptr; if (stage.stage == ShaderStageFlagBit::VERTEX) { _gpuShaderObject->wgpuShaderVertexModule = wgpuDeviceCreateShaderModule(CCWGPUDevice::getInstance()->gpuDeviceObject()->wgpuDevice, &desc); @@ -77,7 +77,7 @@ void CCWGPUShader::initialize(const SPVShaderInfoInstance& spvInfo) { } } -void CCWGPUShader::doInit(const ShaderInfo& info) { +void CCWGPUShader::doInit(const ShaderInfo &info) { } void CCWGPUShader::doDestroy() { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUShader.h b/native/cocos/renderer/gfx-wgpu/WGPUShader.h index 0223f223cb..c46c694c8c 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUShader.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUShader.h @@ -40,15 +40,15 @@ public: CCWGPUShader(); ~CCWGPUShader() = default; - inline CCWGPUShaderObject* gpuShaderObject() { return _gpuShaderObject; } + inline CCWGPUShaderObject *gpuShaderObject() { return _gpuShaderObject; } - void initialize(const SPVShaderInfoInstance& info); + void initialize(const SPVShaderInfoInstance &info); protected: - void doInit(const ShaderInfo& info) override; + void doInit(const ShaderInfo &info) override; void doDestroy() override; - CCWGPUShaderObject* _gpuShaderObject = nullptr; + CCWGPUShaderObject *_gpuShaderObject = nullptr; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-wgpu/WGPUSwapchain.cpp b/native/cocos/renderer/gfx-wgpu/WGPUSwapchain.cpp index 8f6218f656..b751c1b4fc 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUSwapchain.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUSwapchain.cpp @@ -31,7 +31,7 @@ namespace cc { namespace gfx { -CCWGPUSwapchain::CCWGPUSwapchain(CCWGPUDevice* device) { +CCWGPUSwapchain::CCWGPUSwapchain(CCWGPUDevice *device) { _device = device; } @@ -39,13 +39,13 @@ CCWGPUSwapchain::~CCWGPUSwapchain() { _device = nullptr; } -void CCWGPUSwapchain::doInit(const SwapchainInfo& info) { +void CCWGPUSwapchain::doInit(const SwapchainInfo &info) { WGPUSurfaceDescriptorFromCanvasHTMLSelector canvDesc = {}; canvDesc.chain.sType = WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector; canvDesc.selector = "canvas"; WGPUSurfaceDescriptor surfDesc = {}; - surfDesc.nextInChain = reinterpret_cast(&canvDesc); + surfDesc.nextInChain = reinterpret_cast(&canvDesc); WGPUSurface surface = wgpuInstanceCreateSurface(nullptr, &surfDesc); WGPUPresentMode presentMode; @@ -69,7 +69,7 @@ void CCWGPUSwapchain::doInit(const SwapchainInfo& info) { presentMode = WGPUPresentMode_Fifo; } - auto* device = CCWGPUDevice::getInstance(); + auto * device = CCWGPUDevice::getInstance(); WGPUSwapChainDescriptor swapChainDesc; swapChainDesc.nextInChain = nullptr; swapChainDesc.label = "defaultSwapChain"; @@ -79,7 +79,7 @@ void CCWGPUSwapchain::doInit(const SwapchainInfo& info) { swapChainDesc.height = info.height; swapChainDesc.presentMode = presentMode; - CCWGPUDeviceObject* gpuDeviceObj = device->gpuDeviceObject(); + CCWGPUDeviceObject *gpuDeviceObj = device->gpuDeviceObject(); WGPUSwapChain swapChain = wgpuDeviceCreateSwapChain(gpuDeviceObj->wgpuDevice, surface, &swapChainDesc); _gpuSwapchainObj = CC_NEW(CCWGPUSwapchainObject); _gpuSwapchainObj->wgpuSwapChain = swapChain; @@ -119,22 +119,22 @@ void CCWGPUSwapchain::doResize(uint32_t width, uint32_t height, SurfaceTransform _depthStencilTexture->resize(height, height); } -CCWGPUTexture* CCWGPUSwapchain::getColorTexture() { - return static_cast(_colorTexture); +CCWGPUTexture *CCWGPUSwapchain::getColorTexture() { + return static_cast(_colorTexture); } -CCWGPUTexture* CCWGPUSwapchain::getDepthStencilTexture() { - return static_cast(_depthStencilTexture); +CCWGPUTexture *CCWGPUSwapchain::getDepthStencilTexture() { + return static_cast(_depthStencilTexture); } void CCWGPUSwapchain::update() { - static_cast(_colorTexture)->gpuTextureObject()->selfView = wgpuSwapChainGetCurrentTextureView(_gpuSwapchainObj->wgpuSwapChain); + static_cast(_colorTexture)->gpuTextureObject()->selfView = wgpuSwapChainGetCurrentTextureView(_gpuSwapchainObj->wgpuSwapChain); } void CCWGPUSwapchain::doDestroySurface() { } -void CCWGPUSwapchain::doCreateSurface(void* windowHandle) { +void CCWGPUSwapchain::doCreateSurface(void *windowHandle) { } } // namespace gfx diff --git a/native/cocos/renderer/gfx-wgpu/WGPUSwapchain.h b/native/cocos/renderer/gfx-wgpu/WGPUSwapchain.h index 817b66325b..8945583aa8 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUSwapchain.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUSwapchain.h @@ -37,28 +37,28 @@ class CCWGPUTexture; class CCWGPUDevice; class CCWGPUSwapchain final : public Swapchain { public: - CCWGPUSwapchain(CCWGPUDevice* device); + CCWGPUSwapchain(CCWGPUDevice *device); ~CCWGPUSwapchain(); - inline CCWGPUSwapchainObject* gpuSwapchainObject() { return _gpuSwapchainObj; } + inline CCWGPUSwapchainObject *gpuSwapchainObject() { return _gpuSwapchainObj; } - CCWGPUTexture* getColorTexture(); + CCWGPUTexture *getColorTexture(); - CCWGPUTexture* getDepthStencilTexture(); + CCWGPUTexture *getDepthStencilTexture(); void update(); protected: CCWGPUSwapchain() = delete; - void doInit(const SwapchainInfo& info) override; + void doInit(const SwapchainInfo &info) override; void doDestroy() override; void doResize(uint32_t width, uint32_t height, SurfaceTransform transform) override; void doDestroySurface() override; - void doCreateSurface(void* windowHandle) override; + void doCreateSurface(void *windowHandle) override; - CCWGPUSwapchainObject* _gpuSwapchainObj = nullptr; - CCWGPUDevice* _device = nullptr; + CCWGPUSwapchainObject *_gpuSwapchainObj = nullptr; + CCWGPUDevice * _device = nullptr; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-wgpu/WGPUTexture.h b/native/cocos/renderer/gfx-wgpu/WGPUTexture.h index c4dd4b403b..1985c36702 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUTexture.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUTexture.h @@ -39,13 +39,13 @@ public: CCWGPUTexture(); ~CCWGPUTexture() = default; - inline CCWGPUTextureObject* gpuTextureObject() { return _gpuTextureObj; } + inline CCWGPUTextureObject *gpuTextureObject() { return _gpuTextureObj; } - static CCWGPUTexture* defaultCommonTexture(); + static CCWGPUTexture *defaultCommonTexture(); - static CCWGPUTexture* defaultStorageTexture(); + static CCWGPUTexture *defaultStorageTexture(); - CCWGPUSwapchain* swapchain(); + CCWGPUSwapchain *swapchain(); // stamp current state void stamp(); @@ -54,14 +54,14 @@ public: inline bool internalChanged() const { return _internalChanged; } protected: - void doInit(const TextureInfo& info) override; - void doInit(const TextureViewInfo& info) override; + void doInit(const TextureInfo &info) override; + void doInit(const TextureViewInfo &info) override; void doDestroy() override; void doResize(uint32_t width, uint32_t height, uint32_t size) override; - void doInit(const SwapchainTextureInfo& info) override; + void doInit(const SwapchainTextureInfo &info) override; - CCWGPUTextureObject* _gpuTextureObj = nullptr; + CCWGPUTextureObject *_gpuTextureObj = nullptr; bool _internalChanged = false; }; diff --git a/native/cocos/renderer/gfx-wgpu/WGPUUtils.h b/native/cocos/renderer/gfx-wgpu/WGPUUtils.h index e4a55b1152..feed8d4b32 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUUtils.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUUtils.h @@ -433,7 +433,7 @@ static WGPUBufferUsageFlags toWGPUBufferUsage(BufferUsageBit usage) { return res; } -static WGPUColor toWGPUColor(const Color& color) { +static WGPUColor toWGPUColor(const Color &color) { return WGPUColor{color.x, color.y, color.z, color.w}; } diff --git a/native/cocos/scene/Model.cpp b/native/cocos/scene/Model.cpp index 583f376334..511b15185f 100644 --- a/native/cocos/scene/Model.cpp +++ b/native/cocos/scene/Model.cpp @@ -484,7 +484,7 @@ void Model::updateLocalShadowBias() { _localData[pipeline::UBOLocal::LOCAL_SHADOW_BIAS + 1] = _shadowNormalBias; _localData[pipeline::UBOLocal::LOCAL_SHADOW_BIAS + 2] = 0; _localData[pipeline::UBOLocal::LOCAL_SHADOW_BIAS + 3] = 0; - _localDataUpdated = true; + _localDataUpdated = true; } } // namespace scene diff --git a/native/cocos/scene/Model.h b/native/cocos/scene/Model.h index ad3febfe70..58d474fd51 100644 --- a/native/cocos/scene/Model.h +++ b/native/cocos/scene/Model.h @@ -96,7 +96,7 @@ public: virtual void updateTransform(uint32_t stamp); virtual void updateUBOs(uint32_t stamp); void updateWorldBoundUBOs(); - void updateLocalShadowBias(); + void updateLocalShadowBias(); inline void attachToScene(RenderScene *scene) { _scene = scene;