Skip to content

Commit 71ae1fc

Browse files
Fix direct lighting in MslProgram::bindLighting (#2781)
This changelist fixes a uniform name mismatch in `MslProgram::bindLighting`, which was causing the direct lighting term to be missing on MacOS, as reported in #2769. In the MSL rendering path, uniforms are stored with a `GlobalContext` struct prefix, and the `hasUniform` and `bindUniform` methods correctly resolve these prefixed names through the global uniform name map.
1 parent c5166f6 commit 71ae1fc

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

source/MaterialXRenderMsl/MslPipelineStateObject.mm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,7 @@ int GetStrideOfMetalType(MTLDataType type)
687687

688688
// Set the number of active light sources
689689
size_t lightCount = lightHandler->getLightSources().size();
690-
auto numActiveLightSourcesInput = uniformList.find(HW::NUM_ACTIVE_LIGHT_SOURCES);
691-
if (numActiveLightSourcesInput == uniformList.end())
690+
if (!hasUniform(HW::NUM_ACTIVE_LIGHT_SOURCES))
692691
{
693692
// No lighting information so nothing further to do
694693
lightCount = 0;

0 commit comments

Comments
 (0)