forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Type description improvements (AcademySoftwareFoundation#2176)
This change list is an overhaul of the type system in shader generation. Improvements include: - Removing the singleton pattern for TypeDesc storage and access, making the type system thread safe. - Improved handling of TypeDesc internal data, supporting any amount of data for the future, while keeping the class size minimal. - Handling of re-registration of type descriptions. - Support for keeping type descriptions alive after the lifetime of ShaderGenerator and GenContext. For applications that holds/uses the ShadePort reflection data that is generated by shader generation, even after the ShaderGenerator itself is destroyed. (To do this an application can create and pass in an external TypeSystem). Co-work with @ld-kerley
- Loading branch information
1 parent
defc03b
commit 0b40d67
Showing
77 changed files
with
842 additions
and
577 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
resources/Materials/TestSuite/stdlib/structs/struct_texcoord.mtlx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0"?> | ||
<materialx version="1.39"> | ||
|
||
<typedef name="texcoord_struct"> | ||
<member name="ss" type="float" value="0.5"/> | ||
<member name="tt" type="float" value="0.5"/> | ||
</typedef> | ||
|
||
<nodedef name="ND_extract_s_texcoord" node="extract_s" nodegroup="shader" > | ||
<input name="in" type="texcoord_struct" value="{0.1;0.1}" /> | ||
<output name="out" type="float" value="0.0" /> | ||
</nodedef> | ||
|
||
<implementation name="IM_extract_s_texcoord_genglsl" nodedef="ND_extract_s_texcoord" target="genglsl" sourcecode="{{in}}.ss" /> | ||
<implementation name="IM_extract_s_texcoord_genmsl" nodedef="ND_extract_s_texcoord" target="genmsl" sourcecode="{{in}}.ss" /> | ||
<implementation name="IM_extract_s_texcoord_genosl" nodedef="ND_extract_s_texcoord" target="genosl" sourcecode="{{in}}.ss" /> | ||
<implementation name="IM_extract_s_texcoord_genmdl" nodedef="ND_extract_s_texcoord" target="genmdl" sourcecode="{{in}}.ss" /> | ||
|
||
<extract_s name="extract" type="float"> | ||
<input name="in" type="texcoord_struct" value="{0.01;0.5}"/> | ||
</extract_s> | ||
<surface_unlit name="unlit_surface1" type="surfaceshader"> | ||
<input name="emission" type="float" nodename="extract" /> | ||
<input name="opacity" type="float" value="1.0" /> | ||
</surface_unlit> | ||
<surfacematerial name="test_struct_texcoord" type="material"> | ||
<input name="surfaceshader" type="surfaceshader" nodename="unlit_surface1" /> | ||
</surfacematerial> | ||
|
||
</materialx> |
43 changes: 43 additions & 0 deletions
43
resources/Materials/TestSuite/stdlib/structs/struct_texcoordGroup.mtlx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0"?> | ||
<materialx version="1.38"> | ||
|
||
<typedef name="texcoord_struct"> | ||
<member name="ss" type="float" value="0.5"/> | ||
<member name="tt" type="float" value="0.5"/> | ||
</typedef> | ||
<typedef name="texcoordGroup_struct"> | ||
<member name="st_0" type="texcoord_struct" value="{0.1;0.1}"/> | ||
<member name="st_1" type="texcoord_struct" value="{0.5;0.5}"/> | ||
<member name="st_2" type="texcoord_struct" value="{0.9;0.9}"/> | ||
</typedef> | ||
|
||
<nodedef name="ND_extract_first_s_texcoordGroup" node="extract_first_s_group" nodegroup="shader" > | ||
<input name="in" type="texcoordGroup_struct" value="{{0.1;0.2};{0.3;0.4};{0.5;0.6}}"/> | ||
<output name="out" type="float" value="0.0" /> | ||
</nodedef> | ||
|
||
<implementation name="IM_extract_first_s_texcoordGroup_genglsl" nodedef="ND_extract_first_s_texcoordGroup" target="genglsl" sourcecode="{{in}}.st_0.ss"> | ||
<input name="in" type="texcoordGroup_struct" implname="data" /> | ||
</implementation> | ||
<implementation name="IM_extract_first_s_texcoordGroup_genmdl" nodedef="ND_extract_first_s_texcoordGroup" target="genmdl" sourcecode="{{in}}.st_0.ss"> | ||
<input name="in" type="texcoordGroup_struct" implname="data" /> | ||
</implementation> | ||
<implementation name="IM_extract_first_s_texcoordGroup_genmsl" nodedef="ND_extract_first_s_texcoordGroup" target="genmsl" sourcecode="{{in}}.st_0.ss"> | ||
<input name="in" type="texcoordGroup_struct" implname="data" /> | ||
</implementation> | ||
<implementation name="IM_extract_first_s_texcoordGroup_genosl" nodedef="ND_extract_first_s_texcoordGroup" target="genosl" sourcecode="{{in}}.st_0.ss"> | ||
<input name="in" type="texcoordGroup_struct" implname="data" /> | ||
</implementation> | ||
|
||
<extract_first_s_group name="extractfirstsgroup" type="float"> | ||
<input name="in" type="texcoordGroup_struct" value="{{0.1;0.2};{0.3;0.4};{0.5;0.6}}"/> | ||
</extract_first_s_group> | ||
<surface_unlit name="unlit_surface1" type="surfaceshader"> | ||
<input name="emission" type="float" nodename="extractfirstsgroup" /> | ||
<input name="opacity" type="float" value="1.0" /> | ||
</surface_unlit> | ||
<surfacematerial name="test_struct_texcoordGroup" type="material"> | ||
<input name="surfaceshader" type="surfaceshader" nodename="unlit_surface1" /> | ||
</surfacematerial> | ||
|
||
</materialx> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.