Home | History | Annotate | Download | only in renderer
      1 //
      2 // Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
      3 // Use of this source code is governed by a BSD-style license that can be
      4 // found in the LICENSE file.
      5 //
      6 
      7 // BufferStorage11.h Defines the BufferStorage11 class.
      8 
      9 #ifndef LIBGLESV2_RENDERER_BUFFERSTORAGE11_H_
     10 #define LIBGLESV2_RENDERER_BUFFERSTORAGE11_H_
     11 
     12 #include "libGLESv2/renderer/BufferStorage.h"
     13 
     14 namespace rx
     15 {
     16 class Renderer11;
     17 
     18 class BufferStorage11 : public BufferStorage
     19 {
     20   public:
     21     explicit BufferStorage11(Renderer11 *renderer);
     22     virtual ~BufferStorage11();
     23 
     24     static BufferStorage11 *makeBufferStorage11(BufferStorage *bufferStorage);
     25 
     26     virtual void *getData();
     27     virtual void setData(const void* data, unsigned int size, unsigned int offset);
     28     virtual void clear();
     29     virtual unsigned int getSize() const;
     30     virtual bool supportsDirectBinding() const;
     31     virtual void markBufferUsage();
     32 
     33     ID3D11Buffer *getBuffer() const;
     34 
     35   private:
     36     Renderer11 *mRenderer;
     37 
     38     ID3D11Buffer *mStagingBuffer;
     39     unsigned int mStagingBufferSize;
     40 
     41     ID3D11Buffer *mBuffer;
     42     unsigned int mBufferSize;
     43 
     44     unsigned int mSize;
     45 
     46     void *mResolvedData;
     47     unsigned int mResolvedDataSize;
     48     bool mResolvedDataValid;
     49 
     50     unsigned int mReadUsageCount;
     51     unsigned int mWriteUsageCount;
     52 };
     53 
     54 }
     55 
     56 #endif // LIBGLESV2_RENDERER_BUFFERSTORAGE11_H_
     57