diff options
author | chai <chaifix@163.com> | 2021-11-01 10:43:51 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-01 10:43:51 +0800 |
commit | 78417f6cdedfcf60c8ca437190975644e942e01f (patch) | |
tree | 5140fe969fe70083d20096b030dc9e944f82a5c3 /Runtime/Graphics | |
parent | 8078aeed4e62c6b3aa48102554044768b402570c (diff) |
*rename SharedVertexBuffer -> DynamicVertexBuffer
Diffstat (limited to 'Runtime/Graphics')
-rw-r--r-- | Runtime/Graphics/DynamicVertexBuffer.cpp (renamed from Runtime/Graphics/SharedVertexBuffer.cpp) | 22 | ||||
-rw-r--r-- | Runtime/Graphics/DynamicVertexBuffer.h (renamed from Runtime/Graphics/SharedVertexBuffer.h) | 6 | ||||
-rw-r--r-- | Runtime/Graphics/GfxDevice.h | 6 |
3 files changed, 17 insertions, 17 deletions
diff --git a/Runtime/Graphics/SharedVertexBuffer.cpp b/Runtime/Graphics/DynamicVertexBuffer.cpp index 976fb70..203aa26 100644 --- a/Runtime/Graphics/SharedVertexBuffer.cpp +++ b/Runtime/Graphics/DynamicVertexBuffer.cpp @@ -1,11 +1,11 @@ -#include "SharedVertexBuffer.h" +#include "DynamicVertexBuffer.h" #include "../Profiling/FrameStats.h" -SharedVertexBuffer::SharedVertexBuffer() +DynamicVertexBuffer::DynamicVertexBuffer() { } -SharedVertexBuffer::~SharedVertexBuffer() +DynamicVertexBuffer::~DynamicVertexBuffer() { } @@ -16,7 +16,7 @@ SharedVertexBuffer::~SharedVertexBuffer() //-> ReleaseChunk //-> DrawChunk -void SharedVertexBuffer::GetChunk(uint attrsMask, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib) +void DynamicVertexBuffer::GetChunk(uint attrsMask, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib) { Assert(out_vb && out_ib); @@ -28,7 +28,7 @@ void SharedVertexBuffer::GetChunk(uint attrsMask, int maxVerts, int maxIndices, m_CurStride = stride; } -void SharedVertexBuffer::DrawChunk() +void DynamicVertexBuffer::DrawChunk() { DefaultVertexLayout vertexArray; FillDefaultVertexLayout(vertexArray); @@ -67,7 +67,7 @@ void SharedVertexBuffer::DrawChunk() Clean(); } -void SharedVertexBuffer::FillDefaultVertexLayout(DefaultVertexLayout& dst) +void DynamicVertexBuffer::FillDefaultVertexLayout(DefaultVertexLayout& dst) { const byte* basepointer = m_CurVB ? 0 : &m_CurVBData[0]; const GLuint buffer = m_CurVB ? m_CurVB->GetHandle() : 0; @@ -105,7 +105,7 @@ void SharedVertexBuffer::FillDefaultVertexLayout(DefaultVertexLayout& dst) // Custom Vertex Layout // 用buffersize为依据决定用vbo或者pinned memory -void SharedVertexBuffer::GetChunk(uint sizePerVert, uint sizePerIndex, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib) +void DynamicVertexBuffer::GetChunk(uint sizePerVert, uint sizePerIndex, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib) { Assert(out_vb && out_ib); @@ -150,7 +150,7 @@ void SharedVertexBuffer::GetChunk(uint sizePerVert, uint sizePerIndex, int maxVe m_CurPrimitive = primitive; } -void SharedVertexBuffer::FillCustomVertexLayout(CustomVertexLayout& dst) +void DynamicVertexBuffer::FillCustomVertexLayout(CustomVertexLayout& dst) { const byte* basepointer = m_CurVB ? 0 : &m_CurVBData[0]; const GLuint buffer = m_CurVB ? m_CurVB->GetHandle() : 0; @@ -164,7 +164,7 @@ void SharedVertexBuffer::FillCustomVertexLayout(CustomVertexLayout& dst) } } -void SharedVertexBuffer::DrawChunk(CustomVertexLayout& layout) +void DynamicVertexBuffer::DrawChunk(CustomVertexLayout& layout) { const byte* basepointer = m_CurVB ? 0 : &m_CurVBData[0]; const GLuint buffer = m_CurVB ? m_CurVB->GetHandle() : 0; @@ -209,7 +209,7 @@ void SharedVertexBuffer::DrawChunk(CustomVertexLayout& layout) //------------------------------------------------------------------------------------------------------------ // Both Default and Custom Vertex Layout -void SharedVertexBuffer::ReleaseChunk(int actualVerts, int actualIndices) +void DynamicVertexBuffer::ReleaseChunk(int actualVerts, int actualIndices) { int actualVBufferSize = m_CurStride * actualVerts; int actualIBufferSize = VertexLayout::GetDefaultIndexSize() * actualIndices; @@ -242,7 +242,7 @@ void SharedVertexBuffer::ReleaseChunk(int actualVerts, int actualIndices) m_CurIndexCount = actualIndices; } -void SharedVertexBuffer::Clean() +void DynamicVertexBuffer::Clean() { if (m_CurVB) { diff --git a/Runtime/Graphics/SharedVertexBuffer.h b/Runtime/Graphics/DynamicVertexBuffer.h index cc89752..a849f4c 100644 --- a/Runtime/Graphics/SharedVertexBuffer.h +++ b/Runtime/Graphics/DynamicVertexBuffer.h @@ -10,11 +10,11 @@ #include "CustomVertexLayout.h" #include "Primitive.h" -class SharedVertexBuffer +class DynamicVertexBuffer { public: - SharedVertexBuffer(); - ~SharedVertexBuffer(); + DynamicVertexBuffer(); + ~DynamicVertexBuffer(); // default layout void GetChunk(uint attrs, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib); diff --git a/Runtime/Graphics/GfxDevice.h b/Runtime/Graphics/GfxDevice.h index 68cd6c0..437696a 100644 --- a/Runtime/Graphics/GfxDevice.h +++ b/Runtime/Graphics/GfxDevice.h @@ -13,7 +13,7 @@ #include "Texture.h" #include "DeviceDefine.h" #include "VertexBuffer.h" -#include "SharedVertexBuffer.h" +#include "DynamicVertexBuffer.h" #include "Color.h" struct GfxDeviceSetting @@ -77,7 +77,7 @@ public: bool IsInsideFrame(); - SharedVertexBuffer* GetSharedVBO() { return &m_SharedVBO; } + DynamicVertexBuffer* GetSharedVBO() { return &m_DynamicVBO; } GET_SET(Internal::Color, ClearColor, m_ClearColor); GET_SET(ETextureFilterMode, DefaultFilterMode, m_DefaultFilterMode); @@ -100,7 +100,7 @@ private: ETextureFilterMode m_DefaultFilterMode; ETextureWrapMode m_DefaultWrapMode; - SharedVertexBuffer m_SharedVBO; // 共享的VBO,用来做立即渲染 + DynamicVertexBuffer m_DynamicVBO; // 共享的VBO,用来做立即渲染 }; |