From ce33f42e626bdf3937db65745c940f443a2182dd Mon Sep 17 00:00:00 2001 From: Philip Rideout Date: Wed, 18 Sep 2019 08:52:19 -0700 Subject: [PATCH] Fix warning in WebGL builds --- filament/backend/src/opengl/OpenGLDriver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filament/backend/src/opengl/OpenGLDriver.cpp b/filament/backend/src/opengl/OpenGLDriver.cpp index b69475ec07..a6b8a6c053 100644 --- a/filament/backend/src/opengl/OpenGLDriver.cpp +++ b/filament/backend/src/opengl/OpenGLDriver.cpp @@ -2286,7 +2286,6 @@ void OpenGLDriver::bindSamplers(size_t index, Handle sbh) { GLuint OpenGLDriver::getSamplerSlow(SamplerParams params) const noexcept { assert(mSamplerMap.find(params.u) == mSamplerMap.end()); - auto& gl = mContext; GLuint s; glGenSamplers(1, &s); @@ -2299,6 +2298,7 @@ GLuint OpenGLDriver::getSamplerSlow(SamplerParams params) const noexcept { glSamplerParameteri(s, GL_TEXTURE_COMPARE_FUNC, getTextureCompareFunc(params.compareFunc)); // TODO: Why does this fail with WebGL 2.0? The run-time check should suffice. #if defined(GL_EXT_texture_filter_anisotropic) && !defined(__EMSCRIPTEN__) + auto& gl = mContext; if (gl.ext.texture_filter_anisotropic) { GLfloat anisotropy = float(1u << params.anisotropyLog2); glSamplerParameterf(s, GL_TEXTURE_MAX_ANISOTROPY_EXT, std::min(gl.gets.maxAnisotropy, anisotropy));