Geometry shader debugger
2020-12-24 13:26:29
2020-12-24 13:26:29
This update has quite a few changes. You can now write and debug vertex, geometry, pixel and compute shaders. Besides expanding the debugger, I've also focused on improving the text editor and fixing some bugs.
Table of contents:
The biggest feature of this release is the geometry shader debugger. SHADERed now lets you step through your geometry shader and see it's output in the "Geometry shader output" window
Notice how in the GIF above SHADERed is aware of the geometry that is produced by the geometry shader and notice how the pixel's color is correctly calculated. This means that you can now debug your pixel shader even if your shader pass uses a geometry shader.
Besides viewing the geometry output as it's seen on the preview window, you can switch to "3D" view and freely rotate around your generated geometry. In the GIF below, the geometry shader turns a point into a cube.
SHADERed now supports four shader stages (vertex, geometry, pixel, compute) and all four are now debuggable, even the compute shaders!
Besides the geometry shader debugger, there is now also a new window that opens once the debugger starts. The window is called "Auto" and it displays relevant expressions and their values while user steps through the code:
While debugging a shader, SPIR-V disassembly instructions that correspond to the line on which the debugger is currently located will be highlighted:
In this release of SHADERed I decided to fix as many text editor bugs as I could. If you found it buggy previously I definitely recommend you to give it another try now. If you still find some bugs or think something should be changed, please open an issue or email me!
The text editor is now aware of the variable types (information pulled from the SPIR-V code). Which allows me to expand the autocomplete to also suggest structure members:
Besides knowing variable types, the text editor is now also aware of function's return type & its argument types. So now while you type the code, SHADERed will be able to display function declarations in a tooltip. This option is turned off by default. The tooltip is triggered by typing '(
' and ',
' characters:
Or you can hover over the function with your mouse cursor:
You can now also convert your shaders to GLSL through SHADERed's text editor:
All of the text editor features above work with any language that produces proper SPIR-V (even the ones added by a plugin).
Text editor has two new shortcuts: "Editor.CommentLines" and "Editor.UncommentLines". These two let you easily comment out part of your code:
Another new shortcut is "Editor.DuplicateLine" which lets you duplicate a line:
I've also added function declarations to text editor's tooltip when hovering over a built-in GLSL function:
I've added a new type of scrollbar markers. These show up when a line has been changed:
That's about it for the text editor. As I've said there are also lots of text editor bugfixes in this update. Check out the full changelog. Lots of features and text editor improvements are coming in the next release of SHADERed.
SHADERed Lite (web version of SHADERed) is still stuck on a modified version of SHADERed 1.3.6. Version 1.3.6 introduced immediate mode (and all the related features) which up until today wasn't available in SHADERed Lite. So with todays release, you can finally use immediate mode, add watches, set conditional breakpoints and hover over expressions while debugging to see their value - all in your browser. This is posible thanks to the SpvGenTwo library.
"Browse online" window now also displays Rust and C++ shaders hosted on shadered.org if you have those plugins (Rust and C++) installed:
I want SHADERed to be an all-in-one tool for shaders so with todays update you will be able to use SHADERed as a compiler and compile shaders from your terminal. Read more about these new command line arguments in the documentation.
It is currently only possible to compile built-in languages (HLSL and GLSL) but I do plan to expand this so that you can also compile shader languages which were added by some plugin. This way you'll be able to compile Rust, C++, HLSL, etc... shaders with a single application.
It will now be easier to create a shader pass which doesn't use GLSL thanks to the new "Language" dropdown:
Creating a new project from a template should now be quicker, as SHADERed won't ask you to pick a save location first. This way you can test your ideas faster. SHADERed saves the project in the temp
directory and only asks for the save location once the user hits CTRL+S
.
Input layout now has new types. These can be helpful when using a VertexBuffer pipeline item.
As mentioned, there are also bunch of other changes and fixes. Please check out the full changelog.
Unfortunately, my MegaGrant application for SHADERed has been rejected by Epic. I respect their decision and I am still very glad that they help developers with this program. This won't affect SHADERed's development too much, just a tiny bit - some features will be delayed (or maybe even cancelled, we'll see), most prominent ones being support for RTX shaders & official macOS release.
I'd like to thank everyone for using SHADERed and supporting the development, especially my patrons and sponsors. Anyway, see you next year with some new cool features!
Merry Christmas and Happy New Year!