Add glu::BufferOffsetAsPointer utility
authorJesse Hall <jessehall@google.com>
Tue, 27 Mar 2018 23:49:03 +0000 (16:49 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 29 Mar 2018 14:51:49 +0000 (10:51 -0400)
commit05d98991304fce712732124e5e12fb670ee5a799
treea431a7762d1dd80def0070ec4c65b473b27684b6
parent9f43e2f0a07d18951ca79b13ccc7c722805bec9c
Add glu::BufferOffsetAsPointer utility

Clang 6.x adds a warning that doing arithmetic involving a NULL
pointer is a GNU extension. This affects the common GL pattern
    (deUint8*)DE_NULL + offset
used to pass an offset into a bound buffer object as a client pointer
parameter.

This change replaces that pattern with a call to a new utility
function glu::BufferOffsetAsPointer(), which will hopefully be
warning-free on all compilers.

Change-Id: I8be939297b02c44091441c71ae75e45ceab30639
Components: Framework, OpenGL, AOSP
13 files changed:
external/openglcts/modules/gl/gl4cDirectStateAccessTexturesTests.cpp
external/openglcts/modules/gl/gl4cDirectStateAccessVertexArraysTests.cpp
framework/opengl/gluDefs.hpp
framework/opengl/simplereference/sglrReferenceContext.cpp
modules/gles3/functional/es3fShaderStateQueryTests.cpp
modules/gles3/performance/es3pBufferDataUploadTests.cpp
modules/gles31/functional/es31fDrawTests.cpp
modules/gles31/functional/es31fGeometryShaderTests.cpp
modules/gles31/functional/es31fMultisampleShaderRenderCase.cpp
modules/gles31/functional/es31fPrimitiveBoundingBoxTests.cpp
modules/gles31/functional/es31fVertexAttributeBindingStateQueryTests.cpp
modules/gles31/functional/es31fVertexAttributeBindingTests.cpp
modules/glshared/glsDrawTest.cpp