Update Flutter 3.44.4#39
Conversation
Stop generating the GLES3 impeller shader variants in shaders.gni. Flutter 3.44 changed shell/platform/embedder/embedder_surface_gl_impeller.cc to include the impeller/entity/gles3/* headers and select GLES3 shaders at runtime via GetShaderMappings(is_gles3). With GLES3 generation disabled those headers/symbols do not exist, so adapt that consumer here: drop the gles3 includes and always use the GLES2 shader set (valid on GLES3 contexts too). This keeps the disable-gles3 patch self-consistent.
flutter-tizen/flutter-tizen#554 Added x64 artifacts for x64 emulator support (Currently, x64 Release mode is only supported on Linux hosts.)
flutter engine's window build uses Window SDKs 10.0.22621.0. window-2025 runner in gitHub actions no longer supports the 10.0.22621.0 SDK.
Add new struct FlutterVulkanTexture for embedder :
```
typedef struct {
/// Handle to the VkImage that is owned by the embedder. The engine will
/// bind this image for writing the frame.
FlutterVulkanImageHandle image;
/// The VkDeviceMemory that backs the iamge.
FlutterVulkanDeviceMemoryHandle image_memory;
/// The VkFormat of the image (for example: VK_FORMAT_R8G8B8A8_UNORM).
uint32_t format;
/// User data to be returned on the invocation of the destruction callback.
void* user_data;
/// Callback invoked (on an engine managed thread) that asks the embedder to
/// collect the texture.
VoidCallback destruction_callback;
/// Optional parameters for texture height/width, default is 0, non-zero means
/// the texture has the specified width/height.
/// Width of the texture.
size_t width;
/// Height of the texture.
size_t height;
} FlutterVulkanTexture;
```
The implement of [texture
source](https://github.com/flutter-tizen/flutter/pull/17/files#diff-7955a8522a753162869f2e8ca0017a83f4854b60800c844202e70c3aa00ff0c9R5-R204)
refer to the solution of android
platform(https://github.com/flutter-tizen/flutter/blob/flutter-3.35.3/engine/src/flutter/impeller/renderer/backend/vulkan/android/ahb_texture_source_vk.cc)
and I have submitted the code [Support render texture for
embedder](xiaowei-guan/embedder@6a94746),
I will create a new PR after[ support vulkan
backend](flutter-tizen/embedder#110) PR
released.
Replaced macos-13 with macos-15-intel actions/runner-images#13046
Because Tizen platform don't support hardware key, so we can't create a cache source to store the gpu resource. so we should reset the resouce before the frame end.
Inject a small compat header into the custom cross-toolchain command line so Linux targets built with Tizen sysroots still see __NR_getrandom even when the sysroot headers do not export it. This keeps third_party/dart untouched and fixes builds across common Tizen architectures: - x86: 355 - x64: 318 - arm: 384 - arm64: 278
Remove unnecessary CI
Adds artifact generation for x64 builds in a macOS environment. I tested the build on macOS 26.3 (Tahoe) and M4 Pro (Arm64) using the x64 lib
Store the embedder's destruction_callback / user_data and invoke it in the destructor to reclaim the VkImage; the Impeller path never released it. Reset the image view before the callback frees the image.
Reject a null embedder image handle in the texture source constructor and skip wrapping an invalid source into a TextureVK, returning nullptr instead of rendering with a half-initialized texture.
The flutter-tizen embedder passes target=GL_TEXTURE_EXTERNAL_OES, so set the descriptor type to kTextureExternalOES instead of the default 2D.
Download packages from download.tizen.org over HTTPS instead of plain HTTP, and run the patch command with an argument list and stdin redirection instead of shell=True string interpolation.
- Null-check the command buffer returned by CreateCommandBuffer() before dereferencing it in the Impeller path. It can be null when the context is being torn down. - Fall back to the engine-provided size when the embedder does not populate the texture width/height, matching the Skia path.
Fix flutter-tizen/embedder#157 Impeller eagerly sets up the entire set of pipeline state objects (PSOs) it may need during renderer setup. This works fine on mid to high-end devices as the setup completes well before the first frame is rendered. However on low-end devices, not all PSOs may be ready before the first frame is rendered. Low-end device usually don't have as much available concurrency and are slower to boot. On these devices, the rendering thread had to wait for the background compile job to be completed. It was also observed that the relatively higher priority render thread was waiting on a background thread to finish a PSO compile job. The PSO compile job could also be stuck behind another job that was not immediately needed. This made the situation on low end devices less than ideal. flutter#180022, this PR fix PSO stuck issue for Vulkan on low end devices. Current PR can fix the PSO stuck issue for GLES on low end devices. Related issue : flutter#176657 This PR can improve app startup time for impeller+GLES on low-end devices. flutter#180022 has provided solution for impeller + vulkan. Impeller+GLES has a special case: resource loading cannot be arbitrarily placed on other threads; it needs to be done on the I/O thread because this thread shares the context with the GPU thread. Therefore, this PR introduces the I/O task runner into PipelineCompileQueueGLES. However, since the I/O task runner may handle other tasks, we cannot put all jobs into the I/O thread at once. My current solution is to wait for the previous job to finish before putting the next one into the I/O thread. Main changes: Introduce fml::RefPtrfml::TaskRunner into PipelineCompileQueueGLES. Extract new class PipelineCompileQueueVulkan for vulkan, because the runners are on different threads. (cherry picked from commit 92a8430)
|
This is the same PR as #38. |
There was a problem hiding this comment.
Code Review
This pull request introduces Tizen cross-compilation support, sysroot generation scripts, and Vulkan external texture support in the embedder, alongside refactoring the pipeline compilation queues for GLES and Vulkan backends. Feedback on these changes includes addressing potential null pointer dereferences in the Vulkan external texture resolution and source initialization, safely escaping shell commands using shlex.quote in the sysroot generator script, and adding a timeout to urllib.request.urlopen to prevent hanging.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if (!!aiks_context) { | ||
| return ResolveTextureImpeller(texture_id, aiks_context, size); | ||
| } else { | ||
| return ResolveTextureSkia(texture_id, context, size); | ||
| } |
There was a problem hiding this comment.
In EmbedderExternalTextureGL::ResolveTexture, a check was added to ensure context is not null before calling ResolveTextureSkia. However, this check is missing in the Vulkan counterpart EmbedderExternalTextureVulkan::ResolveTexture. If both aiks_context and context are null, calling ResolveTextureSkia will result in a null pointer dereference and crash.
Please update the method to check context before resolving, matching the GL implementation.
if (!!aiks_context) {
return ResolveTextureImpeller(texture_id, aiks_context, size);
} else if (!!context) {
return ResolveTextureSkia(texture_id, context, size);
} else {
return nullptr;
}| if (!embedder_desc->image) { | ||
| VALIDATION_LOG << "Vulkan image handle is null"; | ||
| return; | ||
| } | ||
| const auto& context = impeller::ContextVK::Cast(*p_context); |
There was a problem hiding this comment.
If p_context is null, dereferencing it with *p_context on line 40 will cause a null pointer dereference and crash.
Please add a null check for p_context and return early if it is null, consistent with the check for embedder_desc->image.
if (!embedder_desc->image) {
VALIDATION_LOG << "Vulkan image handle is null";
return;
}
if (!p_context) {
VALIDATION_LOG << "Impeller context is null";
return;
}
const auto& context = impeller::ContextVK::Cast(*p_context);| import argparse | ||
| import os | ||
| import re | ||
| import shutil | ||
| import subprocess | ||
| import sys | ||
| import urllib.parse | ||
| import urllib.request | ||
| from pathlib import Path |
There was a problem hiding this comment.
Import the shlex module to safely escape shell commands when extracting RPM packages.
| import argparse | |
| import os | |
| import re | |
| import shutil | |
| import subprocess | |
| import sys | |
| import urllib.parse | |
| import urllib.request | |
| from pathlib import Path | |
| import argparse | |
| import os | |
| import re | |
| import shlex | |
| import shutil | |
| import subprocess | |
| import sys | |
| import urllib.parse | |
| import urllib.request | |
| from pathlib import Path |
| for rpm in [f for f in download_path.iterdir() if f.suffix == '.rpm']: | ||
| command = 'rpm2cpio {} | cpio -idum --quiet'.format(rpm) | ||
| subprocess.run(command, shell=True, cwd=sysroot, check=True) |
There was a problem hiding this comment.
The rpm path is interpolated directly into the shell command string. If the path contains spaces or shell metacharacters, this can lead to command execution failures or shell injection vulnerabilities.
Use shlex.quote to safely escape the path before formatting it into the command.
| for rpm in [f for f in download_path.iterdir() if f.suffix == '.rpm']: | |
| command = 'rpm2cpio {} | cpio -idum --quiet'.format(rpm) | |
| subprocess.run(command, shell=True, cwd=sysroot, check=True) | |
| for rpm in [f for f in download_path.iterdir() if f.suffix == '.rpm']: | |
| command = 'rpm2cpio {} | cpio -idum --quiet'.format(shlex.quote(str(rpm))) | |
| subprocess.run(command, shell=True, cwd=sysroot, check=True) |
| request = urllib.request.Request(url) | ||
| with urllib.request.urlopen(request) as response: |
There was a problem hiding this comment.
Calling urllib.request.urlopen without a timeout can cause the script to hang indefinitely if the network connection is slow or unresponsive.
Please specify a reasonable timeout (e.g., 60 seconds).
| request = urllib.request.Request(url) | |
| with urllib.request.urlopen(request) as response: | |
| request = urllib.request.Request(url) | |
| with urllib.request.urlopen(request, timeout=60) as response: |
flutter-tizen/flutter-tizen#783