From 1eb2a2c95ede8488151f1de9eb94e2e44c07049b Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Tue, 5 Jan 2021 10:28:01 -0500 Subject: [PATCH] add note about shader bug --- src/default_shaders.cpp | 7 ++++++- src/shader_program.cpp | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/default_shaders.cpp b/src/default_shaders.cpp index 8d89a8a..86b7b01 100644 --- a/src/default_shaders.cpp +++ b/src/default_shaders.cpp @@ -25,6 +25,11 @@ void main() } )VS"; +// TODO: there's a bug here with the array size of 'lights' +// with intel opengl, size can be >1000 +// but with nvidea opengl size of >200 gives the following error: +// error C6020: Constant register limit exceeded at sampler; +// more than 1024 registers needed to compile program const char* DEFAULT_FRAGMENT_SHADER = R"FS( #version 330 core @@ -46,7 +51,7 @@ struct point_light { float intensity; }; -uniform point_light lights[1000]; +uniform point_light lights[200]; void main() diff --git a/src/shader_program.cpp b/src/shader_program.cpp index ef15f7f..1ddbfe9 100644 --- a/src/shader_program.cpp +++ b/src/shader_program.cpp @@ -19,6 +19,7 @@ bool compileProgram(GLuint& program_id_out, default_shader_program* shaderInitDefault(const char* vertex_code, const char* frag_code) { + LOG(Info) << "loading default shader\n"; default_shader_program* sp = UTIL_ALLOC(1, default_shader_program); GLuint vs_id = 0; GLuint fs_id = 0; @@ -53,6 +54,7 @@ shaderInitDefault(const char* vertex_code, const char* frag_code) simple_shader_program* shaderInitSimple(const char* vertex_code, const char* frag_code) { + LOG(Info) << "loading simple shader\n"; simple_shader_program* sp = UTIL_ALLOC(1, simple_shader_program); GLuint vs_id = 0; GLuint fs_id = 0;