0

My understanding of the OpenGL ARB_debug_output extension is that it is designed to enable reporting of events from the driver or, if needed, from the graphical application (ie. from the CPU-run code).

Is there any way custom events could be emitted from the shaders, so as to ease their debugging? Or, if this is not possible, to piggyback on an existing, shader-triggable event?

I am aware of the very adverse impact this would have on performances, but this extension is already designed for a debug context anyway.

1
  • There really is no such thing as a shader-triggerable event, at least not in any portable sense. Some cross-vendor HLSL tools and at least one NV-specific GLSL tool let you insert breakpoints into shaders, but that is way beyond the scope of GL, you need something much closer to the actual hardware/driver. Commented May 8, 2014 at 21:28

1 Answer 1

1

No, there isn't.

Not only does modern GPU hardware probably not support something like this, but a fragment shader can execute hundreds of times for even one triangle, and if each one of those executions sends an event, it would very much bog everything down.

Sign up to request clarification or add additional context in comments.

7 Comments

wrt performance issues: that would be a debugging event triggered by a specific test/situation, and only used in a debugging setting. So this is not different from the issues asociated with a typical logging system, which we are used to cope with without slowing apps to an halt.
That doesn't change the fact that this simply doesn't exist, and probably won't because shaders don't even have a string type, let alone the hardware to send this stuff to the CPU.
There's a big difference between writing one vertex/fragment per invocation and sending back potentially multiple strings.
It is technically possible to generate interrupts based on GPU execution, sparse textures require them. However, shader languages do not expose this capability. Some vendor-specific applications like nSight from NV are based on this, they will let you insert breakpoints into GLSL code and debug them interactively on the GPU. Microsoft also has this capability for HLSL, but it is implemented by evaluating the shaders in software and extremely slow. Nevertheless, no tool currently in existence is going to let you do a trace log or anything like that, the best you can really do is breakpoints.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.