Loading libs/rs/rsContext.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -236,6 +236,7 @@ bool Context::initGLThread() { glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &mGL.mMaxFragmentUniformVectors); mGL.OES_texture_npot = NULL != strstr((const char *)mGL.mExtensions, "GL_OES_texture_npot"); mGL.GL_IMG_texture_npot = NULL != strstr((const char *)mGL.mExtensions, "GL_IMG_texture_npot"); mGL.GL_NV_texture_npot_2D_mipmap = NULL != strstr((const char *)mGL.mExtensions, "GL_NV_texture_npot_2D_mipmap"); mGL.EXT_texture_max_aniso = 1.0f; bool hasAniso = NULL != strstr((const char *)mGL.mExtensions, "GL_EXT_texture_filter_anisotropic"); Loading libs/rs/rsContext.h +2 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,7 @@ public: mutable const ObjectBase * mObjHead; bool ext_OES_texture_npot() const {return mGL.OES_texture_npot;} bool ext_GL_IMG_texture_npot() const {return mGL.GL_IMG_texture_npot;} bool ext_GL_NV_texture_npot_2D_mipmap() const {return mGL.GL_NV_texture_npot_2D_mipmap;} float ext_texture_max_aniso() const {return mGL.EXT_texture_max_aniso; } uint32_t getMaxFragmentTextures() const {return mGL.mMaxFragmentTextureImageUnits;} Loading Loading @@ -249,6 +250,7 @@ protected: int32_t mMaxVertexTextureUnits; bool OES_texture_npot; bool GL_IMG_texture_npot; bool GL_NV_texture_npot_2D_mipmap; float EXT_texture_max_aniso; } mGL; Loading libs/rs/rsSampler.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -77,8 +77,20 @@ void Sampler::setupGL(const Context *rsc, const Allocation *tex) { GLenum target = (GLenum)tex->getGLTarget(); if (!rsc->ext_OES_texture_npot() && tex->getType()->getIsNp2()) { if (tex->getHasGraphicsMipmaps() && rsc->ext_GL_NV_texture_npot_2D_mipmap()) { if (tex->getHasGraphicsMipmaps() && (rsc->ext_GL_NV_texture_npot_2D_mipmap() || rsc->ext_GL_IMG_texture_npot())) { if (rsc->ext_GL_NV_texture_npot_2D_mipmap()) { glTexParameteri(target, GL_TEXTURE_MIN_FILTER, trans[mMinFilter]); } else { switch (trans[mMinFilter]) { case GL_LINEAR_MIPMAP_LINEAR: glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); break; default: glTexParameteri(target, GL_TEXTURE_MIN_FILTER, trans[mMinFilter]); break; } } } else { glTexParameteri(target, GL_TEXTURE_MIN_FILTER, transNP[mMinFilter]); } Loading Loading
libs/rs/rsContext.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -236,6 +236,7 @@ bool Context::initGLThread() { glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &mGL.mMaxFragmentUniformVectors); mGL.OES_texture_npot = NULL != strstr((const char *)mGL.mExtensions, "GL_OES_texture_npot"); mGL.GL_IMG_texture_npot = NULL != strstr((const char *)mGL.mExtensions, "GL_IMG_texture_npot"); mGL.GL_NV_texture_npot_2D_mipmap = NULL != strstr((const char *)mGL.mExtensions, "GL_NV_texture_npot_2D_mipmap"); mGL.EXT_texture_max_aniso = 1.0f; bool hasAniso = NULL != strstr((const char *)mGL.mExtensions, "GL_EXT_texture_filter_anisotropic"); Loading
libs/rs/rsContext.h +2 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,7 @@ public: mutable const ObjectBase * mObjHead; bool ext_OES_texture_npot() const {return mGL.OES_texture_npot;} bool ext_GL_IMG_texture_npot() const {return mGL.GL_IMG_texture_npot;} bool ext_GL_NV_texture_npot_2D_mipmap() const {return mGL.GL_NV_texture_npot_2D_mipmap;} float ext_texture_max_aniso() const {return mGL.EXT_texture_max_aniso; } uint32_t getMaxFragmentTextures() const {return mGL.mMaxFragmentTextureImageUnits;} Loading Loading @@ -249,6 +250,7 @@ protected: int32_t mMaxVertexTextureUnits; bool OES_texture_npot; bool GL_IMG_texture_npot; bool GL_NV_texture_npot_2D_mipmap; float EXT_texture_max_aniso; } mGL; Loading
libs/rs/rsSampler.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -77,8 +77,20 @@ void Sampler::setupGL(const Context *rsc, const Allocation *tex) { GLenum target = (GLenum)tex->getGLTarget(); if (!rsc->ext_OES_texture_npot() && tex->getType()->getIsNp2()) { if (tex->getHasGraphicsMipmaps() && rsc->ext_GL_NV_texture_npot_2D_mipmap()) { if (tex->getHasGraphicsMipmaps() && (rsc->ext_GL_NV_texture_npot_2D_mipmap() || rsc->ext_GL_IMG_texture_npot())) { if (rsc->ext_GL_NV_texture_npot_2D_mipmap()) { glTexParameteri(target, GL_TEXTURE_MIN_FILTER, trans[mMinFilter]); } else { switch (trans[mMinFilter]) { case GL_LINEAR_MIPMAP_LINEAR: glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); break; default: glTexParameteri(target, GL_TEXTURE_MIN_FILTER, trans[mMinFilter]); break; } } } else { glTexParameteri(target, GL_TEXTURE_MIN_FILTER, transNP[mMinFilter]); } Loading