Skip to content

Conversation

reshma045
Copy link

Resolves #7900

Changes:

  • GLSL genType Inference Fix:

    • Fixed an issue in ShaderGenerator.js where functions like sin() were incorrectly inferring genType as int when passed float literals (e.g., sin(0.5)).
    • Updated FunctionCallNode's determineFunctionSignature() to:
      • Coerce int to float when the expected argument type is genType.
      • Ensure only valid genTypes (float, vec2, vec3, vec4) are allowed.
      • Prevent invalid inference when only scalar literals are passed.
    • This resolves incorrect shader compilation and ensures that wrapper functions behave as expected.
  • Unit Test Fix:

    • Modified a test in test/unit/io/loadTable.js to normalize line endings when asserting CSV content:
      const value = table.getRow(3).get(0).replace(/\r\n|\r/g, '\n');
      This ensures that the test passes on both Windows and Unix-based systems by handling \r\n vs \n newline inconsistencies.

Screenshots of the change:

A purple box rendered using sin(0.5) in the fragment shader confirms correct float type inference.
image
image

PR Checklist

Copy link

welcome bot commented Jun 27, 2025

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

@lukeplowden lukeplowden self-requested a review July 21, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant