diff --git a/src/graphics/rtts.cpp b/src/graphics/rtts.cpp index f22d583c5..ab60d7654 100644 --- a/src/graphics/rtts.cpp +++ b/src/graphics/rtts.cpp @@ -292,6 +292,7 @@ RTT::RTT(size_t width, size_t height) glClearColor(.5, .5, .5, .5); glClear(GL_COLOR_BUFFER_BIT); glBindFramebuffer(GL_FRAMEBUFFER, 0); +#if !defined(USE_GLES2) if (CVS->isAZDOEnabled()) { uint64_t handle = @@ -315,16 +316,19 @@ RTT::RTT(size_t width, size_t height) glMakeTextureHandleResidentARB(handle); m_prefilled_handles.push_back(handle); } +#endif } RTT::~RTT() { glBindFramebuffer(GL_FRAMEBUFFER, 0); +#if !defined(USE_GLES2) if (CVS->isAZDOEnabled()) { for (uint64_t& handle : m_prefilled_handles) glMakeTextureHandleNonResidentARB(handle); } +#endif glDeleteTextures(RTT_COUNT, RenderTargetTextures); glDeleteTextures(1, &DepthStencilTexture); if (CVS->isShadowEnabled()) diff --git a/src/graphics/texture_manager.cpp b/src/graphics/texture_manager.cpp index 25d03bb3b..1a2d25a29 100644 --- a/src/graphics/texture_manager.cpp +++ b/src/graphics/texture_manager.cpp @@ -60,6 +60,7 @@ static std::vector texture_handles; void resetTextureTable() { +#if !defined(USE_GLES2) if (CVS->isAZDOEnabled()) { // Driver seems to crash if texture handles are not cleared... @@ -70,6 +71,7 @@ void resetTextureTable() Shaders::ObjectPass1Shader::getInstance()->recreateTrilinearSampler(0); texture_handles.clear(); } +#endif AlreadyTransformedTexture.clear(); }