1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-19 23:30:25 +00:00

detailed shader debug

This commit is contained in:
Zeno Rogue 2020-11-22 12:59:56 +01:00
parent 162d298927
commit 828753cede

View File

@ -11,6 +11,8 @@
#include "hyper.h" #include "hyper.h"
namespace hr { namespace hr {
EX bool detailed_shader = false;
EX namespace glhr { EX namespace glhr {
EX glvertex pointtogl(const hyperpoint& t) { EX glvertex pointtogl(const hyperpoint& t) {
glvertex h; glvertex h;
@ -489,6 +491,9 @@ EX void set_modelview(const glmatrix& modelview) {
auto& cur = current_glprogram; auto& cur = current_glprogram;
if(!cur) return; 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) { if(using_eyeshift) {
glmatrix mvp = modelview * eyeshift; glmatrix mvp = modelview * eyeshift;
#if MINIMIZE_GL_CALLS #if MINIMIZE_GL_CALLS
@ -550,6 +555,7 @@ EX void full_enable(shared_ptr<GLprogram> p) {
cur = p; cur = p;
GLERR("pre_switch_mode"); GLERR("pre_switch_mode");
WITHSHADER({ WITHSHADER({
if(detailed_shader) println(hlog, "\n*** ENABLING VERTEX SHADER:\n", cur->_vsh, "\n\nENABLING FRAGMENT SHADER:\n", cur->_fsh, "\n");
glUseProgram(cur->_program); glUseProgram(cur->_program);
GLERR("after_enable"); GLERR("after_enable");
}, { }, {