OpenGL: change StreamBuffer in a streaming way

This is a bit slower on map_and_* because of flushing and _very_ much slower on buffer(sub)?data because of a new memcpy.
But this design allow us to decode directly into a gpu buffer, eg vertexloader will profit :)
This commit is contained in:
degasus
2014-01-22 18:02:55 +01:00
parent 650bae12e1
commit be1fee6d74
4 changed files with 66 additions and 67 deletions

View File

@ -32,10 +32,10 @@ public:
StreamBuffer(u32 type, size_t size);
~StreamBuffer();
void Alloc(size_t size, u32 stride = 0);
size_t Upload(u8 *data, size_t size);
u8* Map(size_t size, u32 stride = 0);
size_t Unmap(size_t used_size); // returns the offset of the beginning of the uploaded block
u32 getBuffer() { return m_buffer; }
inline u32 getBuffer() { return m_buffer; }
private:
void Init();