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.
7 // IndexRangeCache.h: Defines the rx::IndexRangeCache class which stores information about
10 #ifndef LIBGLESV2_RENDERER_INDEXRANGECACHE_H_
11 #define LIBGLESV2_RENDERER_INDEXRANGECACHE_H_
13 #include "common/angleutils.h"
14 #include "common/mathutil.h"
26 void addRange(GLenum type, unsigned int offset, GLsizei count, const RangeUI &range,
27 unsigned int streamOffset);
28 bool findRange(GLenum type, unsigned int offset, GLsizei count, RangeUI *rangeOut,
29 unsigned int *outStreamOffset) const;
31 void invalidateRange(unsigned int offset, unsigned int size);
34 static RangeUI ComputeRange(GLenum type, const GLvoid *indices, GLsizei count);
44 IndexRange(GLenum type, intptr_t offset, GLsizei count);
46 bool operator<(const IndexRange& rhs) const;
52 unsigned int streamOffset;
55 IndexBounds(const RangeUI &range, unsigned int offset);
58 typedef std::map<IndexRange, IndexBounds> IndexRangeMap;
59 IndexRangeMap mIndexRangeCache;
64 #endif // LIBGLESV2_RENDERER_INDEXRANGECACHE_H