Skip to content

armgit / gecko

Public Imported from GitHub
0

A GameCube/Wii emulator and debugger written in Rust.

defer EFB writeback + per-format pack cache, fix copy clear bug (FFCC NPC shadows render properly now)

Layle63e7bbe9b42d
diff --git a/crates/backend-wgpu/src/action.rs b/crates/backend-wgpu/src/action.rs
index e4b4b89..fb0f368 100644
--- a/crates/backend-wgpu/src/action.rs
+++ b/crates/backend-wgpu/src/action.rs
@@ -125,11 +125,10 @@ impl GxRenderer {
rows_per_image: None,
};
- let keep_cached = self.efb_copy_cache.get(&tid.ram_addr).is_some_and(|e| {
- e.format.base_texture_format() == *fmt
- && e.texture.size().width == *width
- && e.texture.size().height == *height
- });
+ let keep_cached = self
+ .efb_copy_cache
+ .get(&tid.ram_addr)
+ .is_some_and(|e| e.matches(*fmt, *width, *height));
if !keep_cached && let Some(entry) = self.efb_copy_cache.remove(&tid.ram_addr) {
self.return_to_pool(entry.texture, entry.view);
}
@@ -376,13 +375,9 @@ impl GxRenderer {
z_update,
alpha_supported,
depth_copy,
+ is_intensity,
} => {
self.flush_pending_draws(device, queue);
-
- // Readback + per-format encode is queued onto
- // `pending_writebacks` for the next frame-boundary drain.
- // The bind path samples `efb_copy_cache` (populated below)
- // for same-frame correctness.
self.execute_copy_efb_to_texture(
device,
queue,
@@ -395,18 +390,23 @@ impl GxRenderer {
*mipmap,
*stride,
*depth_copy,
- *clear,
- *clear_color,
- *clear_z,
- *color_update,
- *alpha_update,
- *z_update,
- *alpha_supported,
);
- if !*depth_copy && let Some(copy_fmt) = CopyFormat::from_u8_color(*raw_copy_format) {
+ if !*depth_copy
+ && !*mipmap
+ && let Some(copy_fmt) = CopyFormat::from_u8_color(*raw_copy_format)
+ {
self.cache_efb_copy_color(
- device, queue, *dest_addr, *src_x, *src_y, *src_w, *src_h, *mipmap, copy_fmt,
+ device,
+ queue,
+ *dest_addr,
+ *src_x,
+ *src_y,
+ *src_w,
+ *src_h,
+ *mipmap,
+ copy_fmt,
+ *is_intensity,
);
}
@@ -479,14 +479,15 @@ impl GxRenderer {
for slot in 0..8 {
if let Some(tid) = &bg_key.tex_keys[slot] {
- // EFB copies (keyed by bare ram_addr) win over the
- // RAM-decoded `texture_cache` (keyed by full TextureKey).
- let view = self
- .efb_copy_cache
- .get(&tid.ram_addr)
- .map(|e| &e.view)
- .or_else(|| self.texture_cache.get(tid).map(|(_, _, v)| v));
- if let Some(view) = view {
+ let tex_entry = self.texture_cache.get(tid);
+ let efb_match = tex_entry.and_then(|(tex_fmt, tex_tex, _)| {
+ let size = tex_tex.size();
+ self.efb_copy_cache
+ .get(&tid.ram_addr)
+ .filter(|e| e.matches(*tex_fmt, size.width, size.height))
+ .map(|e| &e.view)
+ });
+ if let Some(view) = efb_match.or_else(|| tex_entry.map(|(_, _, v)| v)) {
tex_views[slot] = view;
}
diff --git a/crates/backend-wgpu/src/lib.rs b/crates/backend-wgpu/src/lib.rs
index 2f579f9..5acff5e 100644
--- a/crates/backend-wgpu/src/lib.rs
+++ b/crates/backend-wgpu/src/lib.rs
@@ -109,6 +109,13 @@ pub(crate) struct EfbCopyEntry {
pub(crate) view: wgpu::TextureView,
}
+impl EfbCopyEntry {
+ pub(crate) fn matches(&self, fmt: TextureFormat, w: u32, h: u32) -> bool {
+ let size = self.texture.size();
+ self.format.base_texture_format() == fmt && size.width == w && size.height == h
+ }
+}
+
pub struct GxRenderer {
pub(crate) pipeline_cache: FxHashMap<FullPipelineKey, wgpu::RenderPipeline>,
pub(crate) shader_cache: FxHashMap<ShaderKey, wgpu::ShaderModule>,
@@ -145,6 +152,8 @@ pub struct GxRenderer {
pub(crate) efb_depth_resolve_uniform_buffer: wgpu::Buffer,
pub(crate) efb_depth_writeback_pipeline: wgpu::RenderPipeline,
+ /// Reusable Rgba8Unorm intermediate the Z24 pack writes into before
+ /// being copied to staging for the deferred RAM writeback.
pub(crate) efb_depth_writeback_target: Option<(wgpu::Texture, wgpu::TextureView)>,
pub(crate) fallback_view: wgpu::TextureView,
pub(crate) scratch_vertices: Vec<GpuVertex>,
@@ -602,12 +611,15 @@ impl GxRenderer {
|label: &str, entry: &str| make_pack_pipeline(label, entry, &xfb_copy_pipeline_layout, &efb_pack_shader);
let efb_pack_pipelines = render::EfbPackPipelines {
rgba8: color_pack("efb_pack_rgba8", "fs_rgba8"),
+ rgba8_intensity: color_pack("efb_pack_rgba8_intensity", "fs_rgba8_intensity"),
i8: color_pack("efb_pack_i8", "fs_i8"),
i4: color_pack("efb_pack_i4", "fs_i4"),
ia8: color_pack("efb_pack_ia8", "fs_ia8"),
ia4: color_pack("efb_pack_ia4", "fs_ia4"),
rgb565: color_pack("efb_pack_rgb565", "fs_rgb565"),
+ rgb565_intensity: color_pack("efb_pack_rgb565_intensity", "fs_rgb565_intensity"),
rgb5a3: color_pack("efb_pack_rgb5a3", "fs_rgb5a3"),
+ rgb5a3_intensity: color_pack("efb_pack_rgb5a3_intensity", "fs_rgb5a3_intensity"),
a8: color_pack("efb_pack_a8", "fs_a8"),
r8: color_pack("efb_pack_r8", "fs_r8"),
rg8: color_pack("efb_pack_rg8", "fs_rg8"),
@@ -618,7 +630,6 @@ impl GxRenderer {
&efb_depth_resolve_pipeline_layout,
&efb_depth_shader,
);
-
let efb_clear = clear::EfbClear::new(
device,
surface_format,
diff --git a/crates/backend-wgpu/src/render.rs b/crates/backend-wgpu/src/render.rs
index dc58c90..b94ebc8 100644
--- a/crates/backend-wgpu/src/render.rs
+++ b/crates/backend-wgpu/src/render.rs
@@ -14,31 +14,37 @@ pub(crate) struct XfbCopyUniforms {
pub(crate) struct EfbPackPipelines {
pub(crate) rgba8: wgpu::RenderPipeline,
+ pub(crate) rgba8_intensity: wgpu::RenderPipeline,
pub(crate) i8: wgpu::RenderPipeline,
pub(crate) i4: wgpu::RenderPipeline,
pub(crate) ia8: wgpu::RenderPipeline,
pub(crate) ia4: wgpu::RenderPipeline,
pub(crate) rgb565: wgpu::RenderPipeline,
+ pub(crate) rgb565_intensity: wgpu::RenderPipeline,
pub(crate) rgb5a3: wgpu::RenderPipeline,
+ pub(crate) rgb5a3_intensity: wgpu::RenderPipeline,
pub(crate) a8: wgpu::RenderPipeline,
pub(crate) r8: wgpu::RenderPipeline,
pub(crate) rg8: wgpu::RenderPipeline,
}
impl EfbPackPipelines {
- pub(crate) fn for_color(&self, fmt: CopyFormat) -> Option<&wgpu::RenderPipeline> {
- Some(match fmt {
- CopyFormat::RGBA8 => &self.rgba8,
- CopyFormat::I8 => &self.i8,
- CopyFormat::I4 => &self.i4,
- CopyFormat::IA8 => &self.ia8,
- CopyFormat::IA4 => &self.ia4,
- CopyFormat::RGB565 => &self.rgb565,
- CopyFormat::RGB5A3 => &self.rgb5a3,
- CopyFormat::A8 => &self.a8,
- CopyFormat::R8 => &self.r8,
- CopyFormat::RG8 => &self.rg8,
- CopyFormat::Z24X8 => return None,
+ pub(crate) fn for_color(&self, fmt: CopyFormat, intensity: bool) -> Option<&wgpu::RenderPipeline> {
+ Some(match (fmt, intensity) {
+ (CopyFormat::RGBA8, false) => &self.rgba8,
+ (CopyFormat::RGBA8, true) => &self.rgba8_intensity,
+ (CopyFormat::RGB565, false) => &self.rgb565,
+ (CopyFormat::RGB565, true) => &self.rgb565_intensity,
+ (CopyFormat::RGB5A3, false) => &self.rgb5a3,
+ (CopyFormat::RGB5A3, true) => &self.rgb5a3_intensity,
+ (CopyFormat::I8, _) => &self.i8,
+ (CopyFormat::I4, _) => &self.i4,
+ (CopyFormat::IA8, _) => &self.ia8,
+ (CopyFormat::IA4, _) => &self.ia4,
+ (CopyFormat::A8, _) => &self.a8,
+ (CopyFormat::R8, _) => &self.r8,
+ (CopyFormat::RG8, _) => &self.rg8,
+ (CopyFormat::Z24X8, _) => return None,
})
}
}
@@ -314,9 +320,10 @@ impl GxRenderer {
src_h: u32,
half: bool,
copy_format: CopyFormat,
+ is_intensity: bool,
) {
debug_assert!(
- self.efb_pack_pipelines.for_color(copy_format).is_some(),
+ self.efb_pack_pipelines.for_color(copy_format, is_intensity).is_some(),
"cache_efb_copy_color called with depth-only copy format {copy_format:?}",
);
@@ -361,7 +368,8 @@ impl GxRenderer {
format: wgpu::TextureFormat::Rgba8Unorm,
usage: wgpu::TextureUsages::TEXTURE_BINDING
| wgpu::TextureUsages::RENDER_ATTACHMENT
- | wgpu::TextureUsages::COPY_DST,
+ | wgpu::TextureUsages::COPY_DST
+ | wgpu::TextureUsages::COPY_SRC,
view_formats: &[],
});
let view = tex.create_view(&Default::default());
@@ -423,7 +431,7 @@ impl GxRenderer {
timestamp_writes: None,
multiview_mask: None,
});
- rpass.set_pipeline(self.efb_pack_pipelines.for_color(copy_format).unwrap());
+ rpass.set_pipeline(self.efb_pack_pipelines.for_color(copy_format, is_intensity).unwrap());
rpass.set_bind_group(0, &bind_group, &[]);
rpass.insert_debug_marker("EFB copy: per-format pack into cache");
rpass.draw(0..3, 0..1);
@@ -444,7 +452,6 @@ impl GxRenderer {
pub(crate) fn return_to_pool(&mut self, tex: wgpu::Texture, view: wgpu::TextureView) {
const PER_BUCKET_CAP: usize = 8;
-
let size = tex.size();
let bucket = self.efb_copy_pool.entry((size.width, size.height)).or_default();
if bucket.len() < PER_BUCKET_CAP {
@@ -584,13 +591,6 @@ impl GxRenderer {
mipmap: bool,
stride: u32,
depth_copy: bool,
- clear: bool,
- clear_color: [f32; 4],
- clear_z: f32,
- color_update: bool,
- alpha_update: bool,
- z_update: bool,
- alpha_supported: bool,
) {
// Clamp the source to EFB bounds (mirrors execute_copy_xfb).
let width = src_w.min(crate::EFB_WIDTH.saturating_sub(src_x));
@@ -606,8 +606,6 @@ impl GxRenderer {
return;
}
- // Early-out for formats we don't encode: skip the expensive readback
- // but still honor the clear.
let copy_format_option = if depth_copy {
texture::CopyFormat::from_u8_depth(copy_format)
} else {
@@ -618,21 +616,6 @@ impl GxRenderer {
copy_format = format!("{copy_format:#x}"),
"efb_to_texture: unsupported copy format, skipping readback"
);
- if clear {
- self.clear_efb_region(
- device,
- queue,
- src_x,
- src_y,
- src_w,
- src_h,
- clear_color,
- clear_z,
- color_update,
- alpha_update && alpha_supported,
- z_update,
- );
- }
return;
};
@@ -649,22 +632,6 @@ impl GxRenderer {
stride,
copy_format_enum,
);
-
- if clear {
- self.clear_efb_region(
- device,
- queue,
- src_x,
- src_y,
- src_w,
- src_h,
- clear_color,
- clear_z,
- color_update,
- alpha_update && alpha_supported,
- z_update,
- );
- }
return;
}
@@ -726,22 +693,6 @@ impl GxRenderer {
box_filter_downsample: mipmap,
label: "efb_to_texture",
});
-
- if clear {
- self.clear_efb_region(
- device,
- queue,
- src_x,
- src_y,
- src_w,
- src_h,
- clear_color,
- clear_z,
- color_update,
- alpha_update && alpha_supported,
- z_update,
- );
- }
}
fn execute_depth_writeback(
@@ -801,7 +752,7 @@ impl GxRenderer {
self.efb_depth_resolve_uniform_write_pending = true;
let bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
- label: Some("efb_depth_writeback_bg"),
+ label: Some("efb_depth_bg"),
layout: &self.efb_depth_resolve_bg_layout,
entries: &[
wgpu::BindGroupEntry {
@@ -815,25 +766,22 @@ impl GxRenderer {
],
});
- let group_label = format!(
- "DepthWriteback addr={dest_addr:#010x} src=({src_x},{src_y} {width}x{height}) dst={encode_w}x{encode_h} stride={stride}"
- );
-
let bytes_per_row = align_up(encode_w as u64 * 4, 256);
let staging_size = bytes_per_row * encode_h as u64;
let (staging, staging_capacity) = self.acquire_readback_staging(device, staging_size);
- let (target_tex, target_view) = self.efb_depth_writeback_target.as_ref().unwrap();
-
+ let (writeback_tex, writeback_view) = self.efb_depth_writeback_target.as_ref().unwrap();
let mut encoder = device.create_command_encoder(&wgpu::CommandEncoderDescriptor {
- label: Some("efb_depth_writeback_encoder"),
+ label: Some("efb_depth_encoder"),
});
- encoder.push_debug_group(&group_label);
+ encoder.push_debug_group(&format!(
+ "EfbDepth addr={dest_addr:#010x} src=({src_x},{src_y} {width}x{height}) dst={encode_w}x{encode_h}"
+ ));
{
let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
label: Some("efb_depth_writeback_pass"),
color_attachments: &[Some(wgpu::RenderPassColorAttachment {
- view: target_view,
+ view: writeback_view,
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::TRANSPARENT),
@@ -850,12 +798,11 @@ impl GxRenderer {
rpass.set_scissor_rect(0, 0, encode_w, encode_h);
rpass.set_pipeline(&self.efb_depth_writeback_pipeline);
rpass.set_bind_group(0, &bind_group, &[]);
- rpass.insert_debug_marker("EFB depth -> Z24 RGBA8 pack");
rpass.draw(0..3, 0..1);
}
encoder.copy_texture_to_buffer(
wgpu::TexelCopyTextureInfo {
- texture: target_tex,
+ texture: writeback_tex,
mip_level: 0,
origin: wgpu::Origin3d::ZERO,
aspect: wgpu::TextureAspect::default(),
@@ -877,7 +824,6 @@ impl GxRenderer {
encoder.pop_debug_group();
self.pending_command_buffers.push(encoder.finish());
self.efb_depth_resolve_uniform_write_pending = false;
- let _ = queue;
self.pending_writebacks.push(PendingWriteback {
dest_addr,
diff --git a/crates/backend-wgpu/src/shaders/efb_pack.wgsl b/crates/backend-wgpu/src/shaders/efb_pack.wgsl
index e70aea2..2c94739 100644
--- a/crates/backend-wgpu/src/shaders/efb_pack.wgsl
+++ b/crates/backend-wgpu/src/shaders/efb_pack.wgsl
@@ -28,108 +28,112 @@ fn fetch(pos: vec2<f32>) -> vec4<f32> {
return textureLoad(efb_color, coord, 0);
}
+fn luma_u8(s: vec4<f32>) -> u32 {
+ let r = u32(round(s.r * 255.0));
+ let g = u32(round(s.g * 255.0));
+ let b = u32(round(s.b * 255.0));
+ return min((299u * r + 587u * g + 114u * b) / 1000u, 255u);
+}
+
+fn expand3(v: u32) -> u32 { return (v << 5u) | (v << 2u) | (v >> 1u); }
+fn expand4(v: u32) -> u32 { return (v << 4u) | v; }
+fn expand5(v: u32) -> u32 { return (v << 3u) | (v >> 2u); }
+fn expand6(v: u32) -> u32 { return (v << 2u) | (v >> 4u); }
+
@fragment
fn fs_rgba8(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> {
return fetch(p.xy);
}
@fragment
-fn fs_i8(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> {
+fn fs_rgba8_intensity(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> {
let s = fetch(p.xy);
- let r = u32(round(s.r * 255.0));
- let g = u32(round(s.g * 255.0));
- let b = u32(round(s.b * 255.0));
- let y = (299u * r + 587u * g + 114u * b) / 1000u;
- let yf = f32(min(y, 255u)) / 255.0;
+ let yf = f32(luma_u8(s)) / 255.0;
+ return vec4<f32>(yf, yf, yf, s.a);
+}
+
+@fragment
+fn fs_i8(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> {
+ let yf = f32(luma_u8(fetch(p.xy))) / 255.0;
return vec4<f32>(yf, yf, yf, yf);
}
@fragment
fn fs_i4(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> {
- let s = fetch(p.xy);
- let r = u32(round(s.r * 255.0));
- let g = u32(round(s.g * 255.0));
- let b = u32(round(s.b * 255.0));
- let y = (299u * r + 587u * g + 114u * b) / 1000u;
- let q = (min(y, 255u) >> 4u) & 0xFu;
- let v = (q << 4u) | q;
- let vf = f32(v) / 255.0;
+ let q = (luma_u8(fetch(p.xy)) >> 4u) & 0xFu;
+ let vf = f32(expand4(q)) / 255.0;
return vec4<f32>(vf, vf, vf, vf);
}
@fragment
fn fs_ia8(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> {
let s = fetch(p.xy);
- let r = u32(round(s.r * 255.0));
- let g = u32(round(s.g * 255.0));
- let b = u32(round(s.b * 255.0));
- let y = (299u * r + 587u * g + 114u * b) / 1000u;
- let yf = f32(min(y, 255u)) / 255.0;
+ let yf = f32(luma_u8(s)) / 255.0;
return vec4<f32>(yf, yf, yf, s.a);
}
@fragment
fn fs_ia4(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> {
let s = fetch(p.xy);
- let r = u32(round(s.r * 255.0));
- let g = u32(round(s.g * 255.0));
- let b = u32(round(s.b * 255.0));
- let a = u32(round(s.a * 255.0));
- let y = (299u * r + 587u * g + 114u * b) / 1000u;
- let iq = (min(y, 255u) >> 4u) & 0xFu;
- let aq = (a >> 4u) & 0xFu;
- let iv = (iq << 4u) | iq;
- let av = (aq << 4u) | aq;
- let ivf = f32(iv) / 255.0;
- let avf = f32(av) / 255.0;
+ let iq = (luma_u8(s) >> 4u) & 0xFu;
+ let aq = (u32(round(s.a * 255.0)) >> 4u) & 0xFu;
+ let ivf = f32(expand4(iq)) / 255.0;
+ let avf = f32(expand4(aq)) / 255.0;
return vec4<f32>(ivf, ivf, ivf, avf);
}
+@fragment
+fn fs_rgb565_intensity(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> {
+ let y = luma_u8(fetch(p.xy));
+ let r5 = (y >> 3u) & 0x1Fu;
+ let g6 = (y >> 2u) & 0x3Fu;
+ let b5 = (y >> 3u) & 0x1Fu;
+ return vec4<f32>(f32(expand5(r5)) / 255.0, f32(expand6(g6)) / 255.0, f32(expand5(b5)) / 255.0, 1.0);
+}
+
@fragment
fn fs_rgb565(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> {
let s = fetch(p.xy);
-
let r5 = (u32(round(s.r * 255.0)) >> 3u) & 0x1Fu;
let g6 = (u32(round(s.g * 255.0)) >> 2u) & 0x3Fu;
let b5 = (u32(round(s.b * 255.0)) >> 3u) & 0x1Fu;
+ return vec4<f32>(f32(expand5(r5)) / 255.0, f32(expand6(g6)) / 255.0, f32(expand5(b5)) / 255.0, 1.0);
+}
- let r8 = (r5 << 3u) | (r5 >> 2u);
- let g8 = (g6 << 2u) | (g6 >> 4u);
- let b8 = (b5 << 3u) | (b5 >> 2u);
-
- return vec4<f32>(f32(r8) / 255.0, f32(g8) / 255.0, f32(b8) / 255.0, 1.0);
+@fragment
+fn fs_rgb5a3_intensity(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> {
+ let s = fetch(p.xy);
+ let y = luma_u8(s);
+ let a = u32(round(s.a * 255.0));
+
+ if (a == 255u) {
+ let vf = f32(expand5((y >> 3u) & 0x1Fu)) / 255.0;
+ return vec4<f32>(vf, vf, vf, 1.0);
+ } else {
+ let vf = f32(expand4((y >> 4u) & 0xFu)) / 255.0;
+ let af = f32(expand3((a >> 5u) & 0x7u)) / 255.0;
+ return vec4<f32>(vf, vf, vf, af);
+ }
}
@fragment
fn fs_rgb5a3(@builtin(position) p: vec4<f32>) -> @location(0) vec4<f32> {
let s = fetch(p.xy);
-
let r = u32(round(s.r * 255.0));
let g = u32(round(s.g * 255.0));
let b = u32(round(s.b * 255.0));
let a = u32(round(s.a * 255.0));
if (a == 255u) {
- let r5 = (r >> 3u) & 0x1Fu;
- let g5 = (g >> 3u) & 0x1Fu;
- let b5 = (b >> 3u) & 0x1Fu;
-
- let r8 = (r5 << 3u) | (r5 >> 2u);
- let g8 = (g5 << 3u) | (g5 >> 2u);
- let b8 = (b5 << 3u) | (b5 >> 2u);
-
+ let r8 = expand5((r >> 3u) & 0x1Fu);
+ let g8 = expand5((g >> 3u) & 0x1Fu);
+ let b8 = expand5((b >> 3u) & 0x1Fu);
return vec4<f32>(f32(r8) / 255.0, f32(g8) / 255.0, f32(b8) / 255.0, 1.0);
} else {
- let r4 = (r >> 4u) & 0xFu;
- let g4 = (g >> 4u) & 0xFu;
- let b4 = (b >> 4u) & 0xFu;
- let a3 = (a >> 5u) & 0x7u;
-
- let r8 = (r4 << 4u) | r4;
- let g8 = (g4 << 4u) | g4;
- let b8 = (b4 << 4u) | b4;
- let a8 = (a3 << 5u) | (a3 << 2u) | (a3 >> 1u);
-
+ let r8 = expand4((r >> 4u) & 0xFu);
+ let g8 = expand4((g >> 4u) & 0xFu);
+ let b8 = expand4((b >> 4u) & 0xFu);
+ let a8 = expand3((a >> 5u) & 0x7u);
return vec4<f32>(f32(r8) / 255.0, f32(g8) / 255.0, f32(b8) / 255.0, f32(a8) / 255.0);
}
}
diff --git a/crates/gecko/src/flipper/gx/bp.rs b/crates/gecko/src/flipper/gx/bp.rs
index e110698..ddc7503 100644
--- a/crates/gecko/src/flipper/gx/bp.rs
+++ b/crates/gecko/src/flipper/gx/bp.rs
@@ -511,6 +511,7 @@ impl GraphicsProcessor {
let alpha_update = self.cur_blend_mode.alpha_update();
let z_update = self.cur_zmode.update_enable();
+ let depth_copy = self.cur_pe_control.pixel_format().is_depth_only();
renderer.exec(GxAction::CopyEfbToTexture {
dest_addr,
src_x,
@@ -527,7 +528,8 @@ impl GraphicsProcessor {
alpha_update,
z_update,
alpha_supported: self.cur_pe_control.pixel_format().has_alpha(),
- depth_copy: self.cur_pe_control.pixel_format().is_depth_only(),
+ depth_copy,
+ is_intensity: cmd.intensity_fmt(),
});
// Drop cached hashes for this ram_addr (any TLUT variant) so the
diff --git a/crates/gecko/src/host.rs b/crates/gecko/src/host.rs
index ad8a7ac..56004fc 100644
--- a/crates/gecko/src/host.rs
+++ b/crates/gecko/src/host.rs
@@ -135,6 +135,7 @@ pub enum GxAction {
z_update: bool,
alpha_supported: bool,
depth_copy: bool,
+ is_intensity: bool,
},
}