Deprecate Buffer::SetSubData in favor of Queue::WriteBuffer

Bug: dawn:22
Change-Id: I00b3cd65ac4eb494b05918251f4b3b2bcaf24f71
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22200
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Corentin Wallez
2020-06-02 09:24:39 +00:00
committed by Commit Bot service account
parent 3b7d0858bf
commit 47a3341e07
40 changed files with 528 additions and 390 deletions

View File

@@ -50,14 +50,6 @@ namespace dawn_native { namespace opengl {
return {};
}
MaybeError Buffer::SetSubDataImpl(uint32_t start, uint32_t count, const void* data) {
const OpenGLFunctions& gl = ToBackend(GetDevice())->gl;
gl.BindBuffer(GL_ARRAY_BUFFER, mBuffer);
gl.BufferSubData(GL_ARRAY_BUFFER, start, count, data);
return {};
}
MaybeError Buffer::MapReadAsyncImpl(uint32_t serial) {
const OpenGLFunctions& gl = ToBackend(GetDevice())->gl;

View File

@@ -32,7 +32,6 @@ namespace dawn_native { namespace opengl {
private:
~Buffer() override;
// Dawn API
MaybeError SetSubDataImpl(uint32_t start, uint32_t count, const void* data) override;
MaybeError MapReadAsyncImpl(uint32_t serial) override;
MaybeError MapWriteAsyncImpl(uint32_t serial) override;
void UnmapImpl() override;

View File

@@ -14,6 +14,7 @@
#include "dawn_native/opengl/QueueGL.h"
#include "dawn_native/opengl/BufferGL.h"
#include "dawn_native/opengl/CommandBufferGL.h"
#include "dawn_native/opengl/DeviceGL.h"
#include "dawn_platform/DawnPlatform.h"
@@ -37,4 +38,15 @@ namespace dawn_native { namespace opengl {
return {};
}
MaybeError Queue::WriteBufferImpl(BufferBase* buffer,
uint64_t bufferOffset,
const void* data,
size_t size) {
const OpenGLFunctions& gl = ToBackend(GetDevice())->gl;
gl.BindBuffer(GL_ARRAY_BUFFER, ToBackend(buffer)->GetHandle());
gl.BufferSubData(GL_ARRAY_BUFFER, bufferOffset, size, data);
return {};
}
}} // namespace dawn_native::opengl

View File

@@ -28,6 +28,10 @@ namespace dawn_native { namespace opengl {
private:
MaybeError SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands) override;
MaybeError WriteBufferImpl(BufferBase* buffer,
uint64_t bufferOffset,
const void* data,
size_t size) override;
};
}} // namespace dawn_native::opengl