1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/src/libGLESv2/renderer/VertexDataManager.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,65 @@ 1.4 +// 1.5 +// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. 1.6 +// Use of this source code is governed by a BSD-style license that can be 1.7 +// found in the LICENSE file. 1.8 +// 1.9 + 1.10 +// VertexDataManager.h: Defines the VertexDataManager, a class that 1.11 +// runs the Buffer translation process. 1.12 + 1.13 +#ifndef LIBGLESV2_RENDERER_VERTEXDATAMANAGER_H_ 1.14 +#define LIBGLESV2_RENDERER_VERTEXDATAMANAGER_H_ 1.15 + 1.16 +#include "libGLESv2/Constants.h" 1.17 +#include "common/angleutils.h" 1.18 + 1.19 +namespace gl 1.20 +{ 1.21 +class VertexAttribute; 1.22 +class ProgramBinary; 1.23 +} 1.24 + 1.25 +namespace rx 1.26 +{ 1.27 +class BufferStorage; 1.28 +class StreamingVertexBufferInterface; 1.29 +class VertexBuffer; 1.30 +class Renderer; 1.31 + 1.32 +struct TranslatedAttribute 1.33 +{ 1.34 + bool active; 1.35 + 1.36 + const gl::VertexAttribute *attribute; 1.37 + unsigned int offset; 1.38 + unsigned int stride; // 0 means not to advance the read pointer at all 1.39 + 1.40 + VertexBuffer *vertexBuffer; 1.41 + BufferStorage *storage; 1.42 + unsigned int serial; 1.43 + unsigned int divisor; 1.44 +}; 1.45 + 1.46 +class VertexDataManager 1.47 +{ 1.48 + public: 1.49 + VertexDataManager(rx::Renderer *renderer); 1.50 + virtual ~VertexDataManager(); 1.51 + 1.52 + GLenum prepareVertexData(const gl::VertexAttribute attribs[], gl::ProgramBinary *programBinary, GLint start, GLsizei count, TranslatedAttribute *outAttribs, GLsizei instances); 1.53 + 1.54 + private: 1.55 + DISALLOW_COPY_AND_ASSIGN(VertexDataManager); 1.56 + 1.57 + rx::Renderer *const mRenderer; 1.58 + 1.59 + StreamingVertexBufferInterface *mStreamingBuffer; 1.60 + 1.61 + float mCurrentValue[gl::MAX_VERTEX_ATTRIBS][4]; 1.62 + StreamingVertexBufferInterface *mCurrentValueBuffer[gl::MAX_VERTEX_ATTRIBS]; 1.63 + std::size_t mCurrentValueOffsets[gl::MAX_VERTEX_ATTRIBS]; 1.64 +}; 1.65 + 1.66 +} 1.67 + 1.68 +#endif // LIBGLESV2_RENDERER_VERTEXDATAMANAGER_H_