Make SetSubData take size in uint8_t not uint32_t.

Also change data pointer to uint8_t*.
Add a test for a non-aligned SetSubData().
Implemented on all backends.
This commit is contained in:
Stephen White
2018-02-04 11:07:02 -05:00
committed by Corentin Wallez
parent ee66f25c4f
commit e5ae3274a3
27 changed files with 93 additions and 68 deletions

View File

@@ -30,9 +30,9 @@ namespace backend { namespace opengl {
return mBuffer;
}
void Buffer::SetSubDataImpl(uint32_t start, uint32_t count, const uint32_t* data) {
void Buffer::SetSubDataImpl(uint32_t start, uint32_t count, const uint8_t* data) {
glBindBuffer(GL_ARRAY_BUFFER, mBuffer);
glBufferSubData(GL_ARRAY_BUFFER, start * sizeof(uint32_t), count * sizeof(uint32_t), data);
glBufferSubData(GL_ARRAY_BUFFER, start, count, data);
}
void Buffer::MapReadAsyncImpl(uint32_t serial, uint32_t start, uint32_t count) {

View File

@@ -30,7 +30,7 @@ namespace backend { namespace opengl {
GLuint GetHandle() const;
private:
void SetSubDataImpl(uint32_t start, uint32_t count, const uint32_t* data) override;
void SetSubDataImpl(uint32_t start, uint32_t count, const uint8_t* data) override;
void MapReadAsyncImpl(uint32_t serial, uint32_t start, uint32_t count) override;
void MapWriteAsyncImpl(uint32_t serial, uint32_t start, uint32_t count) override;
void UnmapImpl() override;