Developing GPU code is a pain sometimes when you are not sure what is going on in the back-end and can't always be sure the code you are optimising turns out better. To try and make this simpler I have created a small tool which will let you compare paths through a shader in assembly so you can see if it faster.
The download is here
Basic User Guide
- Paste the code into the left most text box.
- Specify the name of the entry function to use for the first generated shader in the small text box above the "Generate Assembly 0" button.
- Select the shader model and type to use from the first combo box below as well as optimisation level and up to seven other compile flags full description of the flags can be found here.
- Pressing "Generate Assembly 0" will generate the assembly for that function with those settings into the first assembly output.
- Any errors will be displayed in the light blue output box to the right of the compilation flag combo boxes.
- If you want to load a comparison assembly output into the second assembly output then you will have to specify an entry function name above the "Generate Assembly 1" button and set the flags how you want them for the second compilation and then press the "Generate Assembly 1" button.
It is worth noting that this program currently doesnt save the output from any of the compiles so if you want to keep the output you will have to copy it from the box and paste it out. When I get time I will update this to have the command line options in tabs so that they can be set for the left and right window seperately instead of before each compile. This would make fast changes and comparison a little easier and less prone to errors from accidentally compiling with the wrong optimisation flag.