Files
feresaria/vendor/smithay/patches/shm-texture-cache-format.patch
T
aria 993bc0f88f Integrate native Rime and stabilize input, output, and rendering
- Add optional modifier-only Super binding whose tap is cancelled by
  other input, focus changes, grabs, locks, and session teardown.
- Ship the native ferese-rime user service, Rime defaults, installer
  inventory, package dependencies, session environment, and docs.
- Vendor Smithay 8a27023 with the SHM texture-cache format fix and add
  GPU regressions for format changes and resize snapshots.
- Release reused CRTC owners before staging output modes, then restore
  changed outputs before former owners when a transaction fails.
- Wait for resize-capture GPU completion, expand filtered surface
  damage, and preserve IME popup origin under fractional scaling.
- Mark weekends like holidays in both calendar layouts.
2026-10-30 03:13:43 +09:00

47 lines
2.4 KiB
Diff

--- a/src/backend/renderer/gles/mod.rs
+++ b/src/backend/renderer/gles/mod.rs
@@ -883,6 +883,8 @@
// why not store a `GlesTexture`? because the user might do so.
// this is guaranteed a non-public internal type, so we are good.
type CacheMap = HashMap<ContextId<GlesTexture>, Arc<GlesTextureInternal>>;
+ static SHM_FORMAT_CHANGE_LOGS: std::sync::atomic::AtomicUsize =
+ std::sync::atomic::AtomicUsize::new(0);
let mut surface_lock = surface.as_ref().map(|surface_data| {
surface_data
@@ -937,7 +939,33 @@
surface_lock
.as_ref()
.and_then(|cache| cache.get(&id).cloned())
- .filter(|texture| texture.size == (width, height).into())
+ .filter(|texture| {
+ let format_matches =
+ texture.format == Some(internal_format) && texture.has_alpha == has_alpha;
+ if !format_matches
+ && tracing::enabled!(tracing::Level::DEBUG)
+ && SHM_FORMAT_CHANGE_LOGS
+ .fetch_update(
+ std::sync::atomic::Ordering::Relaxed,
+ std::sync::atomic::Ordering::Relaxed,
+ |count| (count < 16).then_some(count + 1),
+ )
+ .is_ok()
+ {
+ tracing::debug!(
+ old_width = texture.size.w,
+ old_height = texture.size.h,
+ new_width = width,
+ new_height = height,
+ old_internal_format = texture.format.unwrap_or(0),
+ new_internal_format = internal_format,
+ old_has_alpha = texture.has_alpha,
+ new_has_alpha = has_alpha,
+ "SHM texture cache format changed"
+ );
+ }
+ texture.size == (width, height).into() && format_matches
+ })
.unwrap_or_else(|| {
let mut tex = 0;
unsafe { self.gl.GenTextures(1, &mut tex) };