CGFloat is a typedef variable. In a 32-bit build environment, this is single-point, on a 64-bit one, double precision. This will usually not be a big problem, but you are using glUniform4fv , which accepts GLfloat * .
; ; <http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#page=22 "rel =" noreferrer "> OpenGL ES 2.0 Specification - GL Basic Operation - p. 12

OpenGL stipulates that GLfloat always a floating point value with a single precision, and compilers can deal with a double-precision downgrade to one precision when using a version that does not contain pointers to this function. When you use pointers, this behavior does not happen - OpenGL expects to transmit an array of single-point floats, but you pass it an array of floats with double precision without type conversion.
You need to stop using CGFloat . Use GLfloat . OpenGL typedefs are provided to ensure this kind of thing never happens.
Andon M. coleman
source share