Fixed buffer staging
This commit is contained in:
@@ -22,12 +22,12 @@ class StaticMeshVertexData : public VertexData {
|
||||
StaticMeshVertexData();
|
||||
virtual ~StaticMeshVertexData();
|
||||
static StaticMeshVertexData* getInstance();
|
||||
void loadPositions(MeshId id, const Array<Vector>& data);
|
||||
void loadPositions(MeshId id, const Array<Vector4>& data);
|
||||
void loadTexCoords(MeshId id, uint64 index, const Array<Vector2>& data);
|
||||
void loadNormals(MeshId id, const Array<Vector>& data);
|
||||
void loadTangents(MeshId id, const Array<Vector>& data);
|
||||
void loadBiTangents(MeshId id, const Array<Vector>& data);
|
||||
void loadColors(MeshId id, const Array<Vector>& data);
|
||||
void loadNormals(MeshId id, const Array<Vector4>& data);
|
||||
void loadTangents(MeshId id, const Array<Vector4>& data);
|
||||
void loadBiTangents(MeshId id, const Array<Vector4>& data);
|
||||
void loadColors(MeshId id, const Array<Vector4>& data);
|
||||
virtual void serializeMesh(MeshId id, uint64 numVertices, ArchiveBuffer& buffer) override;
|
||||
virtual void deserializeMesh(MeshId id, ArchiveBuffer& buffer) override;
|
||||
virtual void init(Gfx::PGraphics graphics) override;
|
||||
@@ -37,7 +37,6 @@ class StaticMeshVertexData : public VertexData {
|
||||
virtual Gfx::PDescriptorSet getVertexDataSet() override;
|
||||
virtual std::string getTypeName() const override { return "StaticMeshVertexData"; }
|
||||
virtual Gfx::PShaderBuffer getPositionBuffer() const override { return positions; }
|
||||
virtual Vector* getPositionData() const override { return positionData.data(); }
|
||||
constexpr const Array<StaticMatData>& getStaticMeshes() const { return staticData; }
|
||||
|
||||
private:
|
||||
@@ -47,17 +46,17 @@ class StaticMeshVertexData : public VertexData {
|
||||
|
||||
std::mutex mutex;
|
||||
Gfx::OShaderBuffer positions;
|
||||
Array<Vector> positionData;
|
||||
Array<Vector4> positionData;
|
||||
Gfx::OShaderBuffer texCoords[MAX_TEXCOORDS];
|
||||
Array<Vector2> texCoordsData[MAX_TEXCOORDS];
|
||||
Gfx::OShaderBuffer normals;
|
||||
Array<Vector> normalData;
|
||||
Array<Vector4> normalData;
|
||||
Gfx::OShaderBuffer tangents;
|
||||
Array<Vector> tangentData;
|
||||
Array<Vector4> tangentData;
|
||||
Gfx::OShaderBuffer biTangents;
|
||||
Array<Vector> biTangentData;
|
||||
Array<Vector4> biTangentData;
|
||||
Gfx::OShaderBuffer colors;
|
||||
Array<Vector> colorData;
|
||||
Array<Vector4> colorData;
|
||||
Gfx::ODescriptorLayout descriptorLayout;
|
||||
Gfx::PDescriptorSet descriptorSet;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user