Viewer: keyboard shortcut, write output for GLSL Vulkan Shader source
Addressing issue #2380 with the following implementations:
- Added a Vulkan shader generator context that follows the pattern of the GLSL shader generator context. This is used to write write out the Vulkan shader source to disk in SPIR-V.
- The Viewer uses a shader generator's unique target identifier to determine how it should write out a shader source to disk. We update
VkShaderGeneratorto have a uniquevulkantarget and added avulkan.mtlxtarget definition. - Added a keyboard shortcut (
V) to write out the GLSL Vulkan shader source and updated the help UI.
The following image shows the behavior exhibited in this PR:
Looking at Matrix: build failures, they seem to be related copying/moving being prohibited for the GenContext constructor:
GenContext() = delete;
Not sure if this is already expected behavior from the code (that may need to be fixed?) since the the GenContext consturctor similarly across the different shader generators. I imagine I should be using references or pointers to address the solution, but I may be missing something.
Looking at
Matrix: build failures, they seem to be related copying/moving being prohibited for theGenContextconstructor:GenContext() = delete;Not sure if this is already expected behavior from the code (that may need to be fixed?) since the the GenContext consturctor similarly across the different shader generators. I imagine I should be using references or pointers to address the solution, but I may be missing something.
The context is meant hold / reference per target (generator) specific data so per target you can reuse but not between different targets. GenOptions are the reusable part.
I will suggest any renaming of the target for Vulkan be put into a separate issue and change where we can perform suitable testing.
@juandejoya Just following up on this PR, to see if you might have the bandwidth to address the build issues!
@jstone-lucasfilm thanks for poking! I was going to reach out myself for how to proceed since it does require setting the target definition. I'll look into the build issues this week.