baldurk / renderdoc

RenderDoc is a stand-alone graphics debugging tool.
https://renderdoc.org
MIT License
8.99k stars 1.35k forks source link

Shader Debugging is not supported on OpenGL #293

Open karyon opened 8 years ago

karyon commented 8 years ago

When clicking on the "Debug Compute Shader", literally nothing happens.

I have a GTX 750 Ti, driver version 364.72, Windows 10, using OpenGL. i also tested it with another random OpenGL app (tesseract) i had on the machine.

baldurk commented 8 years ago

Yes, shader debugging and pixel history are both only supported on D3D11 currently. This should be made more obvious in the UI though when you're using a different API.

Would you mind opening a separate bug for one of them (either debugging or pixel history)? Since both features are a large task I'd rather track them separately.

karyon commented 8 years ago

yeah sure.

chrisfairc commented 6 years ago

This would be awesome!

Inori commented 4 years ago

there's a spirv-vm by @dfranx can it be added to renderdoc?

jnhyatt commented 4 years ago

DirectX has gotten me used to SPIR-V debugging. GLSL debugging would be nice, but at this point, anything would make me very happy. Is this on the roadmap? Perhaps for 1.10...?

baldurk commented 4 years ago

That makes no sense, DirectX doesn't use SPIR-V.

Shader debugging for OpenGL may happen at some point now since SPIR-V debugging has been implemented for vulkan, but certainly not in the next release. It is still quite low priority due to OpenGL being a flawed API not suited to shader debugging.

The most that could be supported would be debugging GL shaders that are either already SPIR-V - which is extremely rare - or modern enough GLSL that they can be compiled to SPIR-V - which is still quite rare as the large majority of people using OpenGL are using old/legacy shaders. Those who use modern shaders likely don't use OpenGL. That is partly why it's low priority since it would be only implementing partial support for a subset of users.

Trass3r commented 11 months ago

GLSL that they can be compiled to SPIR-V

Looks like RenderDoc is already doing this for reflection purposes. Could that be reused for debugging?

listevemeta commented 8 months ago

What's the current status for OpenGL Pixel History and Shader debugging? I am trying it on a VR app on Quest2. I noticed that the pixel history button only shows me the glClear() call in the list, but never shows me a glDraw call.

baldurk commented 8 months ago

This issue is about shader debugging on OpenGL, which is not supported. If you are encountering a bug with using the pixel history please file an issue about it and follow the issue template for a bug report, do not report it here.

bryanedds commented 3 months ago

I'd like to investigate the scope of effort required for an individual contributor such as myself to implement this feature.

Any advice on how to get started on that? I'm at the point where I can make this my first priority, nearly regardless of how long it takes. But before getting started, I'd like to know what I'm getting myself into and if any guidance would be available from the maintainers in the process :)

baldurk commented 2 months ago

The effort would be quite high, and I would not recommend this as your first contribution to the project as it will be quite complex to implement. The most feasible implementation would be as mentioned above to restrict it only to shaders that can be compiled to SPIR-V using glslang and expand and re-use the SPIR-V debugging from Vulkan to provide the debug information.

Getting started would be to familiarise yourself with RenderDoc's codebase and how the Vulkan shader debugging works particularly with how it interfaces with the API and what things would need to be abstacted and re-implemented on GL. Again this would not be a small project and I would suggest attempting something smaller at first if you are a new contributor. If you do start working on this please stay in contact via email (easier than very noisy comments here) as suggested in the CONTRIBUTING documentation to ensure you don't do a huge amount of work only to find that it needs to be rewritten when it comes time to review.

bryanedds commented 2 months ago

Hello! I appreciate the in-depth response!

Yes, the first thing I'm wanting to attempt for this particular issue is to pursue the SPIR-V / glslang approach you mention. This should at least satisfy our team's own use case since we're going to change our engine in tandem to use glslang for our opengl shaders.

I've already started taking an overview of the existing code base.

I'll follow up with an e-mail as we determine how to proceed!

bryanedds commented 2 months ago

From our cursory scan, it's looking like this sort of endeavor is on the order of many 10klocs - even bigger than we had anticipated! While that was going on, we just found some rendering issues on Intel GPUs with OpenGL 3D renderer. Coupled with the issues we're currently having with AMD OpenGL, we're now looking at instead increasing the priority of our Vulkan renderer rewrites. If we go ahead and do that, we'll probably end up having to drop further effort into this here. Once we firm up things further, we'll provide another update.

UPDATE: Given the scope of the task, it's looking like we can't currently commit to this. Strong encouragement for anyone who can make the time, tho. Say what you want about OpenGL, but its much smaller and higher-level API still offers a significant value proposition for smaller / underfunded game devs.