diff options
Diffstat (limited to 'gfx/angle/src/libANGLE/Buffer.h')
-rwxr-xr-x | gfx/angle/src/libANGLE/Buffer.h | 72 |
1 files changed, 24 insertions, 48 deletions
diff --git a/gfx/angle/src/libANGLE/Buffer.h b/gfx/angle/src/libANGLE/Buffer.h index dba4d5adf..6c951ef58 100755 --- a/gfx/angle/src/libANGLE/Buffer.h +++ b/gfx/angle/src/libANGLE/Buffer.h @@ -20,20 +20,35 @@ namespace rx { class BufferImpl; -class GLImplFactory; }; namespace gl { -class Buffer; -class BufferState final : angle::NonCopyable +class Buffer final : public RefCountObject, public LabeledObject { public: - BufferState(); - ~BufferState(); + Buffer(rx::BufferImpl *impl, GLuint id); + virtual ~Buffer(); + + void setLabel(const std::string &label) override; + const std::string &getLabel() const override; + + Error bufferData(const void *data, GLsizeiptr size, GLenum usage); + Error bufferSubData(const void *data, GLsizeiptr size, GLintptr offset); + Error copyBufferSubData(Buffer* source, GLintptr sourceOffset, GLintptr destOffset, GLsizeiptr size); + Error map(GLenum access); + Error mapRange(GLintptr offset, GLsizeiptr length, GLbitfield access); + Error unmap(GLboolean *result); + + void onTransformFeedback(); + void onPixelUnpack(); - const std::string &getLabel(); + Error getIndexRange(GLenum type, + size_t offset, + size_t count, + bool primitiveRestartEnabled, + IndexRange *outRange) const; GLenum getUsage() const { return mUsage; } GLbitfield getAccessFlags() const { return mAccessFlags; } @@ -44,8 +59,10 @@ class BufferState final : angle::NonCopyable GLint64 getMapLength() const { return mMapLength; } GLint64 getSize() const { return mSize; } + rx::BufferImpl *getImplementation() const { return mBuffer; } + private: - friend class Buffer; + rx::BufferImpl *mBuffer; std::string mLabel; @@ -57,47 +74,6 @@ class BufferState final : angle::NonCopyable GLvoid *mMapPointer; GLint64 mMapOffset; GLint64 mMapLength; -}; - -class Buffer final : public RefCountObject, public LabeledObject -{ - public: - Buffer(rx::GLImplFactory *factory, GLuint id); - ~Buffer() override; - - void setLabel(const std::string &label) override; - const std::string &getLabel() const override; - - Error bufferData(GLenum target, const void *data, GLsizeiptr size, GLenum usage); - Error bufferSubData(GLenum target, const void *data, GLsizeiptr size, GLintptr offset); - Error copyBufferSubData(Buffer* source, GLintptr sourceOffset, GLintptr destOffset, GLsizeiptr size); - Error map(GLenum access); - Error mapRange(GLintptr offset, GLsizeiptr length, GLbitfield access); - Error unmap(GLboolean *result); - - void onTransformFeedback(); - void onPixelUnpack(); - - Error getIndexRange(GLenum type, - size_t offset, - size_t count, - bool primitiveRestartEnabled, - IndexRange *outRange) const; - - GLenum getUsage() const { return mState.mUsage; } - GLbitfield getAccessFlags() const { return mState.mAccessFlags; } - GLenum getAccess() const { return mState.mAccess; } - GLboolean isMapped() const { return mState.mMapped; } - GLvoid *getMapPointer() const { return mState.mMapPointer; } - GLint64 getMapOffset() const { return mState.mMapOffset; } - GLint64 getMapLength() const { return mState.mMapLength; } - GLint64 getSize() const { return mState.mSize; } - - rx::BufferImpl *getImplementation() const { return mImpl; } - - private: - BufferState mState; - rx::BufferImpl *mImpl; mutable IndexRangeCache mIndexRangeCache; }; |