Remove BufferUsage flag from createVertexBuffer (#4352)

This commit is contained in:
Ben Doherty
2021-07-21 10:04:57 -07:00
committed by GitHub
parent 0d8cdab4e4
commit b77a23ff9d
6 changed files with 6 additions and 13 deletions

View File

@@ -167,8 +167,7 @@ DECL_DRIVER_API_R_N(backend::VertexBufferHandle, createVertexBuffer,
uint8_t, bufferCount,
uint8_t, attributeCount,
uint32_t, vertexCount,
backend::AttributeArray, attributes,
backend::BufferUsage, usage)
backend::AttributeArray, attributes)
DECL_DRIVER_API_R_N(backend::IndexBufferHandle, createIndexBuffer,
backend::ElementType, elementType,

View File

@@ -200,9 +200,7 @@ void MetalDriver::finish(int) {
}
void MetalDriver::createVertexBufferR(Handle<HwVertexBuffer> vbh, uint8_t bufferCount,
uint8_t attributeCount, uint32_t vertexCount, AttributeArray attributes,
BufferUsage usage) {
// TODO: Take BufferUsage into account when creating the buffer.
uint8_t attributeCount, uint32_t vertexCount, AttributeArray attributes) {
construct_handle<MetalVertexBuffer>(vbh, *mContext, bufferCount,
attributeCount, vertexCount, attributes);
}

View File

@@ -399,8 +399,7 @@ void OpenGLDriver::createVertexBufferR(
uint8_t bufferCount,
uint8_t attributeCount,
uint32_t elementCount,
AttributeArray attributes,
BufferUsage usage) {
AttributeArray attributes) {
DEBUG_MARKER()
construct<GLVertexBuffer>(vbh, bufferCount, attributeCount, elementCount, attributes);
}

View File

@@ -412,8 +412,7 @@ void VulkanDriver::destroyRenderPrimitive(Handle<HwRenderPrimitive> rph) {
}
void VulkanDriver::createVertexBufferR(Handle<HwVertexBuffer> vbh, uint8_t bufferCount,
uint8_t attributeCount, uint32_t elementCount, AttributeArray attributes,
BufferUsage usage) {
uint8_t attributeCount, uint32_t elementCount, AttributeArray attributes) {
auto vertexBuffer = construct<VulkanVertexBuffer>(vbh, mContext, mStagePool,
bufferCount, attributeCount, elementCount, attributes);
mDisposer.createDisposable(vertexBuffer, [this, vbh] () {

View File

@@ -55,8 +55,7 @@ TrianglePrimitive::TrianglePrimitive(filament::backend::DriverApi& driverApi,
const size_t size = sizeof(math::float2) * 3;
mBufferObject = mDriverApi.createBufferObject(size, BufferObjectBinding::VERTEX, BufferUsage::STATIC);
mVertexBuffer = mDriverApi.createVertexBuffer(1, 1, mVertexCount, attributes,
BufferUsage::STATIC);
mVertexBuffer = mDriverApi.createVertexBuffer(1, 1, mVertexCount, attributes);
mDriverApi.setVertexBufferObject(mVertexBuffer, 0, mBufferObject);
BufferDescriptor vertexBufferDesc(gVertices, size, nullptr);
mDriverApi.updateBufferObject(mBufferObject, std::move(vertexBufferDesc), 0);

View File

@@ -190,8 +190,7 @@ FVertexBuffer::FVertexBuffer(FEngine& engine, const VertexBuffer::Builder& build
FEngine::DriverApi& driver = engine.getDriverApi();
mHandle = driver.createVertexBuffer(
mBufferCount, attributeCount, mVertexCount, attributeArray,
backend::BufferUsage::STATIC);
mBufferCount, attributeCount, mVertexCount, attributeArray);
// If buffer objects are not enabled at the API level, then we create them internally.
if (!mBufferObjectsEnabled) {