Skip to content

Conversation

@andersblomqvist
Copy link

Linker error std output

Instead of hard coding the size of the log:

// current
GLchar log[10240];
GLsizei length;
glGetProgramInfoLog(shader_program, 10239, &length, log);

we instead get the size from OpenGL:

// proposed new
GLint max_length = 0;
glGetProgramiv(shader_program, GL_INFO_LOG_LENGTH, &max_length);
std::vector<GLchar> info_log(max_length);
glGetProgramInfoLog(shader_program, max_length, &max_length, &info_log[0]);

This solves the issue where blank space would be printed instead of the actual info message. I encountered this issue when the log was quite long.

Showcase

This example shows the linker log when trying to link my nanorenderer.comp shader.

New output

File Name TextFileRead "C:/Users/ander/Documents/volume_renderer/cppvolrend/openvdb/nanorenderer.comp"
Compute info
------------
0(3496) : warning C7050: "acc.key" might be used before being initialized
0(3496) : warning C7050: "acc.leaf.address.byte_offset" might be used before being initialized
0(3496) : warning C7050: "acc.lower.address.byte_offset" might be used before being initialized
0(3496) : warning C7050: "acc.upper.address.byte_offset" might be used before being initialized
0(3496) : warning C7050: "acc.root.address.byte_offset" might be used before being initialized
0(698) : error C5025: lvalue in array access too complex
0(698) : error C1068: ... or possible array index out of bounds

Error in linking compute shader program

C:\Users\anders\Documents\volume_renderer\bin\Debug\cppvolrend.exe (process 5704) exited with code 41 (0x29).

Old output

File Name TextFileRead "C:/Users/ander/Documents/volume_renderer/cppvolrend/openvdb/nanorenderer.comp"
Error in linking compute shader program
Linker log:


C:\Users\ander\Documents\volume_renderer\bin\Debug\cppvolrend.exe (process 7708) exited with code 41 (0x29).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant