2019-04-17 10:49:11 +08:00
|
|
|
//
|
|
|
|
// GLTexture.h
|
|
|
|
// MNN
|
|
|
|
//
|
|
|
|
// Created by MNN on 2019/01/31.
|
|
|
|
// Copyright © 2018, Alibaba Group Holding Limited
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef GLTEXTURE_H
|
|
|
|
#define GLTEXTURE_H
|
|
|
|
/*Basic GLTexture, has no mipmap and just support ARGB GLTexture*/
|
2019-12-27 22:16:57 +08:00
|
|
|
#include "backend/opengl/GLHead.hpp"
|
2019-04-17 10:49:11 +08:00
|
|
|
namespace MNN {
|
2019-05-24 11:26:54 +08:00
|
|
|
namespace OpenGL {
|
2019-04-17 10:49:11 +08:00
|
|
|
class GLTexture {
|
|
|
|
public:
|
2019-07-25 13:36:35 +08:00
|
|
|
GLTexture(int w, int h, int d, GLenum textrueFormat, GLenum target = GL_TEXTURE_3D, bool HWC4 = true);
|
2019-04-17 10:49:11 +08:00
|
|
|
virtual ~GLTexture();
|
|
|
|
unsigned int id() const {
|
|
|
|
return mId;
|
|
|
|
}
|
|
|
|
|
|
|
|
void read(GLuint unit);
|
|
|
|
void write(GLuint unit);
|
|
|
|
void sample(GLuint unit, GLuint texId);
|
|
|
|
|
|
|
|
private:
|
|
|
|
unsigned int mId;
|
|
|
|
GLenum mTarget;
|
2019-07-25 13:36:35 +08:00
|
|
|
GLenum mTextrueFormat{GL_RGBA32F};
|
2019-04-17 10:49:11 +08:00
|
|
|
};
|
2019-05-24 11:26:54 +08:00
|
|
|
} // namespace OpenGL
|
2019-04-17 10:49:11 +08:00
|
|
|
} // namespace MNN
|
|
|
|
|
|
|
|
#endif
|