More refactoring

This commit is contained in:
Dynamitos
2023-11-15 00:06:00 +01:00
parent 59d6c9d794
commit f8f48352a3
49 changed files with 930 additions and 1015 deletions
+31 -30
View File
@@ -12,6 +12,35 @@ Buffer::~Buffer()
{
}
VertexBuffer::VertexBuffer(QueueFamilyMapping mapping, uint32 numVertices, uint32 vertexSize, QueueType startQueueType)
: Buffer(mapping, startQueueType)
, numVertices(numVertices)
, vertexSize(vertexSize)
{
}
VertexBuffer::~VertexBuffer()
{
}
IndexBuffer::IndexBuffer(QueueFamilyMapping mapping, uint64 size, Gfx::SeIndexType indexType, QueueType startQueueType)
: Buffer(mapping, startQueueType)
, indexType(indexType)
{
switch (indexType)
{
case SE_INDEX_TYPE_UINT16:
numIndices = size / sizeof(uint16);
break;
case SE_INDEX_TYPE_UINT32:
numIndices = size / sizeof(uint32);
break;
default:
break;
}
}
IndexBuffer::~IndexBuffer()
{
}
UniformBuffer::UniformBuffer(QueueFamilyMapping mapping, const DataSource& sourceData)
: Buffer(mapping, sourceData.owner)
, contents(sourceData.size)
@@ -37,17 +66,17 @@ bool UniformBuffer::updateContents(const DataSource& sourceData)
return true;
}
ShaderBuffer::ShaderBuffer(QueueFamilyMapping mapping, uint32 stride, uint32 numElements, const DataSource& sourceData)
ShaderBuffer::ShaderBuffer(QueueFamilyMapping mapping, uint32 numElements, const DataSource& sourceData)
: Buffer(mapping, sourceData.owner)
, contents(sourceData.size)
, numElements(numElements)
, stride(stride)
{
if (sourceData.data != nullptr)
{
std::memcpy(contents.data(), sourceData.data, sourceData.size);
}
}
ShaderBuffer::~ShaderBuffer()
{
}
@@ -62,31 +91,3 @@ bool ShaderBuffer::updateContents(const DataSource& sourceData)
std::memcpy(contents.data(), sourceData.data, sourceData.size);
return true;
}
VertexBuffer::VertexBuffer(QueueFamilyMapping mapping, uint32 numVertices, uint32 vertexSize, QueueType startQueueType)
: Buffer(mapping, startQueueType)
, numVertices(numVertices)
, vertexSize(vertexSize)
{
}
VertexBuffer::~VertexBuffer()
{
}
IndexBuffer::IndexBuffer(QueueFamilyMapping mapping, uint64 size, Gfx::SeIndexType indexType, QueueType startQueueType)
: Buffer(mapping, startQueueType)
, indexType(indexType)
{
switch (indexType)
{
case SE_INDEX_TYPE_UINT16:
numIndices = size / sizeof(uint16);
break;
case SE_INDEX_TYPE_UINT32:
numIndices = size / sizeof(uint32);
break;
default:
break;
}
}
IndexBuffer::~IndexBuffer()
{
}