Home | History | Annotate | Download | only in libGLESv2
      1 //
      2 // Copyright 2014 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 // ImageIndex.h: A helper struct for indexing into an Image array
      8 
      9 #ifndef LIBGLESV2_IMAGE_INDEX_H_
     10 #define LIBGLESV2_IMAGE_INDEX_H_
     11 
     12 #include "angle_gl.h"
     13 
     14 namespace gl
     15 {
     16 
     17 struct ImageIndex
     18 {
     19     GLenum type;
     20     GLint mipIndex;
     21     GLint layerIndex;
     22 
     23     ImageIndex(const ImageIndex &other);
     24     ImageIndex &operator=(const ImageIndex &other);
     25 
     26     bool hasLayer() const { return layerIndex != ENTIRE_LEVEL; }
     27 
     28     static ImageIndex Make2D(GLint mipIndex);
     29     static ImageIndex MakeCube(GLenum target, GLint mipIndex);
     30     static ImageIndex Make2DArray(GLint mipIndex, GLint layerIndex);
     31     static ImageIndex Make3D(GLint mipIndex, GLint layerIndex = ENTIRE_LEVEL);
     32 
     33     static const GLint ENTIRE_LEVEL = static_cast<GLint>(-1);
     34 
     35   private:
     36     ImageIndex(GLenum typeIn, GLint mipIndexIn, GLint layerIndexIn);
     37 };
     38 
     39 }
     40 
     41 #endif // LIBGLESV2_IMAGE_INDEX_H_
     42