From 5dab47a5a2130976c00ba1fdcb057b261dcac435 Mon Sep 17 00:00:00 2001 From: mwilsnd Date: Fri, 2 Jun 2023 14:00:17 -0500 Subject: [PATCH] Drawable Renderer (#1570), Fix sampler state management in Texture2D --- src/mbgl/gl/texture2d.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mbgl/gl/texture2d.cpp b/src/mbgl/gl/texture2d.cpp index e22b2d7fb..d786e57a6 100644 --- a/src/mbgl/gl/texture2d.cpp +++ b/src/mbgl/gl/texture2d.cpp @@ -81,6 +81,7 @@ platform::GLuint Texture2D::getTextureID() const noexcept { void Texture2D::updateSamplerConfiguration() noexcept { using namespace platform; + samplerStateDirty = false; MBGL_CHECK_ERROR( glTexParameteri(GL_TEXTURE_2D, @@ -146,9 +147,7 @@ void Texture2D::upload(const void* pixelData, const Size& size_) noexcept { // Bind to TU 0 and upload context.activeTextureUnit = 0; context.texture[0] = getTextureID(); - if (samplerStateDirty) { - updateSamplerConfiguration(); - } + updateSamplerConfiguration(); if (size_ == Size{0, 0} || size_ != size) { size = size_;