Skip to content

Application crashed on hotreload when renaming uniforms and using getUniformFloat #180101

Closed

Description

@walley892

Steps to reproduce

  1. Have some dart code that sets the value of a uniform for a custom shader using getUniformFloat

  2. Change the name of the uniform in both the dar code and the shader

  3. Hot reload

Expected results

No change to the program at all.

Actual results

Program crashes :(

Code sample

Code sample
  void paint(Canvas canvas, Size size) {
    shader.setFloat(0, size.width);
    shader.setFloat(1, size.height);
    shader.getUniformFloat('uTime').set(time);

    final paint = Paint()..shader = shader;
    canvas.drawRect(Offset.zero & size, paint);
  }

With the shader:

uniform vec2 uSize;

uniform float uTime;

void main() {
  vec2 uv = FlutterFragCoord().xy / uSize;

  vec4 color1 = vec4(0.4, 0.0, 0.5, 1.0); 
  vec4 color2 = vec4(0.0, 0.4, 0.2, 1.0);

  fragColor = mix(color1, color2, abs(sin(uTime)));
}

Load up the program and everything looks fine.

Then rename the uniform in both dart and glsl:

  void paint(Canvas canvas, Size size) {
    shader.setFloat(0, size.width);
    shader.setFloat(1, size.height);
    shader.getUniformFloat('uTim').set(time);

    final paint = Paint()..shader = shader;
    canvas.drawRect(Offset.zero & size, paint);
  }

With the shader:

uniform vec2 uSize;

uniform float uTim;

void main() {
  vec2 uv = FlutterFragCoord().xy / uSize;

  vec4 color1 = vec4(0.4, 0.0, 0.5, 1.0); 
  vec4 color2 = vec4(0.0, 0.4, 0.2, 1.0);

  fragColor = mix(color1, color2, abs(sin(uTim)));
}

Screenshots or Video

Logs

Flutter Doctor output

N/A

Activity

  1. added
    engineflutter/engine related. See also e: labels.
    e: impellerImpeller rendering backend issues and features requests
    on Dec 18, 2025
  2. self-assigned this
    on Dec 18, 2025
  3. flutter-triage-bot commented on Dec 18, 2025

    @flutter-triage-bot

    The triaged-engine label is irrelevant if there is no team-engine label or fyi-engine label.

  4. github-actions commented on Jan 13, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

e: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions