Skip to content

getUniformFloat(String name) fails on Vulkan #180595

@walley892

Description

@walley892

Steps to reproduce

  1. Write code using getUniformFloat
  2. Build for vulkan
  3. Boom

Expected results

Not boom

Actual results

Uniform with the given name not found.

Code sample

Code sample
shader.getUniformFloat("uTime").set(1.0);
// shaders/my_gradient.frag
#version 460 core
#include <flutter/runtime_effect.glsl>

uniform vec2 uSize; // The size of the area being drawn
uniform float uTime;

out vec4 fragColor;

uniform vec3 uColor;

void main() {
  // FlutterFragCoord() gives the pixel coordinate.
  // Divide by uSize to get normalized coordinates (uv) between 0.0 and 1.0.
  vec2 uv = FlutterFragCoord().xy / uSize;

  // Define two colors for the gradient.
  vec4 color1 = vec4(1.0, 0.0, 0.0, 1.0); // Dark Blue
  vec4 color2 = vec4(uColor, 1.0); // Orange/Red

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

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: tests"flutter test", flutter_test, or one of our testse: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.team-engineOwned by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions