From 828753cedee3cb631ba2ce68b8bb4a829af5034d Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 22 Nov 2020 12:59:56 +0100 Subject: [PATCH] detailed shader debug --- glhr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/glhr.cpp b/glhr.cpp index 354da23b..a881732a 100644 --- a/glhr.cpp +++ b/glhr.cpp @@ -11,6 +11,8 @@ #include "hyper.h" namespace hr { +EX bool detailed_shader = false; + EX namespace glhr { EX glvertex pointtogl(const hyperpoint& t) { glvertex h; @@ -489,6 +491,9 @@ EX void set_modelview(const glmatrix& modelview) { auto& cur = current_glprogram; if(!cur) return; + if(detailed_shader) println(hlog, "\n*** ENABLING MODELVIEW:\n", modelview.as_stdarray()); + if(detailed_shader) println(hlog, "\n*** ENABLING PROJECTION:\n", projection.as_stdarray()); + if(using_eyeshift) { glmatrix mvp = modelview * eyeshift; #if MINIMIZE_GL_CALLS @@ -550,6 +555,7 @@ EX void full_enable(shared_ptr p) { cur = p; GLERR("pre_switch_mode"); WITHSHADER({ + if(detailed_shader) println(hlog, "\n*** ENABLING VERTEX SHADER:\n", cur->_vsh, "\n\nENABLING FRAGMENT SHADER:\n", cur->_fsh, "\n"); glUseProgram(cur->_program); GLERR("after_enable"); }, {