I have a question regarding performance analysis of precompiled & optimized SPIR-V binaries using Mali Offline Compiler.
From the documentation, it seems that it should be possible to provide SPIR-V binary file format as input to malioc tool for performance analysis:
"The input file can be either:• A single ESSL source shader• A single SPIR-V binary module that has been compiled using Vulkan semantics"
I have tried the second option by using the following command line:
./malioc --spirv -y main --fragment optimized.spirv
but what happens is that glslValidator gets called by malioc, tries to compile the input as ESSL and displays the following error: "ERROR: Failed to compile ESSL to SPIR-V"
Is there a way to skip the compile step, and just do a performance analysis run on the provided SPIR-V file?
The tool assumes SPIR-V files have the ".spv" extension, which is the default for most of the SPIR-V tools. Anything else is assumed to be a source file that is handed over to glslangValdiator for compilation.
The "--spirv" option is really misnamed - it should really be "--vulkan" (it's been renamed in the next version).
Thank you, that makes things clear.
I would suggest adding that tidbit of info regarding the assumed extension to the documentation, since for folk with custom SPIR-V tooling, it might not be the default.
Hi Milan, Thanks for the feedback. We'll make sure the documentation gets updated. Note that for the next release we have a number of related changes which will help here.
* If you are using a default extension (e.g. myshader.vert.spv) for a binary module you'll now no longer need to specify shader type.
* If you want to use a non-standard extension for source you can manually define the type using e.g. --vertex.
* If you want to use a non-standard extension for a binary module you can manually define the type using e.g. --vertex --spirv.
Thanks, that sounds great! :)