Open bernardkwok opened 2 years ago
Has any work started on this?
Hi @fire We have introduced Vulkan GLSL shader generation in MaterialX with shader validation support https://github.com/AcademySoftwareFoundation/MaterialX/pull/1002
The next steps are to implements the MaterialXRender API using Vulkan, which we haven't gotten to yet. This work is also tracked on MaterialX main https://github.com/AcademySoftwareFoundation/MaterialX/issues/827
Add core support for Vulkan in MaterialX. Proposal Issue is here: https://github.com/materialx/MaterialX/issues/827
Main components:
New Vulkan code generator Vulkan uses GLSL that is similar to OpenGL GLSL but with a modifications. See KHR_vulkan_glsl extension for details. Items related to Vulkan code gen are listed below:
Minor differences in functions, main changes in input and resource binding.
Default uniforms not allowed e.g.,
uniform float base=1.0
is not allowedUse layout identifier e.g., layout (set=M, binding=N) uniform sampler2D variableName;
Use of sampler2D replaced by sampler and texture2D with separate binding points
Uniform Buffers to group uniforms by access and frequency of update
Advanced usage (for future exploration)
New sample Vulkan Rasterizerizer and build framework Vulkan shaders are compiled from GLSL to SPIRV using tooling that is part of Vulkan SDK. The CodeGen will not generate SPIRV. A new sample Vulkan Rasterizerizer will demonstrate use of GLSL - SPRIV in a runtime environment. The build framework updates will pull in the required Vulkan SDK. Vulkan SDK is not a requirement to use MaterialX Vulkan CodeGen.
Input uniforms will be grouped as:
Not yet in scope for Vulkan Rasterizerizer (needs further dicussion)
Usage of Rasterizer in MaterialXView MaterialXView will be updated to integrate this new Vulkan Rasterizerizer using build/runtime settings.
Validation of code generation Generated GLSL code will be validated to meet Vulkan GLSL specification by using validation tools published by Khronos
Validation of rendering Rendering validation will build upon existing tooling to render mltx documents and generate images.