From ef9392829c46d59cbc52bfcbbbaf5ceaa5cb9ea6 Mon Sep 17 00:00:00 2001 From: zhakesi Date: Fri, 9 Sep 2022 10:55:50 +0800 Subject: [PATCH] remove uimeshbuffer sync to native floatsPerVertex (#12722) --- cocos/2d/renderer/mesh-buffer.ts | 7 +------ native/cocos/2d/renderer/UIMeshBuffer.cpp | 19 ------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/cocos/2d/renderer/mesh-buffer.ts b/cocos/2d/renderer/mesh-buffer.ts index 91c2131599..deb4286099 100644 --- a/cocos/2d/renderer/mesh-buffer.ts +++ b/cocos/2d/renderer/mesh-buffer.ts @@ -42,8 +42,7 @@ export enum MeshBufferSharedBufferView{ vertexOffset, indexOffset, dirty, - floatsPerVertex, - count = 5 + count, } export class MeshBuffer { @@ -100,9 +99,6 @@ export class MeshBuffer { } set floatsPerVertex (val:number) { this._floatsPerVertex = val; - if (JSB) { - this._sharedBuffer[MeshBufferSharedBufferView.floatsPerVertex] = val; - } } protected _vData: Float32Array = null!; @@ -186,7 +182,6 @@ export class MeshBuffer { this._initIDataCount = iCount; this._attributes = attrs; - //sync to native this.floatsPerVertex = getAttributeStride(attrs) >> 2; assertIsTrue(this._initVDataCount / this._floatsPerVertex < 65536, getError(9005)); diff --git a/native/cocos/2d/renderer/UIMeshBuffer.cpp b/native/cocos/2d/renderer/UIMeshBuffer.cpp index e73942fae0..28bc6f21aa 100644 --- a/native/cocos/2d/renderer/UIMeshBuffer.cpp +++ b/native/cocos/2d/renderer/UIMeshBuffer.cpp @@ -27,25 +27,6 @@ #include "renderer/gfx-base/GFXDevice.h" namespace cc { -static const ccstd::vector ATTRIBUTES_V3F_T2F_C4F { - gfx::Attribute{gfx::ATTR_NAME_POSITION, gfx::Format::RGB32F}, - gfx::Attribute{gfx::ATTR_NAME_TEX_COORD, gfx::Format::RG32F}, - gfx::Attribute{gfx::ATTR_NAME_COLOR, gfx::Format::RGBA32F}, - gfx::Attribute{gfx::ATTR_NAME_COLOR2, gfx::Format::RGBA32F}, -}; - -static const ccstd::vector ATTRIBUTES_V3F_T2F_C4B { - gfx::Attribute{gfx::ATTR_NAME_POSITION, gfx::Format::RGB32F}, - gfx::Attribute{gfx::ATTR_NAME_TEX_COORD, gfx::Format::RG32F}, - gfx::Attribute{gfx::ATTR_NAME_COLOR, gfx::Format::RGBA8, true}, -}; - -static const ccstd::vector ATTRIBUTES_V3F_T2F_C4B_C4B { - gfx::Attribute{gfx::ATTR_NAME_POSITION, gfx::Format::RGB32F}, - gfx::Attribute{gfx::ATTR_NAME_TEX_COORD, gfx::Format::RG32F}, - gfx::Attribute{gfx::ATTR_NAME_COLOR, gfx::Format::RGBA8, true}, - gfx::Attribute{gfx::ATTR_NAME_COLOR, gfx::Format::RGBA8, true}, -}; static uint32_t getAttributesStride(ccstd::vector& attrs) { uint32_t stride = 0;