-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Closed
Copy link
Labels
e: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.
Description
Steps to reproduce
-
Have some dart code that sets the value of a uniform for a custom shader using
getUniformFloat -
Change the name of the uniform in both the dar code and the shader
-
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
Metadata
Metadata
Assignees
Labels
e: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.