From 91fb217f7b87411a3e583d3d6760b908e78fbf85 Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Sat, 24 Feb 2024 15:40:47 +0100 Subject: [PATCH] opengl: print an error if trying to set uniforms which don't exist --- src/core/opengl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/opengl.cpp b/src/core/opengl.cpp index ad82ae07d..e3cb494ac 100644 --- a/src/core/opengl.cpp +++ b/src/core/opengl.cpp @@ -633,6 +633,11 @@ class program_t::impl uniforms[active_program_idx][name] = GL_CALL(glGetUniformLocation(id[active_program_idx], name.c_str())); + if (uniforms[active_program_idx][name] == -1) + { + LOGE("Uniform ", name, " not found in program"); + } + return uniforms[active_program_idx][name]; }