This commit is contained in:
Benau 2016-12-03 14:10:07 +08:00
parent 332811af84
commit 79136e0289
2 changed files with 6 additions and 0 deletions

View File

@ -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())

View File

@ -60,6 +60,7 @@ static std::vector<uint64_t> 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();
}