Move CheckConstParam into common code

This commit is contained in:
baldurk
2018-07-06 22:44:21 +01:00
parent 426a6cf3ac
commit ee853f7f33
3 changed files with 11 additions and 10 deletions
+6
View File
@@ -42,6 +42,12 @@ int GLCoreVersion = 0;
bool GLIsCore = false;
bool IsGLES = false;
template <>
bool CheckConstParam(bool t)
{
return t;
}
bool CheckReplayContext(PFNGLGETSTRINGPROC getStr, PFNGLGETINTEGERVPROC getInt,
PFNGLGETSTRINGIPROC getStri)
{
+5
View File
@@ -221,6 +221,11 @@ typedef BOOL(APIENTRYP *PFNWGLDXUNLOCKOBJECTSNVPROC)(HANDLE hDevice, GLint count
#include "api/replay/renderdoc_replay.h"
// bit of a hack, to work around C4127: conditional expression is constant
// on template parameters
template <typename T>
T CheckConstParam(T t);
// define this if you e.g. haven't compiled the D3D modules and want to disable
// interop capture support.
#define RENDERDOC_DX_GL_INTEROP OPTION_ON
@@ -294,16 +294,6 @@ void DoSerialise(SerialiserType &ser, ProgramUniforms &el)
SERIALISE_MEMBER(SSBOBindings);
}
// bit of a hack, to work around C4127: conditional expression is constant
// on template parameters
template <typename T>
T CheckConstParam(T t);
template <>
bool CheckConstParam(bool t)
{
return t;
}
template <const bool CopyUniforms, const bool SerialiseUniforms, typename SerialiserType>
static void ForAllProgramUniforms(SerialiserType *ser, CaptureState state, GLuint progSrc,
GLuint progDst, map<GLint, GLint> *locTranslate)