diff --git a/src/dawnopengl/display/shader/ShaderProgram.cpp b/src/dawnopengl/display/shader/ShaderProgram.cpp index a9f1cb81..9620fec8 100644 --- a/src/dawnopengl/display/shader/ShaderProgram.cpp +++ b/src/dawnopengl/display/shader/ShaderProgram.cpp @@ -46,6 +46,35 @@ void ShaderProgram::init( assertNoGLError(); assertUnreachable("Failed to link shader program:\n%s", log); } + + // So the uniforms that are in slang are kinda odd when compiled. + + //DEBUGGING + GLint numUniforms = 0; + glGetProgramiv(this->id, GL_ACTIVE_UNIFORMS, &numUniforms); + assertNoGLError(); + + for(GLint i = 0; i < numUniforms; ++i) { + char name[1024]; + GLsizei length; + GLint size; + GLenum type; + + glGetActiveUniform(this->id, i, sizeof(name), &length, &size, &type, name); + assertNoGLError(); + std::cout << "Uniform: " << i << ": " << name << " has size " << size << " and length " << length << std::endl; + } + + + GLint numUniformBlocks = 0; + glGetProgramiv(this->id, GL_ACTIVE_UNIFORM_BLOCKS, &numUniformBlocks); + + for(GLint i = 0; i < numUniformBlocks; ++i) { + GLint size; + glGetActiveUniformBlockiv(this->id, i, GL_UNIFORM_BLOCK_DATA_SIZE, &size); + assertNoGLError(); + std::cout << "Uniform Block: " << i << " has size " << size << std::endl; + } } ShaderProgram::~ShaderProgram() {