diff --git a/GL/draw.c b/GL/draw.c index f9ac75c..1787db4 100644 --- a/GL/draw.c +++ b/GL/draw.c @@ -693,7 +693,8 @@ GL_FORCE_INLINE void _readNormalData(const GLuint first, const GLuint count, Ver } GL_FORCE_INLINE void _readDiffuseData(const GLuint first, const GLuint count, Vertex* output) { - const GLuint cstride = (DIFFUSE_POINTER.stride) ? DIFFUSE_POINTER.stride : DIFFUSE_POINTER.size * byte_size(DIFFUSE_POINTER.type); + const GLuint size = (DIFFUSE_POINTER.size == GL_BGRA) ? 4 : DIFFUSE_POINTER.size; + const GLuint cstride = (DIFFUSE_POINTER.stride) ? DIFFUSE_POINTER.stride : size * byte_size(DIFFUSE_POINTER.type); const GLubyte* cptr = ((GLubyte*) DIFFUSE_POINTER.ptr) + (first * cstride); ReadDiffuseFunc func = calcReadDiffuseFunc();