Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type description improvements #2176

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8f59b0e
Use single data block pointer to store TypeDesc large data
niklasharrysson Dec 18, 2024
65d5061
Refactor TypeDesc handling for struct types
niklasharrysson Dec 18, 2024
4fc277e
Fix python errors
niklasharrysson Dec 18, 2024
97b56a1
Fix GraphEditor build error
niklasharrysson Dec 18, 2024
f97390d
Fix Mac build error
niklasharrysson Dec 18, 2024
4fee5be
Fix test failure
niklasharrysson Dec 18, 2024
0cf5ab8
Fix more test failues
niklasharrysson Dec 18, 2024
1b6ffa0
Fix more test failures
niklasharrysson Dec 18, 2024
da3e39f
Fix python test errors
niklasharrysson Dec 18, 2024
48a8ea2
Fix more test failures.
niklasharrysson Dec 18, 2024
00ed265
Add TypeSystem class to hold and handle registered types.
niklasharrysson Jan 7, 2025
8855f4c
Code cleanup
niklasharrysson Jan 7, 2025
1335d86
Fix link error
niklasharrysson Jan 8, 2025
1c77a46
Add struct unit tests from Lee
niklasharrysson Jan 8, 2025
b0c5861
Fix python test failure
niklasharrysson Jan 8, 2025
d9e9df2
Fix python unit tests - v2
niklasharrysson Jan 8, 2025
adbe61b
Small cleanup
niklasharrysson Jan 8, 2025
608b6df
Handling of re-registration of types
niklasharrysson Jan 9, 2025
45b04fc
Merge remote-tracking branch 'aswf/main' into typedesc_updates
niklasharrysson Jan 9, 2025
b8450a6
Improve documentation
niklasharrysson Jan 9, 2025
6904889
Small documentation fix.
niklasharrysson Jan 9, 2025
6d730cb
Merge branch 'main' into typedesc_updates
jstone-lucasfilm Jan 22, 2025
69c75c7
Merge branch 'main' into typedesc_updates
jstone-lucasfilm Jan 23, 2025
4e91629
Minor spacing fix
jstone-lucasfilm Jan 23, 2025
3e77211
Streamline example
jstone-lucasfilm Jan 23, 2025
d73b1b5
Streamline example
jstone-lucasfilm Jan 23, 2025
6683180
Update to shader generator constructors
niklasharrysson Jan 25, 2025
fc28ec7
Fix python wrappers
niklasharrysson Jan 25, 2025
d70d7f4
Attempt to fix JS bindings
niklasharrysson Jan 25, 2025
4d3e63e
Update JS bindings to use shader generator create functiions
niklasharrysson Jan 26, 2025
bb5ba27
Attempt to fix JS bindings
niklasharrysson Jan 26, 2025
7eb06a5
More fixes to JS bindings
niklasharrysson Jan 26, 2025
b7110a3
More fixes to JS code
niklasharrysson Jan 26, 2025
f665c50
Simplify shader generator create functions
niklasharrysson Jan 27, 2025
8db9000
Attempt to fix the JS bindings
niklasharrysson Jan 27, 2025
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
Prev Previous commit
Next Next commit
Fix more test failues
niklasharrysson committed Dec 18, 2024
commit 0cf5ab805853df574b249a081fcc3839bd68e460
1 change: 1 addition & 0 deletions source/MaterialXTest/MaterialXGenGlsl/GenGlsl.cpp
Original file line number Diff line number Diff line change
@@ -105,6 +105,7 @@ TEST_CASE("GenShader: GLSL Light Shaders", "[genglsl]")

mx::GenContext context(mx::GlslShaderGenerator::create());
context.registerSourceCodeSearchPath(searchPath);
context.getShaderGenerator().registerTypeDefs(doc);

mx::HwShaderGenerator::bindLightShader(*pointLightShader, 42, context);
REQUIRE_THROWS(mx::HwShaderGenerator::bindLightShader(*spotLightShader, 42, context));
1 change: 1 addition & 0 deletions source/MaterialXTest/MaterialXGenMsl/GenMsl.cpp
Original file line number Diff line number Diff line change
@@ -107,6 +107,7 @@ TEST_CASE("GenShader: MSL Bind Light Shaders", "[genmsl]")

mx::GenContext context(mx::MslShaderGenerator::create());
context.registerSourceCodeSearchPath(searchPath);
context.getShaderGenerator().registerTypeDefs(doc);

mx::HwShaderGenerator::bindLightShader(*pointLightShader, 42, context);
REQUIRE_THROWS(mx::HwShaderGenerator::bindLightShader(*spotLightShader, 42, context));
2 changes: 2 additions & 0 deletions source/MaterialXTest/MaterialXGenOsl/GenOsl.cpp
Original file line number Diff line number Diff line change
@@ -165,6 +165,8 @@ TEST_CASE("GenShader: OSL Metadata", "[genosl]")
REQUIRE(stdSurf1 != nullptr);

mx::ShaderGeneratorPtr generator = mx::OslShaderGenerator::create();
generator->registerTypeDefs(doc);

mx::GenContext context(mx::OslShaderGenerator::create());
context.registerSourceCodeSearchPath(searchPath);

5 changes: 5 additions & 0 deletions source/MaterialXTest/MaterialXGenShader/GenShader.cpp
Original file line number Diff line number Diff line change
@@ -278,6 +278,8 @@ void checkPixelDependencies(mx::DocumentPtr libraries, mx::GenContext& context)
mx::readFromXmlFile(testDoc, testFile);
testDoc->setDataLibrary(libraries);

context.getShaderGenerator().registerTypeDefs(testDoc);

mx::ElementPtr element = testDoc->getChild(testElement);
CHECK(element);

@@ -397,6 +399,7 @@ TEST_CASE("GenShader: Track Application Variables", "[genshader]")
#ifdef MATERIALX_BUILD_GEN_GLSL
{
mx::GenContext context(mx::GlslShaderGenerator::create());
context.getShaderGenerator().registerTypeDefs(testDoc);
context.registerSourceCodeSearchPath(searchPath);
context.setApplicationVariableHandler(variableTracker);
mx::ShaderPtr shader = context.getShaderGenerator().generate(testElement, element, context);
@@ -405,6 +408,7 @@ TEST_CASE("GenShader: Track Application Variables", "[genshader]")
#ifdef MATERIALX_BUILD_GEN_OSL
{
mx::GenContext context(mx::OslShaderGenerator::create());
context.getShaderGenerator().registerTypeDefs(testDoc);
context.registerSourceCodeSearchPath(searchPath);
context.setApplicationVariableHandler(variableTracker);
mx::ShaderPtr shader = context.getShaderGenerator().generate(testElement, element, context);
@@ -413,6 +417,7 @@ TEST_CASE("GenShader: Track Application Variables", "[genshader]")
#ifdef MATERIALX_BUILD_GEN_MDL
{
mx::GenContext context(mx::MdlShaderGenerator::create());
context.getShaderGenerator().registerTypeDefs(testDoc);
context.registerSourceCodeSearchPath(searchPath);
context.setApplicationVariableHandler(variableTracker);
mx::ShaderPtr shader = context.getShaderGenerator().generate(testElement, element, context);
5 changes: 4 additions & 1 deletion source/MaterialXTest/MaterialXGenShader/GenShaderUtil.cpp
Original file line number Diff line number Diff line change
@@ -290,7 +290,8 @@ void testUniqueNames(mx::GenContext& context, const std::string& stage)

output1->setConnectedNode(node1);

const mx::ShaderGenerator& shadergen = context.getShaderGenerator();
mx::ShaderGenerator& shadergen = context.getShaderGenerator();
shadergen.registerTypeDefs(doc);

// Set the output to a restricted name
const std::string& outputQualifier = shadergen.getSyntax().getOutputQualifier();
@@ -378,6 +379,8 @@ void shaderGenPerformanceTest(mx::GenContext& context)

REQUIRE(docValid == true);

context.getShaderGenerator().registerTypeDefs(doc);

mx::StringVec sourceCode;
mx::ShaderPtr shader = nullptr;
shader = context.getShaderGenerator().generate(elements[0]->getName(), elements[0], context);
2 changes: 2 additions & 0 deletions source/MaterialXTest/MaterialXRenderOsl/GenReference.cpp
Original file line number Diff line number Diff line change
@@ -47,6 +47,8 @@ TEST_CASE("GenReference: OSL Reference", "[genreference]")

// Create shader generator.
mx::ShaderGeneratorPtr generator = mx::OslShaderGenerator::create();
generator->registerTypeDefs(stdlib);

mx::GenContext context(generator);
context.getOptions().addUpstreamDependencies = false;
context.registerSourceCodeSearchPath(searchPath);