-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Fix issue with getUniformFloat crashing with hot reload #180138
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
Conversation
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.
Code Review
This pull request addresses a crash during shader hot reloading when a uniform is renamed or removed. The fix involves adding a check to ensure a uniform exists before attempting to access its index. A new test case is also added to verify this fix and prevent future regressions. The changes look good and effectively solve the reported issue. I have one minor suggestion to make the code more idiomatic.
gaaclarke
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.
LGTM! thanks
|
autosubmit label was removed for flutter/flutter/180138, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR. |
|
autosubmit label was removed for flutter/flutter/180138, because - The status or check suite Windows tool_integration_tests_2_9 has failed. Please fix the issues identified (or deflake) before re-applying this label. |
Fixes #180101.
Our hot reloading behavior for shader uniforms only handled the case where uniforms were reordered. In the case that a uniform was renamed or deleted, and a user had acquired a handle to that uniform via
getUniformFloat, we would try (and fail) to locate that uniform in the shader, and the program would crash.This PR fixes that issue and adds a test to verify. Also manually verified on mac and android
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.