michael@0: // michael@0: // Copyright (c) 2013 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: // BufferStorage11.h Defines the BufferStorage11 class. michael@0: michael@0: #ifndef LIBGLESV2_RENDERER_BUFFERSTORAGE11_H_ michael@0: #define LIBGLESV2_RENDERER_BUFFERSTORAGE11_H_ michael@0: michael@0: #include "libGLESv2/renderer/BufferStorage.h" michael@0: michael@0: namespace rx michael@0: { michael@0: class Renderer11; michael@0: michael@0: class BufferStorage11 : public BufferStorage michael@0: { michael@0: public: michael@0: explicit BufferStorage11(Renderer11 *renderer); michael@0: virtual ~BufferStorage11(); michael@0: michael@0: static BufferStorage11 *makeBufferStorage11(BufferStorage *bufferStorage); michael@0: michael@0: virtual void *getData(); michael@0: virtual void setData(const void* data, unsigned int size, unsigned int offset); michael@0: virtual void clear(); michael@0: virtual unsigned int getSize() const; michael@0: virtual bool supportsDirectBinding() const; michael@0: virtual void markBufferUsage(); michael@0: michael@0: ID3D11Buffer *getBuffer() const; michael@0: michael@0: private: michael@0: Renderer11 *mRenderer; michael@0: michael@0: ID3D11Buffer *mStagingBuffer; michael@0: unsigned int mStagingBufferSize; michael@0: michael@0: ID3D11Buffer *mBuffer; michael@0: unsigned int mBufferSize; michael@0: michael@0: unsigned int mSize; michael@0: michael@0: void *mResolvedData; michael@0: unsigned int mResolvedDataSize; michael@0: bool mResolvedDataValid; michael@0: michael@0: unsigned int mReadUsageCount; michael@0: unsigned int mWriteUsageCount; michael@0: }; michael@0: michael@0: } michael@0: michael@0: #endif // LIBGLESV2_RENDERER_BUFFERSTORAGE11_H_