Add error when opening a GL capture that uses unsupported function

This commit is contained in:
baldurk
2020-03-19 10:49:48 +00:00
parent 446e209caf
commit 7b8eeaa8c4
7 changed files with 29 additions and 28 deletions
+2 -1
View File
@@ -437,8 +437,9 @@ T CheckConstParam(T t);
// functions/extensions on replay could suffice. So we check at the last minute on replay and bail
// out if it's not present
#define CheckReplayFunctionPresent(func) \
if(func == NULL) \
if(GL.func == NULL) \
{ \
RDCERR("Function " #func " not available on replay."); \
m_FailedReplayStatus = ReplayStatus::APIHardwareUnsupported; \
return false; \
}
@@ -373,7 +373,7 @@ bool WrappedOpenGL::Serialise_glDispatchComputeGroupSizeARB(SerialiserType &ser,
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glDispatchComputeGroupSizeARB);
CheckReplayFunctionPresent(glDispatchComputeGroupSizeARB);
GL.glDispatchComputeGroupSizeARB(num_groups_x, num_groups_y, num_groups_z, group_size_x,
group_size_y, group_size_z);
@@ -478,7 +478,7 @@ bool WrappedOpenGL::Serialise_glDispatchComputeIndirect(SerialiserType &ser, GLi
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glDispatchComputeIndirect);
CheckReplayFunctionPresent(glDispatchComputeIndirect);
GL.glDispatchComputeIndirect((GLintptr)offset);
@@ -1184,7 +1184,7 @@ bool WrappedOpenGL::Serialise_glDrawArraysIndirect(SerialiserType &ser, GLenum m
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glDrawArraysIndirect);
CheckReplayFunctionPresent(glDrawArraysIndirect);
if(Check_SafeDraw(false))
GL.glDrawArraysIndirect(mode, (const void *)offset);
@@ -1501,7 +1501,7 @@ bool WrappedOpenGL::Serialise_glDrawElementsIndirect(SerialiserType &ser, GLenum
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glDrawElementsIndirect);
CheckReplayFunctionPresent(glDrawElementsIndirect);
if(Check_SafeDraw(true))
GL.glDrawElementsIndirect(mode, type, (const void *)offset);
@@ -2671,7 +2671,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirect(SerialiserType &ser, GLe
{
if(IsLoading(m_State))
{
CheckReplayFunctionPresent(GL.glMultiDrawArraysIndirect);
CheckReplayFunctionPresent(glMultiDrawArraysIndirect);
if(Check_SafeDraw(false))
GL.glMultiDrawArraysIndirect(mode, (const void *)offset, drawcount, stride);
@@ -2891,7 +2891,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirect(SerialiserType &ser, G
{
if(IsLoading(m_State))
{
CheckReplayFunctionPresent(GL.glMultiDrawElementsIndirect);
CheckReplayFunctionPresent(glMultiDrawElementsIndirect);
GLRenderState state;
state.FetchState(this);
@@ -3124,7 +3124,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirectCount(SerialiserType &ser
if(IsLoading(m_State))
{
CheckReplayFunctionPresent(GL.glMultiDrawArraysIndirectCount);
CheckReplayFunctionPresent(glMultiDrawArraysIndirectCount);
if(Check_SafeDraw(false))
GL.glMultiDrawArraysIndirectCount(mode, (const void *)offset, (GLintptr)drawcount,
@@ -3356,7 +3356,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirectCount(SerialiserType &s
if(IsLoading(m_State))
{
CheckReplayFunctionPresent(GL.glMultiDrawElementsIndirectCount);
CheckReplayFunctionPresent(glMultiDrawElementsIndirectCount);
if(Check_SafeDraw(true))
GL.glMultiDrawElementsIndirectCount(mode, type, (const void *)offset, (GLintptr)drawcount,
@@ -604,7 +604,7 @@ bool WrappedOpenGL::Serialise_glFramebufferTexture2DMultisampleEXT(
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glFramebufferTexture2DMultisampleEXT);
CheckReplayFunctionPresent(glFramebufferTexture2DMultisampleEXT);
if(framebuffer.name == 0)
framebuffer.name = m_CurrentDefaultFBO;
@@ -1133,7 +1133,7 @@ bool WrappedOpenGL::Serialise_glFramebufferTextureMultiviewOVR(SerialiserType &s
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glFramebufferTextureMultiviewOVR);
CheckReplayFunctionPresent(glFramebufferTextureMultiviewOVR);
GL.glFramebufferTextureMultiviewOVR(target, attachment, texture.name, level, baseViewIndex,
numViews);
@@ -1248,7 +1248,7 @@ bool WrappedOpenGL::Serialise_glFramebufferTextureMultisampleMultiviewOVR(
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glFramebufferTextureMultisampleMultiviewOVR);
CheckReplayFunctionPresent(glFramebufferTextureMultisampleMultiviewOVR);
GL.glFramebufferTextureMultisampleMultiviewOVR(target, attachment, texture.name, level, samples,
baseViewIndex, numViews);
@@ -2491,7 +2491,7 @@ bool WrappedOpenGL::Serialise_glNamedRenderbufferStorageMultisampleEXT(Serialise
{
// the DSA function is emulated if not present, but we need to check the underlying function is
// present
CheckReplayFunctionPresent(GL.glRenderbufferStorageMultisample);
CheckReplayFunctionPresent(glRenderbufferStorageMultisample);
ResourceId liveId = GetResourceManager()->GetID(renderbuffer);
TextureData &texDetails = m_Textures[liveId];
@@ -2686,7 +2686,7 @@ bool WrappedOpenGL::Serialise_glRenderbufferStorageMultisampleEXT(SerialiserType
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glRenderbufferStorageMultisampleEXT);
CheckReplayFunctionPresent(glRenderbufferStorageMultisampleEXT);
ResourceId liveId = GetResourceManager()->GetID(renderbuffer);
TextureData &texDetails = m_Textures[liveId];
@@ -541,7 +541,7 @@ bool WrappedOpenGL::Serialise_glCreateMemoryObjectsEXT(SerialiserType &ser, GLsi
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glCreateMemoryObjectsEXT);
CheckReplayFunctionPresent(glCreateMemoryObjectsEXT);
GLuint real = 0;
GL.glCreateMemoryObjectsEXT(1, &real);
@@ -623,7 +623,7 @@ bool WrappedOpenGL::Serialise_glMemoryObjectParameterivEXT(SerialiserType &ser,
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glMemoryObjectParameterivEXT);
CheckReplayFunctionPresent(glMemoryObjectParameterivEXT);
GL.glMemoryObjectParameterivEXT(memoryObject.name, pname, params);
@@ -816,7 +816,7 @@ bool WrappedOpenGL::Serialise_glGenSemaphoresEXT(SerialiserType &ser, GLsizei n,
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glGenSemaphoresEXT);
CheckReplayFunctionPresent(glGenSemaphoresEXT);
GLuint real = 0;
GL.glGenSemaphoresEXT(1, &real);
@@ -898,7 +898,7 @@ bool WrappedOpenGL::Serialise_glSemaphoreParameterui64vEXT(SerialiserType &ser,
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glSemaphoreParameterui64vEXT);
CheckReplayFunctionPresent(glSemaphoreParameterui64vEXT);
GL.glSemaphoreParameterui64vEXT(semaphore.name, pname, params);
@@ -1643,7 +1643,7 @@ bool WrappedOpenGL::Serialise_glTextureStorageMem2DMultisampleEXT(
{
// the DSA function is emulated if not present, but we need to check the underlying function is
// present
CheckReplayFunctionPresent(GL.glTexStorage2DMultisample);
CheckReplayFunctionPresent(glTexStorage2DMultisample);
// Replay external texture storage backed by external memory as just a plain texture.
ResourceId liveId = GetResourceManager()->GetID(texture);
@@ -1778,7 +1778,7 @@ bool WrappedOpenGL::Serialise_glCompileShaderIncludeARB(SerialiserType &ser, GLu
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glCompileShaderIncludeARB);
CheckReplayFunctionPresent(glCompileShaderIncludeARB);
ResourceId liveId = GetResourceManager()->GetID(shader);
@@ -1852,7 +1852,7 @@ bool WrappedOpenGL::Serialise_glNamedStringARB(SerialiserType &ser, GLenum type,
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glNamedStringARB);
CheckReplayFunctionPresent(glNamedStringARB);
GL.glNamedStringARB(type, (GLint)name.length(), name.c_str(), (GLint)value.length(),
value.c_str());
@@ -1891,7 +1891,7 @@ bool WrappedOpenGL::Serialise_glDeleteNamedStringARB(SerialiserType &ser, GLint
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glDeleteNamedStringARB);
CheckReplayFunctionPresent(glDeleteNamedStringARB);
GL.glDeleteNamedStringARB((GLint)name.length(), name.c_str());
}
@@ -1941,7 +1941,7 @@ bool WrappedOpenGL::Serialise_glSpecializeShader(SerialiserType &ser, GLuint sha
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glSpecializeShader);
CheckReplayFunctionPresent(glSpecializeShader);
ResourceId liveId = GetResourceManager()->GetID(shader);
@@ -923,7 +923,7 @@ bool WrappedOpenGL::Serialise_glDepthBoundsEXT(SerialiserType &ser, GLclampd nea
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glDepthBoundsEXT);
CheckReplayFunctionPresent(glDepthBoundsEXT);
GL.glDepthBoundsEXT(nearVal, farVal);
}
@@ -1428,7 +1428,7 @@ bool WrappedOpenGL::Serialise_glRasterSamplesEXT(SerialiserType &ser, GLuint sam
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glRasterSamplesEXT);
CheckReplayFunctionPresent(glRasterSamplesEXT);
GL.glRasterSamplesEXT(samples, fixedsamplelocations ? GL_TRUE : GL_FALSE);
}
@@ -1927,7 +1927,7 @@ bool WrappedOpenGL::Serialise_glPolygonOffsetClamp(SerialiserType &ser, GLfloat
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glPolygonOffsetClamp);
CheckReplayFunctionPresent(glPolygonOffsetClamp);
GL.glPolygonOffsetClamp(factor, units, clamp);
}
@@ -1967,7 +1967,7 @@ bool WrappedOpenGL::Serialise_glPrimitiveBoundingBox(SerialiserType &ser, GLfloa
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glPrimitiveBoundingBox);
CheckReplayFunctionPresent(glPrimitiveBoundingBox);
GL.glPrimitiveBoundingBox(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
}
@@ -6644,7 +6644,7 @@ bool WrappedOpenGL::Serialise_glTextureFoveationParametersQCOM(SerialiserType &s
if(IsReplayingAndReading())
{
CheckReplayFunctionPresent(GL.glTextureFoveationParametersQCOM);
CheckReplayFunctionPresent(glTextureFoveationParametersQCOM);
GL.glTextureFoveationParametersQCOM(texture.name, layer, focalPoint, focalX, focalY, gainX,
gainY, foveaArea);