medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit d00e861f68948b239f31ab2e0bd12373bad557ce
parent 69476a2ff1f78785da71b0b8fe1dbcb9a9b32862
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Thu Nov  3 19:23:31 +0200

Paranoia checked_cast in UBO binding

Diffstat:
renderer.cc | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/renderer.cc b/renderer.cc @@ -171,11 +171,11 @@ Shader renderer_new_shader( ShaderConfig config ) { glLinkProgram( program ); const char * ubo_names[] = { "v_hot", "v_cold", "f_hot", "f_cold" }; - const GLuint ubo_bindings[] = { UBO_VS_HOT, UBO_VS_COLD, UBO_FS_HOT, UBO_FS_COLD }; + const u32 ubo_bindings[] = { UBO_VS_HOT, UBO_VS_COLD, UBO_FS_HOT, UBO_FS_COLD }; for( size_t i = 0; i < ARRAY_COUNT( ubo_names ); i++ ) { GLuint idx = glGetUniformBlockIndex( program, ubo_names[ i ] ); if( idx != GL_INVALID_INDEX ) { - glUniformBlockBinding( program, idx, ubo_bindings[ i ] ); + glUniformBlockBinding( program, idx, checked_cast< GLuint >( ubo_bindings[ i ] ) ); } }