Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@walley892
Copy link
Contributor

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-assist bot 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.

@walley892 walley892 requested a review from gaaclarke December 19, 2025 19:49
@github-actions github-actions bot added the engine flutter/engine related. See also e: labels. label Dec 19, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks

@walley892 walley892 added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 29, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 29, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Dec 29, 2025

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.

@walley892 walley892 added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 29, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 29, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Dec 29, 2025

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.

@walley892 walley892 added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 30, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Dec 30, 2025
Merged via the queue into flutter:master with commit 560cb50 Dec 30, 2025
183 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Application crashed on hotreload when renaming uniforms and using getUniformFloat

2 participants