From 0ecf599267f76c0a71dfea3bccd8bfbc22942b32 Mon Sep 17 00:00:00 2001 From: samcake Date: Tue, 2 May 2017 17:19:22 -0700 Subject: [PATCH] Adressing the warning --- libraries/gpu-gl/src/gpu/gl/GLShared.h | 2 ++ libraries/gpu-gl/src/gpu/gl41/GL41BackendTexture.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/gpu-gl/src/gpu/gl/GLShared.h b/libraries/gpu-gl/src/gpu/gl/GLShared.h index 22f63363d1..1b898e5c22 100644 --- a/libraries/gpu-gl/src/gpu/gl/GLShared.h +++ b/libraries/gpu-gl/src/gpu/gl/GLShared.h @@ -18,6 +18,8 @@ Q_DECLARE_LOGGING_CATEGORY(gpugllogging) Q_DECLARE_LOGGING_CATEGORY(trace_render_gpu_gl) Q_DECLARE_LOGGING_CATEGORY(trace_render_gpu_gl_detail) +#define BUFFER_OFFSET(bytes) ((GLubyte*) nullptr + (bytes)) + namespace gpu { namespace gl { // Create a fence and inject a GPU wait on the fence diff --git a/libraries/gpu-gl/src/gpu/gl41/GL41BackendTexture.cpp b/libraries/gpu-gl/src/gpu/gl41/GL41BackendTexture.cpp index 527b503571..c2cef5a21e 100644 --- a/libraries/gpu-gl/src/gpu/gl41/GL41BackendTexture.cpp +++ b/libraries/gpu-gl/src/gpu/gl41/GL41BackendTexture.cpp @@ -396,7 +396,7 @@ void copyCompressedTexGPUMem(const gpu::Texture& texture, GLenum texTarget, GLui uint16_t sourceLevel = mip - srcMipOffset; for (GLint f = 0; f < (GLint)faceTargets.size(); f++) { - glGetCompressedTexImage(faceTargets[f], sourceLevel, (void*) (sourceMip._offset + f * sourceMip._faceSize)); + glGetCompressedTexImage(faceTargets[f], sourceLevel, BUFFER_OFFSET(sourceMip._offset + f * sourceMip._faceSize)); } (void)CHECK_GL_ERROR(); } @@ -422,7 +422,7 @@ void copyCompressedTexGPUMem(const gpu::Texture& texture, GLenum texTarget, GLui glGetTexLevelParameteriv(faceTargets.front(), destLevel, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &destSize); #endif glCompressedTexSubImage2D(faceTargets[f], destLevel, 0, 0, sourceMip._width, sourceMip._height, internalFormat, - sourceMip._faceSize, (void*)(sourceMip._offset + f * sourceMip._faceSize)); + sourceMip._faceSize, BUFFER_OFFSET(sourceMip._offset + f * sourceMip._faceSize)); gpu::gl::checkGLError(); } }