Skip to content

Commit

Permalink
GLSLNodeBuilder: Fix usage of flat qualifier. (#30428)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Jan 31, 2025
1 parent df8b226 commit 8137a7e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -769,10 +769,20 @@ ${ flowData.code }
for ( const varying of varyings ) {

if ( shaderStage === 'compute' ) varying.needsInterpolation = true;

const type = this.getType( varying.type );
const flat = type.includes( 'int' ) || type.includes( 'uv' ) || type.includes( 'iv' ) ? 'flat ' : '';

snippet += `${flat}${varying.needsInterpolation ? 'out' : '/*out*/'} ${type} ${varying.name};\n`;
if ( varying.needsInterpolation ) {

const flat = type.includes( 'int' ) || type.includes( 'uv' ) || type.includes( 'iv' ) ? 'flat ' : '';

snippet += `${flat} out ${type} ${varying.name};\n`;

} else {

snippet += `${type} ${varying.name};\n`; // generate variable (no varying required)

}

}

Expand Down

0 comments on commit 8137a7e

Please sign in to comment.