Skip to content

Commit

Permalink
change the position of `#define RN_MATERIAL_TYPE_NAME ${materialTypeN…
Browse files Browse the repository at this point in the history
…ame}\n`
  • Loading branch information
Yuki Shimada committed Dec 21, 2024
1 parent 330982a commit 5377f1f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/foundation/materials/core/ShaderHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ export function _createProgramAsSingleOperationWebGL(
const webglResourceRepository = CGAPIResourceRepository.getWebGLResourceRepository();
const materialNode = material._materialContent;

const materialTypeName = material.materialTypeName;
let definitions = `#define RN_MATERIAL_TYPE_NAME ${materialTypeName}\n`;
definitions += materialNode.getDefinitions();
let definitions = materialNode.getDefinitions();
const shaderDefines = material.getShaderDefines();
for (const shaderDefine of shaderDefines) {
definitions += `#define ${shaderDefine}\n`;
Expand Down Expand Up @@ -209,6 +207,7 @@ export function _setupGlobalShaderDefinitionWebGL(materialTypeName: string, prim
definitions += '#define RN_IS_UBO_ENABLED\n';
}
}
definitions += `#define RN_MATERIAL_TYPE_NAME ${materialTypeName}\n`;
if (ProcessApproach.isDataTextureApproach(SystemState.currentProcessApproach)) {
definitions += '#define RN_IS_DATATEXTURE_MODE\n';
} else {
Expand Down

0 comments on commit 5377f1f

Please sign in to comment.