#define LIBGLESV2_INDEXDATAMANAGER_H_
#include "common/angleutils.h"
+#include "common/mathutil.h"
+#include "libGLESv2/Error.h"
+
+#include <GLES2/gl2.h>
namespace
{
namespace rx
{
+class IndexBufferInterface;
class StaticIndexBufferInterface;
class StreamingIndexBufferInterface;
class IndexBuffer;
struct TranslatedIndexData
{
- unsigned int minIndex;
- unsigned int maxIndex;
+ RangeUI indexRange;
unsigned int startIndex;
unsigned int startOffset; // In bytes
explicit IndexDataManager(Renderer *renderer);
virtual ~IndexDataManager();
- GLenum prepareIndexData(GLenum type, GLsizei count, gl::Buffer *arrayElementBuffer, const GLvoid *indices, TranslatedIndexData *translated);
- StaticIndexBufferInterface *getCountingIndices(GLsizei count);
+ gl::Error prepareIndexData(GLenum type, GLsizei count, gl::Buffer *arrayElementBuffer, const GLvoid *indices, TranslatedIndexData *translated);
private:
+ gl::Error getStreamingIndexBuffer(GLenum destinationIndexType, IndexBufferInterface **outBuffer);
+
DISALLOW_COPY_AND_ASSIGN(IndexDataManager);
Renderer *const mRenderer;
StreamingIndexBufferInterface *mStreamingBufferShort;
StreamingIndexBufferInterface *mStreamingBufferInt;
- StaticIndexBufferInterface *mCountingBuffer;
};
}