remove uimeshbuffer sync to native floatsPerVertex (#12722)

This commit is contained in:
zhakesi
2022-09-09 10:55:50 +08:00
committed by GitHub
parent 526e41bfa8
commit ef9392829c
2 changed files with 1 additions and 25 deletions
+1 -6
View File
@@ -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));
-19
View File
@@ -27,25 +27,6 @@
#include "renderer/gfx-base/GFXDevice.h"
namespace cc {
static const ccstd::vector<gfx::Attribute> 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<gfx::Attribute> 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<gfx::Attribute> 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<gfx::Attribute>& attrs) {
uint32_t stride = 0;