diff --git a/renderdoc/driver/gl/gl_debug.cpp b/renderdoc/driver/gl/gl_debug.cpp index 76280d869..5c26efb3a 100644 --- a/renderdoc/driver/gl/gl_debug.cpp +++ b/renderdoc/driver/gl/gl_debug.cpp @@ -150,7 +150,7 @@ void GLReplay::InitDebugData() for(size_t i=0; i < ARRAY_COUNT(DebugData.UBOs); i++) { gl.glBindBuffer(eGL_UNIFORM_BUFFER, DebugData.UBOs[i]); - gl.glBufferData(eGL_UNIFORM_BUFFER, DebugData.UBOSize, NULL, eGL_DYNAMIC_DRAW); + gl.glBufferData(eGL_UNIFORM_BUFFER, Debug_UBOSize, NULL, eGL_DYNAMIC_DRAW); } DebugData.overlayTexWidth = DebugData.overlayTexHeight = 0; @@ -262,7 +262,7 @@ bool GLReplay::RenderTexture(TextureDisplay cfg) uboData *ubo = (uboData *)gl.glMapBufferRange(eGL_UNIFORM_BUFFER, 0, sizeof(uboData), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT); - RDCCOMPILE_ASSERT(sizeof(uboData) <= DebugData.UBOSize, "UBO data is too big"); + RDCCOMPILE_ASSERT(sizeof(uboData) <= Debug_UBOSize, "UBO data is too big"); float x = cfg.offx; float y = cfg.offy; diff --git a/renderdoc/driver/gl/gl_replay.h b/renderdoc/driver/gl/gl_replay.h index 489498981..f24314882 100644 --- a/renderdoc/driver/gl/gl_replay.h +++ b/renderdoc/driver/gl/gl_replay.h @@ -204,10 +204,11 @@ class GLReplay : public IReplayDriver GLint overlayTexWidth, overlayTexHeight; GLuint UBOs[2]; - static const size_t UBOSize = 64 * sizeof(Vec4f); GLuint emptyVAO; } DebugData; + + static const size_t Debug_UBOSize = 64 * sizeof(Vec4f); void InitDebugData(); diff --git a/renderdoc/maths/matrix.cpp b/renderdoc/maths/matrix.cpp index 4c13fbcdb..2344f725e 100644 --- a/renderdoc/maths/matrix.cpp +++ b/renderdoc/maths/matrix.cpp @@ -242,8 +242,8 @@ Matrix4f Matrix4f::Orthographic(const float near, const float far) float T = 10.0f; float B = -10.0f; - float N = -abs(far-near)*0.5f; - float F = abs(far-near)*0.5f; + float N = -fabs(far-near)*0.5f; + float F = fabs(far-near)*0.5f; if(far < near) {