Handle glTextureBufferRangeEXT not being available

* This way we don't have to require GL_ARB_texture_buffer_range as well
  when technically it should only be needed if the application used it.
This commit is contained in:
baldurk
2015-07-23 23:06:25 +02:00
parent dcc5362dc1
commit 296d7e39b1
3 changed files with 24 additions and 3 deletions
+1
View File
@@ -313,6 +313,7 @@ enum DebugMessageSource
eDbgSource_GeneralPerformance,
eDbgSource_GCNPerformance,
eDbgSource_RuntimeWarning,
eDbgSoruce_UnsupportedConfiguration,
};
enum ResourceUsage
+21 -3
View File
@@ -1660,9 +1660,27 @@ void GLResourceManager::Apply_InitialState(GLResource live, InitialContentData i
}
else
{
// restore texbuffer only state
gl.glTextureBufferRangeEXT(live.name, eGL_TEXTURE_BUFFER, details.internalFormat,
GetLiveResource(state->texBuffer).name, state->texBufOffs, state->texBufSize);
GLuint buffer = GetLiveResource(state->texBuffer).name;
if(gl.glTextureBufferRangeEXT)
{
// restore texbuffer only state
gl.glTextureBufferRangeEXT(live.name, eGL_TEXTURE_BUFFER, details.internalFormat, buffer, state->texBufOffs, state->texBufSize);
}
else
{
uint32_t bufSize = 0;
gl.glGetNamedBufferParameterivEXT(buffer, eGL_BUFFER_SIZE, (GLint *)&bufSize);
if(state->texBufOffs > 0 || state->texBufSize > bufSize)
{
const char *msg = "glTextureBufferRangeEXT is not supported on your GL implementation, but is needed for correct replay.\n"
"The original capture created a texture buffer with a range - replay will use the whole buffer, which is likely incorrect.";
RDCERR("%s", msg);
m_GL->AddDebugMessage(eDbgCategory_Resource_Manipulation, eDbgSeverity_High, eDbgSource_IncorrectAPIUse, msg);
}
gl.glTextureBufferEXT(live.name, eGL_TEXTURE_BUFFER, details.internalFormat, buffer);
}
}
}
else if(live.Namespace == eResProgram)
+2
View File
@@ -283,6 +283,7 @@ namespace renderdoc
GeneralPerformance,
GCNPerformance,
RuntimeWarning,
UnsupportedConfiguration,
};
public enum DebugMessageCategory
@@ -467,6 +468,7 @@ namespace renderdoc
case DebugMessageSource.GeneralPerformance: return "General Performance issues";
case DebugMessageSource.GCNPerformance: return "GCN (AMD) Performance issues";
case DebugMessageSource.RuntimeWarning: return "Issues raised while debugging";
case DebugMessageSource.UnsupportedConfiguration: return "Unsupported Software or Hardware Configuration";
}
return "Unknown Source";