Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions libraries/targets/genvulkan.mtlx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<materialx version="1.39">

<!--
Copyright Contributors to the MaterialX Project
SPDX-License-Identifier: Apache-2.0
-->

<!-- ======================================================================== -->
<!-- Target definition for Vulkan target. Derives from base GLSL target -->
<!-- ======================================================================== -->
<targetdef name="genvulkan" inherit="genglsl" />

</materialx>
2 changes: 1 addition & 1 deletion resources/Materials/TestSuite/_options.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<!-- Comma separated list of target" specifiers to indicate which
code generators to use. -->
<input name="targets" type="string" value="genglsl,genosl,genmdl,genessl,genmsl" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will actually do anything since "genvulkan" is not a known target for any generator.

Pinging @ashwinbhat on how I think Vulkan works currently.

  1. There is a VkShaderGenerator which has a "genglsl" target.
  2. It is not sufficient to generate proper code since you need to create a binding context for Vulkan. I'm not sure what happens if you don't do this ? This is shown in Python/Scripts/generateshader.py.

I think to have this target recognized, the VkShaderGenerator needs to change it's TARGET to genvulkan, and I'd also suggest that the context requirements be automatically added within the generator, then users of this generator do not need to add it in (for Python, C++ and WASM/JS).

BTW, I'm not even show how the genessl option causes anything different to occur since it also does not seem to be a recogized target -- but perhaps getting Vulkan correct first can be used as a template to have genessl recognized ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For changing the VkShaderGenerator target, I believe this was originally done in parallel with PR#2399 with the intention of switching the targets in that PR. But I can do that here.

Thanks for the feedback - I'll need to take a look at Python/Scripts/generateshader.py to get a better understanding of how the binding context should be implemented.

<input name="targets" type="string" value="genglsl,genosl,genmdl,genessl,genmsl,genvulkan" />

<!-- Check the count of number of implementations used for a given generator -->
<input name="checkImplCount" type="boolean" value="true" />
Expand Down