1

I have an opengl toy code that I am using to learn ogl and 3d graphics. I am using glDebugMessageCallback and glDebugMessageControl to check for OGL errors and on windows I did not have any messages. I am now testing my code on linux and I am getting a lot of these message:

Debug message (1): Shader Stats: SGPRS: 16 VGPRS: 12 Code Size: 88 LDS: 0 Scratch: 0 Max Waves: 8 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0 DivergentLoop: 0, InlineUniforms: 0, ParamExports: 2, (VS, W64)
Source: Shader Compiler
Type: Other
Severity: notification

Here is some more info on my environment

[OpenGL] OpenGL version loaded: 4.6
[OpenGL] Vendor: AMD
[OpenGL] Renderer: AMD Radeon RX 570 Series (polaris10, LLVM 13.0.1, DRM 3.44, 5.17.3-302.fc36.x86_64)
[OpenGL] Version: 4.6 (Compatibility Profile) Mesa 22.0.1
[OpenGL] Version GLSL: 4.60

My question is why do i not get these message in windows and why do I keep getting them even if i change my callback from

glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE , 0, nullptr, GL_TRUE);

to

glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH_AMD , 0, nullptr, GL_TRUE);

? they seem informational to me and at this rate they are mostly noise

pattakosn
  • 365
  • 4
  • 13

1 Answers1

2

My question is why do i not get these message in windows

The debug messages are completely implementation-specific. In the worst case, you could not get any message at all. The verbosity of the different drivers can vary a lot, the mesa open source drivers on Linux are notably on the more verbose end of the spectrum. Nvidia Win/Linux is also quite good in that regard, but AMD and INtel on windows can be quite lacking.

and why do I keep getting them even if i change my callback from [...] to

glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH_AMD , 0, nullptr, GL_TRUE);

Because glDebugMessageControl(..., GL_DEBUG_SEVERITY_HIGH_AMD, ..., GL_TRUE) just enables the SEVERITY_HIGH messages (which were enabled before anyways), it does not disable the SEVERITY_NOTIFICATION which are still enabled by default, as stated in the GL_KHR_debug extension specification (the other variants of the debug output exstensions like the AMD one are similar):

Messages can be either enabled or disabled. Messages that are disabled will not be generated. All messages are initially enabled unless their assigned severity is DEBUG_SEVERITY_LOW. The enabled state of messages can be changed using the command DebugMessageControl.

derhass
  • 43,833
  • 2
  • 57
  • 78
  • i thought it may be because of different implementations but i was wandering whether there may be something more. Thank you for the answer. – pattakosn May 01 '22 at 13:59
  • So if I got it correctly, in order to disable the GL_DEBUG_SEVERITY_NOTIFICATION messages and retain the higher severity ones i need to do sth like this: `glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, GL_TRUE);` `glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_NOTIFICATION, 0, nullptr, GL_FALSE);` ? Thanks again, brilliant link BTW (even though a bit too detailed :) ) – pattakosn May 01 '22 at 14:01
  • 1
    You can turn of the individual severities, you can also turn off everything in one call, and then turn back on selectively all the messages you want to receive. However, in my experience, it is easiest to just turn on everything and filter in the debug callback itself, if necessary. Since the debug callback is a debug feature which you usually don't want to have enabled (by default) in release builds, the performance implications of doing so aren't really relevant in most scenarios. – derhass May 01 '22 at 14:07