Browse Source

add note about shader bug

testing
cinnaboot 6 years ago
parent
commit
1eb2a2c95e
  1. 7
      src/default_shaders.cpp
  2. 2
      src/shader_program.cpp

7
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()

2
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;

Loading…
Cancel
Save