diff options
Diffstat (limited to 'source/blender/gpu/opengl/gl_vertex_array.cc')
-rw-r--r-- | source/blender/gpu/opengl/gl_vertex_array.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/gpu/opengl/gl_vertex_array.cc b/source/blender/gpu/opengl/gl_vertex_array.cc index 14a7b4deb7d..ea2770f099d 100644 --- a/source/blender/gpu/opengl/gl_vertex_array.cc +++ b/source/blender/gpu/opengl/gl_vertex_array.cc @@ -62,20 +62,21 @@ static uint16_t vbo_bind(const ShaderInterface *interface, offset = a->offset; } - const GLvoid *pointer = (const GLubyte *)0 + offset + v_first * stride; + /* This is in fact an offset in memory. */ + const GLvoid *pointer = (const GLubyte *)(intptr_t)(offset + v_first * stride); const GLenum type = to_gl(static_cast<GPUVertCompType>(a->comp_type)); for (uint n_idx = 0; n_idx < a->name_len; n_idx++) { const char *name = GPU_vertformat_attr_name_get(format, a, n_idx); const ShaderInput *input = interface->attr_get(name); - if (input == NULL) { + if (input == nullptr) { continue; } enabled_attrib |= (1 << input->location); - if (a->comp_len == 16 || a->comp_len == 12 || a->comp_len == 8) { + if (ELEM(a->comp_len, 16, 12, 8)) { BLI_assert(a->fetch_mode == GPU_FETCH_FLOAT); BLI_assert(a->comp_type == GPU_COMP_F32); for (int i = 0; i < a->comp_len / 4; i++) { @@ -168,4 +169,4 @@ void GLVertArray::update_bindings(const GLuint vao, /** \} */ -} // namespace blender::gpu
\ No newline at end of file +} // namespace blender::gpu |