-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Auto return shader hooks #8384
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
base: dev-2.0
Are you sure you want to change the base?
Auto return shader hooks #8384
Conversation
|
🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors! Thank You! |
davepagurek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks for making these changes and also adding tests!
davepagurek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh actually it looks like the tests are failing:
FAIL |unit-tests| test/unit/visual/cases/webgl.js > WebGL > p5.strands > auto-return for shader hooks > auto-return works with getObjectInputs > matches expected screenshots
TypeError: Cannot read properties of undefined (reading 'position')
❯ p5.hookImplementation src/strands/strands_api.js:446:50
444| const expectedProp = expectedProperties[i];
445| const propName = expectedProp.name;
446| const receivedValue = effectiveReturn[propName];
| ^
447| if (receivedValue === undefined) {
448| FES.userError('type error', `You've returned an incomple…
❯ eval src/strands/strands_transpiler.js:1078:39
❯ src/strands/strands_transpiler.js:1087:20
❯ p5.Shader.modify src/strands/p5.strands.js:114:9
❯ test/unit/visual/cases/webgl.js:965:48
❯ test/unit/visual/visualTest.js:432:13
Possibly the isStructType check is failing? Maybe try adding some logging and then run npm run test test/unit/visual/cases/webgl.js to see what the types are?
|
Sure, I will look into it. |
Resolves #7994
Addresses #7992
Changes:
return inputswhen modifying struct properties in placePR Checklist
npm run lintpasses