Repository navigation
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work liste: 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.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
Steps to reproduce
#version 460 core
#include <flutter/runtime_effect.glsl>
precision lowp float;
layout(location = 0) out vec4 color;
layout(location = 0) uniform float a;
layout(location = 1) uniform float b;
uniform float c;
void main() {
}shader.getUniformFloat('a') // shader index 0
shader.getUniformFloat('b') // shader index 2, why?
shader.getUniformFloat('c') // shader index 1, why?Expected results
The correct index for each uniform is determined by the order of the uniforms as defined in the fragment program
shader.getUniformFloat('a') // shader index 0
shader.getUniformFloat('b') // shader index 1
shader.getUniformFloat('c') // shader index 2Actual results
shader.getUniformFloat('a') // shader index 0
shader.getUniformFloat('b') // shader index 2
shader.getUniformFloat('c') // shader index 1Code sample
fragmentProgram = await FragmentProgram.fromAsset('assets/shaders/display.frag');
shader = fragmentProgram.fragmentShader();
shader.getUniformFloat('a')
shader.getUniformFloat('b')
shader.getUniformFloat('c')Screenshots or Video
N/A
Logs
N/A
Flutter Doctor output
Doctor output
PS C:\Users\szmar\StudioProjects\ctt_second_take> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.47.7, on Microsoft Windows [Version 10.0.26300.9457], locale pl-PL)
[√] Windows Version (Windows 11 or higher, 26H2, 2009)
[!] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
X cmdline-tools component is missing.
Try installing or updating Android Studio.
Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment variable.
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/to/windows-android-setup for more details.
[√] Chrome - develop for the web
[!] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.11.1)
X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
MSVC v142 - VS 2019 C++ x64/x86 build tools
- If there are multiple build tool versions available, install the latest
C++ CMake tools for Windows
Windows 10 SDK
[√] Connected device (4 available)
[√] Network resources
! Doctor found issues in 2 categories.
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work liste: 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.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Activity
szmarczak commentedon Oct 18, 2026
Looks like KhronosGroup/glslang#1756 is why
mbcorona commentedon Oct 19, 2026
Hi @szmarczak , thanks for reporting.
Could you share a minimal sample that actually runs and prints the resolved index for each uniform? The glslang #1756 link is a good lead for the cause, but we need the real output to confirm the indices are off.
szmarczak commentedon Oct 19, 2026
repro.zip took me 4 minutes, don't know why you couldn't copy-paste on default Android Studio project yourself?
Set up a breakpoint on the line with
runApp, in the debugger you'll see that the indexes are indeed0 2 1.mbcorona commentedon Oct 20, 2026
Thanks for the repro, that confirms it. The indices resolve as 0, 2, 1 instead of declaration order. Routing to team-engine.
6 remaining items
mohamedalsamrai commentedon Oct 26, 2026
Thanks for triaging this. I'd like to send a PR. Which direction would you prefer?
setFloatdocs and is a contained change in impellerc.Locationtoo. This is a bigger change (glslang's location mapping, the Vulkan stage, and the docs).gaaclarke commentedon Oct 26, 2026
I got you, thanks for clarifying. Honestly, I'd prefer to deprecate
setFloat. I don't believe there is any reason it has to be used now.mohamedalsamrai commentedon Oct 26, 2026
Makes sense. The name-based API is implemented on web too (CanvasKit and skwasm), so deprecating
setFloatshouldn't leave any platform without an alternative.The framework still calls
setFloatinInkSparkleandStretchEffect, and the fragment shader docs use it in most examples, so I could start by moving those to the name-based API. Or are you planning to handle it yourself?gaaclarke commentedon Oct 26, 2026
If you want to move over the framework usage, that would be helpful. What docs are you thinking of? https://docs.flutter.dev/ui/design/graphics/fragment-shaders mentions both, we should probably remove all reference to
setFloat. You know what, I'll file a separate issue for this and those can be subissues.gaaclarke commentedon Oct 26, 2026
closed in lieu of #195357
mohamedalsamrai commentedon Oct 26, 2026
Yes, that's the page I meant. I'll start on the framework migration (
InkSparkleandStretchEffect) and link the PR to the sub-issue once it's filed.github-actions commentedon Nov 9, 2026
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 -vand a minimal reproduction of the issue.