michael@0: // michael@0: // Copyright (c) 2002-2012 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: // VertexDataManager.h: Defines the VertexDataManager, a class that michael@0: // runs the Buffer translation process. michael@0: michael@0: #ifndef LIBGLESV2_RENDERER_VERTEXDATAMANAGER_H_ michael@0: #define LIBGLESV2_RENDERER_VERTEXDATAMANAGER_H_ michael@0: michael@0: #include "libGLESv2/Constants.h" michael@0: #include "common/angleutils.h" michael@0: michael@0: namespace gl michael@0: { michael@0: class VertexAttribute; michael@0: class ProgramBinary; michael@0: } michael@0: michael@0: namespace rx michael@0: { michael@0: class BufferStorage; michael@0: class StreamingVertexBufferInterface; michael@0: class VertexBuffer; michael@0: class Renderer; michael@0: michael@0: struct TranslatedAttribute michael@0: { michael@0: bool active; michael@0: michael@0: const gl::VertexAttribute *attribute; michael@0: unsigned int offset; michael@0: unsigned int stride; // 0 means not to advance the read pointer at all michael@0: michael@0: VertexBuffer *vertexBuffer; michael@0: BufferStorage *storage; michael@0: unsigned int serial; michael@0: unsigned int divisor; michael@0: }; michael@0: michael@0: class VertexDataManager michael@0: { michael@0: public: michael@0: VertexDataManager(rx::Renderer *renderer); michael@0: virtual ~VertexDataManager(); michael@0: michael@0: GLenum prepareVertexData(const gl::VertexAttribute attribs[], gl::ProgramBinary *programBinary, GLint start, GLsizei count, TranslatedAttribute *outAttribs, GLsizei instances); michael@0: michael@0: private: michael@0: DISALLOW_COPY_AND_ASSIGN(VertexDataManager); michael@0: michael@0: rx::Renderer *const mRenderer; michael@0: michael@0: StreamingVertexBufferInterface *mStreamingBuffer; michael@0: michael@0: float mCurrentValue[gl::MAX_VERTEX_ATTRIBS][4]; michael@0: StreamingVertexBufferInterface *mCurrentValueBuffer[gl::MAX_VERTEX_ATTRIBS]; michael@0: std::size_t mCurrentValueOffsets[gl::MAX_VERTEX_ATTRIBS]; michael@0: }; michael@0: michael@0: } michael@0: michael@0: #endif // LIBGLESV2_RENDERER_VERTEXDATAMANAGER_H_