From a23118376d5fde4d8da3d9a31ff2198d0f1a389c Mon Sep 17 00:00:00 2001 From: "Manley.B" Date: Sat, 28 Nov 2026 19:38:55 +1100 Subject: [PATCH 1/4] Texture read-back: the ocean's height map in SW_64KB_R_X is tiled for each console (port of DoubleGhosty/cool_fox d9f3ea6f8) The title's CPU code reads the ocean's 256x256 R32_FLOAT height map, which its wave passes write, and texback copies it into title memory in the console's layout. That texture is in SW_64KB_R_X, a pipe and bank XOR mode the tiler had no addressing for, so the copy back could not be tiled and the CPU read what was in that memory before. The logs of #788, #853 and #859 each have "a texture copied back could not be tiled e=Unsupported"; the warning does not say for which texture. victory-formats: Layout::configure_render_xor addresses that one layout (a 256x256 plane of 4-byte elements, one mip, a 64 KiB-aligned allocation) with addrlib's GFX10_SW_64K_R_X_1xaa_RBPLUS equations for the console's pipes and packers: Series S 8 and 4, Series X 32 and 8. victory-gpu: title_texture sets it for an R32_FLOAT texture at a 64 KiB-aligned address, by the console the title runs as. A texture whose layout still cannot be addressed is left alone before any copy is recorded, with one warning that names its size, format and swizzle. From DoubleGhosty/cool_fox d9f3ea6f8 ("Support the aligned water height texture readback for boat missions"). The test's digests come from XCL's independent GFX10 tiler. --- crates/victory-formats/src/texture.rs | 122 ++++++++++++++++++++++++-- crates/victory-gpu/src/resource.rs | 43 ++++++++- 2 files changed, 155 insertions(+), 10 deletions(-) diff --git a/crates/victory-formats/src/texture.rs b/crates/victory-formats/src/texture.rs index 61aca7547..426cef1a0 100644 --- a/crates/victory-formats/src/texture.rs +++ b/crates/victory-formats/src/texture.rs @@ -179,6 +179,49 @@ pub struct Layout { /// Byte offsets inside a block for each coordinate, per axis. /// Empty for linear and unsupported modes. pattern: &'static SwizzlePattern, + render_xor: Option, +} + +/// GFX10.3 pipe and packer rows used by the two Series consoles: Series S +/// has 8 pipes and 4 packers, Series X 32 and 8. XCL (`gpu/texture.rs`) +/// found every texel of every mode matches the console's own layout +/// library with these two. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum RenderPipeConfig { + Pipes8Packers4, + Pipes32Packers8, +} + +// AMD addrlib, gfx10SwizzlePattern.h, GFX10_SW_64K_R_X_1xaa_RBPLUS_PATINFO, +// 4 bytes/element. These are the contributions of X0..X7 and Y0..Y7 to +// the low 16 address bits. Z, sample, and coordinates above 255 are zero. +const fn render_axis(bits: [u16; 8]) -> [u16; 256] { + let mut offsets = [0; 256]; + let mut coord = 1usize; + while coord < 256 { + offsets[coord] = offsets[coord & (coord - 1)] ^ bits[coord.trailing_zeros() as usize]; + coord += 1; + } + offsets +} + +impl RenderPipeConfig { + fn offset(self, x: usize, y: usize) -> usize { + static S: [[u16; 256]; 2] = [ + render_axis([4, 8, 0x40, 0x800, 0x200, 0x2400, 0x4100, 0x8000]), + render_axis([0x10, 0x20, 0x80, 0x1000, 0x300, 0x400, 0x8100, 0x4000]), + ]; + static X: [[u16; 256]; 2] = [ + render_axis([4, 8, 0x40, 0x2000, 0x200, 0x800, 0x1400, 0x8100]), + render_axis([0x10, 0x20, 0x80, 0x4000, 0x300, 0x400, 0x8800, 0x100]), + ]; + let axes = match self { + Self::Pipes8Packers4 => &S, + Self::Pipes32Packers8 => &X, + }; + let block = (y / 128) * 2 + x / 128; + block * 65536 + usize::from(axes[0][x] ^ axes[1][y]) + } } type SwizzlePattern = [Vec; 3]; @@ -344,6 +387,7 @@ impl Layout { first_tail_mip: d.mips, mips, pattern: &EMPTY_PATTERN, + render_xor: None, } } @@ -526,18 +570,34 @@ impl Layout { first_tail_mip, mips, pattern, + render_xor: None, + } + } + + /// Enables addressing for a single 256×256 R32 plane in a block-aligned + /// allocation. The caller supplies the console's pipe configuration. + pub fn configure_render_xor(&mut self, config: RenderPipeConfig) { + let d = &self.desc; + if d.dimension == Dimension::Tex2d && d.swizzle == Swizzle::SW_64KB_R_X + && (d.width, d.height, d.depth, d.mips) == (256, 256, 1, 1) + && (d.element_bytes, d.block, d.samples) == (4, 1, 1) + && self.block == [128, 128, 1] && self.size == 256 * 256 * 4 + { + self.render_xor = Some(config); } } /// Whether [`Layout::offset`] and the copies work for this layout: - /// linear and the modes without pipe or bank XOR, single-sampled. + /// linear, the modes without pipe or bank XOR (single-sampled), and the + /// one XOR layout [`Layout::configure_render_xor`] takes. /// - /// shortcut: no addressing for the XOR modes (`_X`, `_T`) and MSAA; - /// they need the GPU's pipe and bank configuration (Series X and S - /// differ). Titles use them for render targets and depth, which the - /// host renders; add them when a title copies into or out of one. + /// shortcut: no addressing for the other XOR modes (`_X`, `_T`) and + /// MSAA; they need the GPU's pipe and bank configuration (Series X and + /// S differ). Titles use them for render targets and depth, which the + /// host renders; add them when a title copies into or out of one, as + /// the ocean's CPU code reads its height map. pub fn addressable(&self) -> bool { - self.desc.swizzle == Swizzle::LINEAR || !self.pattern[0].is_empty() + self.desc.swizzle == Swizzle::LINEAR || !self.pattern[0].is_empty() || self.render_xor.is_some() } /// The slice and the depth inside it for `z` (an array slice or a 3D @@ -567,6 +627,9 @@ impl Layout { Error::Invalid }); } + if let Some(config) = self.render_xor { + return Ok(config.offset(x as usize, y as usize) as u64); + } let (slice, z) = self.split(z); let base = u64::from(slice) * self.slice_size + m.offset; if self.desc.swizzle == Swizzle::LINEAR { @@ -710,6 +773,15 @@ impl Layout { if tiled_len < tiled_need as usize || linear_len < need || row_pitch < bytes { return Err(Error::TooSmall); } + if let Some(config) = self.render_xor { + for y in 0..256 { + // X0 and X1 select adjacent dwords in both equations. + for x in (0..256).step_by(4) { + copy_run::(src, dst, config.offset(x, y), y * row_pitch + 4 * x, 16); + } + } + return Ok(()); + } let linear = self.desc.swizzle == Swizzle::LINEAR; // The row and depth contribute one common base to every column, so // the same contiguous runs repeat on every row, including mip tails. @@ -937,6 +1009,44 @@ impl Texture { mod tests { use super::*; + #[test] + fn render_xor_water_matches_both_consoles_with_padded_rows() { + // Golden FNV-1a digests of every tiled byte from XCL 85e3826's + // independent GFX10 tiler. Each texel stores its own linear index. + let desc = Desc { dimension: Dimension::Tex2d, width: 256, height: 256, + depth: 1, mips: 1, element_bytes: 4, block: 1, samples: 1, + swizzle: Swizzle::SW_64KB_R_X }; + let pitch = 1040; + let mut linear = vec![0xfe; 255 * pitch + 1024]; + for y in 0..256usize { + for x in 0..256usize { + let at = y * pitch + 4 * x; + linear[at..at + 4].copy_from_slice(&((y * 256 + x) as u32).to_le_bytes()); + } + } + for (cfg, expected) in [(RenderPipeConfig::Pipes8Packers4, 0xc0e94c4e1b16af25), + (RenderPipeConfig::Pipes32Packers8, 0x49527ce701b6e325)] { + let mut layout = Layout::new(&desc).unwrap(); + assert!(!layout.addressable()); + layout.configure_render_xor(cfg); + let mut tiled = vec![0xbc; layout.size as usize]; + layout.tile(&mut tiled, 0, 0, &linear, pitch, 256 * pitch).unwrap(); + let digest = tiled.iter().fold(0xcbf29ce484222325u64, |h, &b| { + (h ^ u64::from(b)).wrapping_mul(0x100000001b3) + }); + assert_eq!(digest, expected); + for y in 0..256u32 { + for x in 0..256u32 { + let at = layout.offset(0, x, y, 0).unwrap() as usize; + assert_eq!(&tiled[at..at + 4], &(y * 256 + x).to_le_bytes()); + } + } + let mut round_trip = vec![0xfe; linear.len()]; + layout.detile(&tiled, 0, 0, &mut round_trip, pitch, 256 * pitch).unwrap(); + assert_eq!(round_trip, linear); + } + } + fn desc(w: u32, h: u32, mips: u32, bpe: u32, swizzle: Swizzle) -> Desc { Desc { dimension: Dimension::Tex2d, diff --git a/crates/victory-gpu/src/resource.rs b/crates/victory-gpu/src/resource.rs index 597ede594..306b8a9d7 100644 --- a/crates/victory-gpu/src/resource.rs +++ b/crates/victory-gpu/src/resource.rs @@ -3533,7 +3533,7 @@ pub(crate) fn texture_kind(this: This) -> Option<(u64, u32, u32)> { /// Texture `this`'s console layout (one plane), where it lies in title /// memory and the bytes that layout takes, for `crate::texback`; `None` for -/// a buffer or a texture with planes. +/// buffers, multi-plane textures, and layouts we cannot address. #[cfg(windows)] pub(crate) fn title_texture(this: This) -> Option<(victory_formats::texture::Layout, usize, usize)> { if this.is_null() { @@ -3544,10 +3544,27 @@ pub(crate) fn title_texture(this: This) -> Option<(victory_formats::texture::Lay return None; } let t = texture_layout(&r.desc)?; - let [plane] = &t.planes[..] else { + let [mut plane]: [_; 1] = t.planes.try_into().ok()?; + let at = r.data() as usize; + const R32_FLOAT: u32 = 41; + if r.desc.format == R32_FLOAT && at.is_multiple_of(65536) { + use victory_formats::texture::RenderPipeConfig; + let pipes = match crate::console::current() { + crate::console::Console::SeriesS => RenderPipeConfig::Pipes8Packers4, + crate::console::Console::SeriesX => RenderPipeConfig::Pipes32Packers8, + }; + plane.layout.configure_render_xor(pipes); + } + if !plane.layout.addressable() { + // Recording and waiting for a GPU copy cannot produce a CPU-visible + // plane if the console's address equation is unavailable. + static ONCE: std::sync::Once = std::sync::Once::new(); + ONCE.call_once(|| tracing::warn!(width = r.desc.width, height = r.desc.height, + format = r.desc.format, swizzle = plane.layout.desc.swizzle.0, + "a texture of a kind copied back (VICTORY_TEXTURE_BACK) is left alone: its console layout is not addressed here")); return None; - }; - Some((plane.layout.clone(), r.data() as usize, t.size as usize)) + } + Some((plane.layout, at, t.size as usize)) } /// The bytes of title memory a texture with the resource description @@ -3987,6 +4004,24 @@ mod tests { } } + #[test] + #[cfg(windows)] + fn water_readback_requires_an_addressable_console_plane() { + for (swizzle, bias, supported) in [(0x105, 0, true), (0x11b, 0, true), + (0x11b, 256, false), (0x119, 0, false)] { + let desc = ResourceDesc { layout: swizzle, flags: 4, ..texture(256, 256, 41, 1) }; + let bytes = footprint(&desc).unwrap().size as usize; + let memory = vec![0u8; bytes + 65536 + bias]; + let at = (memory.as_ptr() as usize).next_multiple_of(65536) + bias; + let mut r = std::ptr::null(); + assert_eq!(create_at_address(std::ptr::null(), at as u64, &desc, 0, + std::ptr::null(), &PAGEABLE_IIDS[0], &mut r), object::S_OK); + let destination = title_texture(r).map(|(_, base, extent)| (base, extent)); + assert_eq!(destination, supported.then_some((at, bytes))); + assert_eq!(resource_release(r), 0); + } + } + fn heap(size: u64) -> This { let desc = HeapDesc { size, From 7f6e2aa47e729b09664367b760b7cff95a843c71 Mon Sep 17 00:00:00 2001 From: "Manley.B" Date: Sat, 28 Nov 2026 20:07:14 +1100 Subject: [PATCH 2/4] Texture read-back: the layouts still not addressed are left to #881 #881 skips the copy back of a texture whose layout the tiler cannot address, at the list, with a test on WARP. This change also returned no target for such a texture: the same skip twice, and #881 came first. So title_texture only sets the XOR addressing now, and its test checks what it gives: the layout addressed or not, at the right place and size. --- crates/victory-gpu/src/resource.rs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/crates/victory-gpu/src/resource.rs b/crates/victory-gpu/src/resource.rs index 306b8a9d7..a0bb30f9c 100644 --- a/crates/victory-gpu/src/resource.rs +++ b/crates/victory-gpu/src/resource.rs @@ -3533,7 +3533,10 @@ pub(crate) fn texture_kind(this: This) -> Option<(u64, u32, u32)> { /// Texture `this`'s console layout (one plane), where it lies in title /// memory and the bytes that layout takes, for `crate::texback`; `None` for -/// buffers, multi-plane textures, and layouts we cannot address. +/// a buffer or a texture with planes. An `R32_FLOAT` texture at a 64 KiB +/// boundary in `SW_64KB_R_X` (the ocean's height map) is addressed with the +/// console's pipes and packers +/// ([`victory_formats::texture::Layout::configure_render_xor`]). #[cfg(windows)] pub(crate) fn title_texture(this: This) -> Option<(victory_formats::texture::Layout, usize, usize)> { if this.is_null() { @@ -3555,15 +3558,6 @@ pub(crate) fn title_texture(this: This) -> Option<(victory_formats::texture::Lay }; plane.layout.configure_render_xor(pipes); } - if !plane.layout.addressable() { - // Recording and waiting for a GPU copy cannot produce a CPU-visible - // plane if the console's address equation is unavailable. - static ONCE: std::sync::Once = std::sync::Once::new(); - ONCE.call_once(|| tracing::warn!(width = r.desc.width, height = r.desc.height, - format = r.desc.format, swizzle = plane.layout.desc.swizzle.0, - "a texture of a kind copied back (VICTORY_TEXTURE_BACK) is left alone: its console layout is not addressed here")); - return None; - } Some((plane.layout, at, t.size as usize)) } @@ -4006,8 +4000,10 @@ mod tests { #[test] #[cfg(windows)] - fn water_readback_requires_an_addressable_console_plane() { - for (swizzle, bias, supported) in [(0x105, 0, true), (0x11b, 0, true), + fn the_ocean_height_map_layout_is_addressed_at_a_64_kib_boundary() { + // SW_4KB_S always; SW_64KB_R_X only at a 64 KiB boundary; SW_64KB_S_X + // not (no XOR mode but that one has addresses yet). + for (swizzle, bias, addressable) in [(0x105, 0, true), (0x11b, 0, true), (0x11b, 256, false), (0x119, 0, false)] { let desc = ResourceDesc { layout: swizzle, flags: 4, ..texture(256, 256, 41, 1) }; let bytes = footprint(&desc).unwrap().size as usize; @@ -4016,8 +4012,8 @@ mod tests { let mut r = std::ptr::null(); assert_eq!(create_at_address(std::ptr::null(), at as u64, &desc, 0, std::ptr::null(), &PAGEABLE_IIDS[0], &mut r), object::S_OK); - let destination = title_texture(r).map(|(_, base, extent)| (base, extent)); - assert_eq!(destination, supported.then_some((at, bytes))); + let destination = title_texture(r).map(|(layout, base, extent)| (layout.addressable(), base, extent)); + assert_eq!(destination, Some((addressable, at, bytes)), "layout {swizzle:#x}, {bias} bytes off"); assert_eq!(resource_release(r), 0); } } From d80260750831da84e4951d4d055c36fade744b21 Mon Sep 17 00:00:00 2001 From: Davide Date: Sat, 28 Nov 2026 10:04:38 +0100 Subject: [PATCH 3/4] Texture layouts: every pipe and bank XOR mode is addressed, on both consoles Builds on the one SW_64KB_R_X layout the ocean's height map uses. The XOR modes (_X, _T) now have addresses for every element size, 2D, arrays and 3D, mips and mip tails, from addrlib's RB+ swizzle patterns for the console's pipes and packers (Series S 8 and 4, Series X 32 and 8): - XOR_PATTERNS holds the single-sample PATINFO rows of gfx10SwizzlePattern.h for those two configurations, expanded from the NIBBLE01..NIBBLE4 tables as GetSwizzlePatternFromPatternInfo does. - Layout::configure_xor(PipeConfig) picks the row as GetSwizzlePatternInfo does; offset and the copies follow ComputeSurfaceAddrFromCoordMacroTiled: block place, then the pattern on the whole coordinates and slice. - title_texture configures any texture at a block-aligned address, and the xg texture computer configures its layouts, by the console the title runs as (Console::pipes). --- crates/victory-formats/src/texture.rs | 509 ++++++++++++++++++++++---- crates/victory-gpu/src/console.rs | 9 + crates/victory-gpu/src/resource.rs | 27 +- crates/victory-hle/src/modules/xg.rs | 7 +- 4 files changed, 470 insertions(+), 82 deletions(-) diff --git a/crates/victory-formats/src/texture.rs b/crates/victory-formats/src/texture.rs index 426cef1a0..5dd2cada1 100644 --- a/crates/victory-formats/src/texture.rs +++ b/crates/victory-formats/src/texture.rs @@ -179,49 +179,265 @@ pub struct Layout { /// Byte offsets inside a block for each coordinate, per axis. /// Empty for linear and unsupported modes. pattern: &'static SwizzlePattern, - render_xor: Option, + /// The XOR mode's address bits, set by [`Layout::configure_xor`]. + xor: Option<&'static XorPattern>, } -/// GFX10.3 pipe and packer rows used by the two Series consoles: Series S -/// has 8 pipes and 4 packers, Series X 32 and 8. XCL (`gpu/texture.rs`) -/// found every texel of every mode matches the console's own layout -/// library with these two. +/// GFX10.3 pipe and packer configurations of the two Series consoles: +/// Series S has 8 pipes and 4 packers, Series X 32 and 8. The XOR modes +/// (`_X`, `_T`) spread a texture over the pipes, so their addresses differ +/// between the two. #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum RenderPipeConfig { +pub enum PipeConfig { Pipes8Packers4, Pipes32Packers8, } -// AMD addrlib, gfx10SwizzlePattern.h, GFX10_SW_64K_R_X_1xaa_RBPLUS_PATINFO, -// 4 bytes/element. These are the contributions of X0..X7 and Y0..Y7 to -// the low 16 address bits. Z, sample, and coordinates above 255 are zero. -const fn render_axis(bits: [u16; 8]) -> [u16; 256] { - let mut offsets = [0; 256]; - let mut coord = 1usize; - while coord < 256 { - offsets[coord] = offsets[coord & (coord - 1)] ^ bits[coord.trailing_zeros() as usize]; - coord += 1; - } - offsets +/// One address bit of an XOR mode: the x, y and z (array slice, or depth +/// for 3D) element coordinate bits whose XOR gives it. +type XorBit = [u16; 3]; +/// The low 16 address bits of a block (4 KiB modes use 12). +type XorPattern = [XorBit; 16]; + +/// The XOR mode patterns, by console, mode ([`xor_family`]) and log2 of the +/// element size: addrlib's RB+ single-sample `ADDR_SW_PATINFO` rows for +/// the console's pipes and packers, expanded from `GFX10_SW_PATTERN_NIBBLE01` +/// to `NIBBLE4` (`GetSwizzlePatternFromPatternInfo`), all from +/// `gfx10SwizzlePattern.h`. Each mode's table is named in its comment. +#[rustfmt::skip] +static XOR_PATTERNS: [[[XorPattern; 5]; 12]; 2] = [ + // Series S: addrlib's "8 pipes (4 PKRs)" rows. + [ + // 4KB_S_X (GFX10_SW_4K_S_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0000, 0x0008, 0x0000], [0x0040, 0x0010, 0x0000], [0x0010, 0x0040, 0x0002], [0x0020, 0x0020, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0008, 0x0000], [0x0010, 0x0020, 0x0002], [0x0020, 0x0010, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0020, 0x0008, 0x0000], [0x0008, 0x0020, 0x0002], [0x0010, 0x0010, 0x0001], [0x0010, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0020, 0x0004, 0x0000], [0x0008, 0x0010, 0x0002], [0x0010, 0x0008, 0x0001], [0x0010, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0010, 0x0004, 0x0000], [0x0004, 0x0010, 0x0002], [0x0008, 0x0008, 0x0001], [0x0008, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + ], + // 4KB_D_X (GFX10_SW_4K_D_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0040, 0x0010, 0x0000], [0x0010, 0x0040, 0x0002], [0x0020, 0x0020, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0008, 0x0000], [0x0010, 0x0020, 0x0002], [0x0020, 0x0010, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0020, 0x0008, 0x0000], [0x0008, 0x0020, 0x0002], [0x0010, 0x0010, 0x0001], [0x0010, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0020, 0x0004, 0x0000], [0x0008, 0x0010, 0x0002], [0x0010, 0x0008, 0x0001], [0x0010, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0010, 0x0004, 0x0000], [0x0004, 0x0010, 0x0002], [0x0008, 0x0008, 0x0001], [0x0008, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + ], + // 64KB_S_T (GFX10_SW_64K_S_T_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0000, 0x0008, 0x0000], [0x0040, 0x0010, 0x0000], [0x0010, 0x0040, 0x0000], [0x0020, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0080, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0008, 0x0000], [0x0010, 0x0020, 0x0000], [0x0020, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0020, 0x0008, 0x0000], [0x0008, 0x0020, 0x0000], [0x0010, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0020, 0x0004, 0x0000], [0x0008, 0x0010, 0x0000], [0x0010, 0x0008, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0010, 0x0004, 0x0000], [0x0004, 0x0010, 0x0000], [0x0008, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000]], + ], + // 64KB_D_T (GFX10_SW_64K_D_T_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0040, 0x0010, 0x0000], [0x0010, 0x0040, 0x0000], [0x0020, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0080, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0008, 0x0000], [0x0010, 0x0020, 0x0000], [0x0020, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0020, 0x0008, 0x0000], [0x0008, 0x0020, 0x0000], [0x0010, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0020, 0x0004, 0x0000], [0x0008, 0x0010, 0x0000], [0x0010, 0x0008, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0010, 0x0004, 0x0000], [0x0004, 0x0010, 0x0000], [0x0008, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000]], + ], + // 64KB_Z_X (GFX10_SW_64K_Z_X_1xaa_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0002], [0x0020, 0x0020, 0x0001], [0x0020, 0x0000, 0x0000], [0x0040, 0x0000, 0x0000], [0x0200, 0x0040, 0x0000], [0x0080, 0x0100, 0x0000], [0x0100, 0x0080, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0002], [0x0020, 0x0020, 0x0001], [0x0000, 0x0008, 0x0000], [0x0020, 0x0000, 0x0000], [0x0040, 0x0100, 0x0000], [0x0100, 0x0040, 0x0000], [0x0080, 0x0080, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0002], [0x0020, 0x0020, 0x0001], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0020, 0x0100, 0x0000], [0x0040, 0x0080, 0x0000], [0x0080, 0x0040, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0002], [0x0020, 0x0020, 0x0001], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0080, 0x0008, 0x0000], [0x0020, 0x0080, 0x0000], [0x0040, 0x0040, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0002], [0x0020, 0x0020, 0x0001], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0080, 0x0000], [0x0040, 0x0008, 0x0000], [0x0020, 0x0040, 0x0000]], + ], + // 64KB_S_X (GFX10_SW_64K_S_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0000, 0x0008, 0x0000], [0x0040, 0x0010, 0x0000], [0x0010, 0x0040, 0x0002], [0x0020, 0x0020, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0080, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0008, 0x0000], [0x0010, 0x0020, 0x0002], [0x0020, 0x0010, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0020, 0x0008, 0x0000], [0x0008, 0x0020, 0x0002], [0x0010, 0x0010, 0x0001], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0020, 0x0004, 0x0000], [0x0008, 0x0010, 0x0002], [0x0010, 0x0008, 0x0001], [0x0010, 0x0000, 0x0000], [0x0000, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0010, 0x0004, 0x0000], [0x0004, 0x0010, 0x0002], [0x0008, 0x0008, 0x0001], [0x0008, 0x0000, 0x0000], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000]], + ], + // 64KB_D_X (GFX10_SW_64K_D_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0040, 0x0010, 0x0000], [0x0010, 0x0040, 0x0002], [0x0020, 0x0020, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0080, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0008, 0x0000], [0x0010, 0x0020, 0x0002], [0x0020, 0x0010, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0020, 0x0008, 0x0000], [0x0008, 0x0020, 0x0002], [0x0010, 0x0010, 0x0001], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0020, 0x0004, 0x0000], [0x0008, 0x0010, 0x0002], [0x0010, 0x0008, 0x0001], [0x0010, 0x0000, 0x0000], [0x0000, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0010, 0x0004, 0x0000], [0x0004, 0x0010, 0x0002], [0x0008, 0x0008, 0x0001], [0x0008, 0x0000, 0x0000], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000]], + ], + // 64KB_R_X (GFX10_SW_64K_R_X_1xaa_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0000, 0x0008, 0x0000], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0002], [0x0020, 0x0020, 0x0001], [0x0020, 0x0000, 0x0000], [0x0040, 0x0000, 0x0000], [0x0200, 0x0040, 0x0000], [0x0080, 0x0100, 0x0000], [0x0100, 0x0080, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0002], [0x0020, 0x0020, 0x0001], [0x0000, 0x0008, 0x0000], [0x0020, 0x0000, 0x0000], [0x0040, 0x0100, 0x0000], [0x0100, 0x0040, 0x0000], [0x0080, 0x0080, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0002], [0x0020, 0x0020, 0x0001], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0020, 0x0100, 0x0000], [0x0040, 0x0080, 0x0000], [0x0080, 0x0040, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0002], [0x0020, 0x0020, 0x0001], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0080, 0x0008, 0x0000], [0x0020, 0x0080, 0x0000], [0x0040, 0x0040, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0002], [0x0020, 0x0020, 0x0001], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0080, 0x0000], [0x0040, 0x0008, 0x0000], [0x0020, 0x0040, 0x0000]], + ], + // 4KB_S3_X (GFX10_SW_4K_S3_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0020, 0x0004, 0x0020], [0x0008, 0x0010, 0x0010], [0x0010, 0x0008, 0x0008], [0x0000, 0x0008, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0010, 0x0004, 0x0020], [0x0004, 0x0010, 0x0010], [0x0008, 0x0008, 0x0008], [0x0000, 0x0008, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0010, 0x0004, 0x0010], [0x0004, 0x0010, 0x0008], [0x0008, 0x0008, 0x0004], [0x0000, 0x0008, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0010, 0x0002, 0x0010], [0x0004, 0x0008, 0x0008], [0x0008, 0x0004, 0x0004], [0x0000, 0x0004, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0008, 0x0002, 0x0010], [0x0002, 0x0008, 0x0008], [0x0004, 0x0004, 0x0004], [0x0000, 0x0004, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + ], + // 64KB_S3_T (GFX10_SW_64K_S3_T_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0020, 0x0004, 0x0000], [0x0008, 0x0010, 0x0010], [0x0010, 0x0008, 0x0008], [0x0000, 0x0008, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0000, 0x0010], [0x0000, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0010, 0x0004, 0x0000], [0x0004, 0x0010, 0x0010], [0x0008, 0x0008, 0x0008], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0000, 0x0010], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0010, 0x0004, 0x0000], [0x0004, 0x0010, 0x0008], [0x0008, 0x0008, 0x0004], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0000, 0x0008], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0010, 0x0002, 0x0000], [0x0004, 0x0008, 0x0008], [0x0008, 0x0004, 0x0004], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0000, 0x0008], [0x0000, 0x0008, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0008, 0x0002, 0x0000], [0x0002, 0x0008, 0x0008], [0x0004, 0x0004, 0x0004], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0008], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000]], + ], + // 64KB_S3_X (GFX10_SW_64K_S3_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0020, 0x0004, 0x0020], [0x0008, 0x0010, 0x0010], [0x0010, 0x0008, 0x0008], [0x0000, 0x0008, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0000, 0x0010], [0x0000, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0010, 0x0004, 0x0020], [0x0004, 0x0010, 0x0010], [0x0008, 0x0008, 0x0008], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0000, 0x0010], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0010, 0x0004, 0x0010], [0x0004, 0x0010, 0x0008], [0x0008, 0x0008, 0x0004], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0000, 0x0008], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0010, 0x0002, 0x0010], [0x0004, 0x0008, 0x0008], [0x0008, 0x0004, 0x0004], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0000, 0x0008], [0x0000, 0x0008, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0008, 0x0002, 0x0010], [0x0002, 0x0008, 0x0008], [0x0004, 0x0004, 0x0004], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0008], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000]], + ], + // 64KB_D3_X (GFX10_SW_64K_D3_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0000, 0x0002], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0000], [0x0020, 0x0020, 0x0000], [0x0000, 0x0004, 0x0000], [0x0000, 0x0008, 0x0000], [0x0000, 0x0000, 0x0008], [0x0008, 0x0000, 0x0000], [0x0000, 0x0000, 0x0010]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0000, 0x0000, 0x0004], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0000], [0x0020, 0x0024, 0x0000], [0x0000, 0x0000, 0x0008], [0x0000, 0x0008, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0010], [0x0008, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0002, 0x0000], [0x0000, 0x0000, 0x0002], [0x0040, 0x0050, 0x0000], [0x0010, 0x0010, 0x0000], [0x0020, 0x0024, 0x0000], [0x0000, 0x0000, 0x0004], [0x0000, 0x0008, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0008], [0x0008, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0001], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0040, 0x0050, 0x0008], [0x0010, 0x0010, 0x0000], [0x0020, 0x0022, 0x0000], [0x0000, 0x0000, 0x0004], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0040, 0x0050, 0x0008], [0x0010, 0x0012, 0x0000], [0x0022, 0x0020, 0x0000], [0x0000, 0x0000, 0x0004], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000]], + ], + ], + // Series X: addrlib's "32 pipes (8 PKRs)" rows. + [ + // 4KB_S_X (GFX10_SW_4K_S_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0000, 0x0008, 0x0000], [0x0080, 0x0010, 0x0000], [0x0010, 0x0080, 0x0000], [0x0040, 0x0020, 0x0004], [0x0020, 0x0040, 0x0002], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0080, 0x0008, 0x0000], [0x0010, 0x0040, 0x0000], [0x0040, 0x0010, 0x0004], [0x0020, 0x0020, 0x0002], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0040, 0x0008, 0x0000], [0x0008, 0x0040, 0x0000], [0x0020, 0x0010, 0x0004], [0x0010, 0x0020, 0x0002], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0040, 0x0004, 0x0000], [0x0008, 0x0020, 0x0000], [0x0020, 0x0008, 0x0004], [0x0010, 0x0010, 0x0002], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0020, 0x0004, 0x0000], [0x0004, 0x0020, 0x0000], [0x0010, 0x0008, 0x0004], [0x0008, 0x0010, 0x0002], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + ], + // 4KB_D_X (GFX10_SW_4K_D_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0080, 0x0010, 0x0000], [0x0010, 0x0080, 0x0000], [0x0040, 0x0020, 0x0004], [0x0020, 0x0040, 0x0002], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0080, 0x0008, 0x0000], [0x0010, 0x0040, 0x0000], [0x0040, 0x0010, 0x0004], [0x0020, 0x0020, 0x0002], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0040, 0x0008, 0x0000], [0x0008, 0x0040, 0x0000], [0x0020, 0x0010, 0x0004], [0x0010, 0x0020, 0x0002], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0040, 0x0004, 0x0000], [0x0008, 0x0020, 0x0000], [0x0020, 0x0008, 0x0004], [0x0010, 0x0010, 0x0002], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0020, 0x0004, 0x0000], [0x0004, 0x0020, 0x0000], [0x0010, 0x0008, 0x0004], [0x0008, 0x0010, 0x0002], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + ], + // 64KB_S_T (GFX10_SW_64K_S_T_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0000, 0x0008, 0x0000], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000], [0x0080, 0x0020, 0x0000], [0x0020, 0x0080, 0x0000], [0x0040, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0080, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0010, 0x0000, 0x0000], [0x0080, 0x0010, 0x0000], [0x0020, 0x0040, 0x0000], [0x0040, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0010, 0x0000], [0x0010, 0x0040, 0x0000], [0x0020, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0008, 0x0000], [0x0010, 0x0020, 0x0000], [0x0020, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0020, 0x0008, 0x0000], [0x0008, 0x0020, 0x0000], [0x0010, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000]], + ], + // 64KB_D_T (GFX10_SW_64K_D_T_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000], [0x0080, 0x0020, 0x0000], [0x0020, 0x0080, 0x0000], [0x0040, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0080, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0010, 0x0000, 0x0000], [0x0080, 0x0010, 0x0000], [0x0020, 0x0040, 0x0000], [0x0040, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0010, 0x0000], [0x0010, 0x0040, 0x0000], [0x0020, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0040, 0x0008, 0x0000], [0x0010, 0x0020, 0x0000], [0x0020, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0020, 0x0008, 0x0000], [0x0008, 0x0020, 0x0000], [0x0010, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000]], + ], + // 64KB_Z_X (GFX10_SW_64K_Z_X_1xaa_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0002], [0x0040, 0x0020, 0x0001], [0x0020, 0x0040, 0x0000], [0x0040, 0x0040, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0000, 0x0000], [0x0100, 0x0080, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0002], [0x0040, 0x0020, 0x0001], [0x0020, 0x0040, 0x0000], [0x0040, 0x0040, 0x0000], [0x0000, 0x0008, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0080, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0002], [0x0040, 0x0020, 0x0001], [0x0020, 0x0040, 0x0000], [0x0040, 0x0040, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0080, 0x0040, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0004], [0x0040, 0x0020, 0x0002], [0x0020, 0x0040, 0x0001], [0x0040, 0x0040, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0080, 0x0008, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0004], [0x0040, 0x0020, 0x0002], [0x0020, 0x0040, 0x0001], [0x0008, 0x0040, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0040, 0x0008, 0x0000]], + ], + // 64KB_S_X (GFX10_SW_64K_S_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0000, 0x0008, 0x0000], [0x0100, 0x0010, 0x0000], [0x0010, 0x0100, 0x0000], [0x0080, 0x0020, 0x0004], [0x0020, 0x0080, 0x0002], [0x0040, 0x0040, 0x0001], [0x0040, 0x0000, 0x0000], [0x0000, 0x0080, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0100, 0x0008, 0x0000], [0x0010, 0x0080, 0x0000], [0x0080, 0x0010, 0x0004], [0x0020, 0x0040, 0x0002], [0x0040, 0x0020, 0x0001], [0x0040, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0080, 0x0008, 0x0000], [0x0008, 0x0080, 0x0000], [0x0040, 0x0010, 0x0004], [0x0010, 0x0040, 0x0002], [0x0020, 0x0020, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0080, 0x0004, 0x0000], [0x0008, 0x0040, 0x0000], [0x0040, 0x0008, 0x0004], [0x0010, 0x0020, 0x0002], [0x0020, 0x0010, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0040, 0x0004, 0x0000], [0x0004, 0x0040, 0x0000], [0x0020, 0x0008, 0x0004], [0x0008, 0x0020, 0x0002], [0x0010, 0x0010, 0x0001], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000]], + ], + // 64KB_D_X (GFX10_SW_64K_D_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0100, 0x0010, 0x0000], [0x0010, 0x0100, 0x0000], [0x0080, 0x0020, 0x0004], [0x0020, 0x0080, 0x0002], [0x0040, 0x0040, 0x0001], [0x0040, 0x0000, 0x0000], [0x0000, 0x0080, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0100, 0x0008, 0x0000], [0x0010, 0x0080, 0x0000], [0x0080, 0x0010, 0x0004], [0x0020, 0x0040, 0x0002], [0x0040, 0x0020, 0x0001], [0x0040, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0080, 0x0008, 0x0000], [0x0008, 0x0080, 0x0000], [0x0040, 0x0010, 0x0004], [0x0010, 0x0040, 0x0002], [0x0020, 0x0020, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0040, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0080, 0x0004, 0x0000], [0x0008, 0x0040, 0x0000], [0x0040, 0x0008, 0x0004], [0x0010, 0x0020, 0x0002], [0x0020, 0x0010, 0x0001], [0x0020, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0040, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0040, 0x0004, 0x0000], [0x0004, 0x0040, 0x0000], [0x0020, 0x0008, 0x0004], [0x0008, 0x0020, 0x0002], [0x0010, 0x0010, 0x0001], [0x0010, 0x0000, 0x0000], [0x0000, 0x0020, 0x0000], [0x0020, 0x0000, 0x0000]], + ], + // 64KB_R_X (GFX10_SW_64K_R_X_1xaa_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0000, 0x0008, 0x0000], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0004], [0x0040, 0x0020, 0x0002], [0x0020, 0x0040, 0x0001], [0x0140, 0x0100, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0000, 0x0000], [0x0100, 0x0080, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0004], [0x0040, 0x0020, 0x0002], [0x0020, 0x0040, 0x0001], [0x0140, 0x0100, 0x0000], [0x0000, 0x0008, 0x0000], [0x0000, 0x0040, 0x0000], [0x0080, 0x0080, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0004], [0x0040, 0x0020, 0x0002], [0x0020, 0x0040, 0x0001], [0x0140, 0x0100, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0080, 0x0040, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0004], [0x0040, 0x0020, 0x0002], [0x0020, 0x0040, 0x0001], [0x0140, 0x0100, 0x0000], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0080, 0x0008, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0002, 0x0000], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0004], [0x0040, 0x0020, 0x0002], [0x0020, 0x0040, 0x0001], [0x0108, 0x0100, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0004, 0x0000], [0x0040, 0x0008, 0x0000]], + ], + // 4KB_S3_X (GFX10_SW_4K_S3_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0040, 0x0004, 0x0040], [0x0008, 0x0020, 0x0020], [0x0020, 0x0010, 0x0008], [0x0010, 0x0008, 0x0010], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0020, 0x0004, 0x0040], [0x0004, 0x0020, 0x0020], [0x0010, 0x0010, 0x0008], [0x0008, 0x0008, 0x0010], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0020, 0x0004, 0x0020], [0x0004, 0x0020, 0x0010], [0x0010, 0x0010, 0x0004], [0x0008, 0x0008, 0x0008], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0020, 0x0002, 0x0020], [0x0004, 0x0010, 0x0010], [0x0010, 0x0008, 0x0004], [0x0008, 0x0004, 0x0008], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0010, 0x0002, 0x0020], [0x0002, 0x0010, 0x0010], [0x0008, 0x0008, 0x0004], [0x0004, 0x0004, 0x0008], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000]], + ], + // 64KB_S3_T (GFX10_SW_64K_S3_T_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0000, 0x0004, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0000, 0x0008], [0x0020, 0x0008, 0x0000], [0x0010, 0x0010, 0x0010], [0x0000, 0x0000, 0x0010], [0x0000, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0008], [0x0010, 0x0008, 0x0000], [0x0008, 0x0010, 0x0010], [0x0000, 0x0000, 0x0010], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0004, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0010, 0x0008, 0x0000], [0x0008, 0x0010, 0x0008], [0x0000, 0x0000, 0x0008], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0010, 0x0004, 0x0000], [0x0008, 0x0008, 0x0008], [0x0000, 0x0000, 0x0008], [0x0000, 0x0008, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0008, 0x0004, 0x0000], [0x0004, 0x0008, 0x0008], [0x0000, 0x0000, 0x0008], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000]], + ], + // 64KB_S3_X (GFX10_SW_64K_S3_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0080, 0x0004, 0x0080], [0x0008, 0x0040, 0x0040], [0x0040, 0x0020, 0x0008], [0x0020, 0x0008, 0x0020], [0x0010, 0x0010, 0x0010], [0x0000, 0x0000, 0x0010], [0x0000, 0x0010, 0x0000], [0x0020, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0040, 0x0004, 0x0080], [0x0004, 0x0040, 0x0040], [0x0020, 0x0020, 0x0008], [0x0010, 0x0008, 0x0020], [0x0008, 0x0010, 0x0010], [0x0000, 0x0000, 0x0010], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0002, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0040, 0x0004, 0x0040], [0x0004, 0x0040, 0x0020], [0x0020, 0x0020, 0x0004], [0x0010, 0x0008, 0x0010], [0x0008, 0x0010, 0x0008], [0x0000, 0x0000, 0x0008], [0x0000, 0x0010, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0040, 0x0002, 0x0040], [0x0004, 0x0020, 0x0020], [0x0020, 0x0010, 0x0004], [0x0010, 0x0004, 0x0010], [0x0008, 0x0008, 0x0008], [0x0000, 0x0000, 0x0008], [0x0000, 0x0008, 0x0000], [0x0010, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0020, 0x0002, 0x0040], [0x0002, 0x0020, 0x0020], [0x0010, 0x0010, 0x0004], [0x0008, 0x0004, 0x0010], [0x0004, 0x0008, 0x0008], [0x0000, 0x0000, 0x0008], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000]], + ], + // 64KB_D3_X (GFX10_SW_64K_D3_X_RBPLUS_PATINFO) + [ + [[0x0001, 0x0000, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0002, 0x0000], [0x0000, 0x0000, 0x0002], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0004], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0000], [0x0040, 0x0024, 0x0000], [0x0020, 0x0040, 0x0000], [0x0080, 0x0000, 0x0008], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000], [0x0000, 0x0000, 0x0010]], + [[0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0000, 0x0002, 0x0000], [0x0000, 0x0000, 0x0004], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0000], [0x0040, 0x0024, 0x0000], [0x0020, 0x0048, 0x0000], [0x0080, 0x0000, 0x0008], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0010], [0x0008, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0002, 0x0000], [0x0000, 0x0000, 0x0002], [0x0080, 0x0090, 0x0000], [0x0010, 0x0010, 0x0000], [0x0040, 0x0024, 0x0000], [0x0020, 0x0048, 0x0000], [0x0080, 0x0000, 0x0004], [0x0004, 0x0000, 0x0000], [0x0000, 0x0000, 0x0008], [0x0008, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0001], [0x0002, 0x0000, 0x0000], [0x0000, 0x0000, 0x0002], [0x0080, 0x0090, 0x0008], [0x0010, 0x0010, 0x0000], [0x0040, 0x0022, 0x0000], [0x0020, 0x0044, 0x0000], [0x0080, 0x0000, 0x0004], [0x0004, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000]], + [[0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0000, 0x0000, 0x0000], [0x0001, 0x0000, 0x0000], [0x0000, 0x0000, 0x0001], [0x0000, 0x0001, 0x0000], [0x0000, 0x0000, 0x0002], [0x0080, 0x0090, 0x0008], [0x0010, 0x0012, 0x0000], [0x0042, 0x0020, 0x0000], [0x0020, 0x0044, 0x0000], [0x0080, 0x0000, 0x0004], [0x0004, 0x0000, 0x0000], [0x0000, 0x0008, 0x0000], [0x0008, 0x0000, 0x0000]], + ], + ], +]; + +/// The row of [`XOR_PATTERNS`] for an XOR mode, as addrlib's +/// `GetSwizzlePatternInfo` picks it: thick 3D layouts have their own +/// standard and display patterns; 3D `Z_X` and `R_X` use the 2D ones. +fn xor_family(swizzle: Swizzle, thick: bool) -> Option { + Some(match (swizzle.0, thick) { + (21, false) => 0, + (22, false) => 1, + (17, false) => 2, + (18, false) => 3, + (24, _) => 4, + (25, false) => 5, + (26, false) => 6, + (27, _) => 7, + (21, true) => 8, + (17, true) => 9, + (25, true) => 10, + (26, true) => 11, + _ => return None, + }) } -impl RenderPipeConfig { - fn offset(self, x: usize, y: usize) -> usize { - static S: [[u16; 256]; 2] = [ - render_axis([4, 8, 0x40, 0x800, 0x200, 0x2400, 0x4100, 0x8000]), - render_axis([0x10, 0x20, 0x80, 0x1000, 0x300, 0x400, 0x8100, 0x4000]), - ]; - static X: [[u16; 256]; 2] = [ - render_axis([4, 8, 0x40, 0x2000, 0x200, 0x800, 0x1400, 0x8100]), - render_axis([0x10, 0x20, 0x80, 0x4000, 0x300, 0x400, 0x8800, 0x100]), - ]; - let axes = match self { - Self::Pipes8Packers4 => &S, - Self::Pipes32Packers8 => &X, - }; - let block = (y / 128) * 2 + x / 128; - block * 65536 + usize::from(axes[0][x] ^ axes[1][y]) - } +/// `ComputeOffsetFromSwizzlePattern`: each address bit is the parity of +/// the coordinate bits its pattern entry names. +fn xor_offset(pattern: &XorPattern, bits: u32, x: u32, y: u32, z: u32) -> u64 { + pattern[..bits as usize] + .iter() + .enumerate() + .map(|(i, &[px, py, pz])| { + let parity = (x & u32::from(px)) ^ (y & u32::from(py)) ^ (z & u32::from(pz)); + u64::from(parity.count_ones() & 1) << i + }) + .sum() } type SwizzlePattern = [Vec; 3]; @@ -387,7 +603,7 @@ impl Layout { first_tail_mip: d.mips, mips, pattern: &EMPTY_PATTERN, - render_xor: None, + xor: None, } } @@ -570,34 +786,38 @@ impl Layout { first_tail_mip, mips, pattern, - render_xor: None, + xor: None, } } - /// Enables addressing for a single 256×256 R32 plane in a block-aligned - /// allocation. The caller supplies the console's pipe configuration. - pub fn configure_render_xor(&mut self, config: RenderPipeConfig) { + /// Enables addressing for an XOR mode (`_X`, `_T`) with the console's + /// pipe configuration. The addresses are those of a texture whose + /// title memory starts on a block boundary (no pipe and bank XOR from + /// the address). Other layouts are left as they are. + pub fn configure_xor(&mut self, config: PipeConfig) { let d = &self.desc; - if d.dimension == Dimension::Tex2d && d.swizzle == Swizzle::SW_64KB_R_X - && (d.width, d.height, d.depth, d.mips) == (256, 256, 1, 1) - && (d.element_bytes, d.block, d.samples) == (4, 1, 1) - && self.block == [128, 128, 1] && self.size == 256 * 256 * 4 - { - self.render_xor = Some(config); + if !d.swizzle.xor() || d.samples != 1 { + return; } + let Some(family) = xor_family(d.swizzle, self.thick) else { + return; + }; + let console = match config { + PipeConfig::Pipes8Packers4 => 0, + PipeConfig::Pipes32Packers8 => 1, + }; + let element_log2 = d.element_bytes.trailing_zeros() as usize; + self.xor = Some(&XOR_PATTERNS[console][family][element_log2]); } /// Whether [`Layout::offset`] and the copies work for this layout: - /// linear, the modes without pipe or bank XOR (single-sampled), and the - /// one XOR layout [`Layout::configure_render_xor`] takes. + /// linear, the modes without pipe or bank XOR, and the XOR modes once + /// [`Layout::configure_xor`] has named the console; single-sampled. /// - /// shortcut: no addressing for the other XOR modes (`_X`, `_T`) and - /// MSAA; they need the GPU's pipe and bank configuration (Series X and - /// S differ). Titles use them for render targets and depth, which the - /// host renders; add them when a title copies into or out of one, as - /// the ocean's CPU code reads its height map. + /// shortcut: no addressing for MSAA; titles use it for render targets + /// and depth, which the host renders. pub fn addressable(&self) -> bool { - self.desc.swizzle == Swizzle::LINEAR || !self.pattern[0].is_empty() || self.render_xor.is_some() + self.desc.swizzle == Swizzle::LINEAR || !self.pattern[0].is_empty() || self.xor.is_some() } /// The slice and the depth inside it for `z` (an array slice or a 3D @@ -627,8 +847,8 @@ impl Layout { Error::Invalid }); } - if let Some(config) = self.render_xor { - return Ok(config.offset(x as usize, y as usize) as u64); + if let Some(pattern) = self.xor { + return Ok(self.xor_address(pattern, m, x, y, z)); } let (slice, z) = self.split(z); let base = u64::from(slice) * self.slice_size + m.offset; @@ -639,6 +859,22 @@ impl Layout { Ok(base + self.row(m, y, z) + self.column(m, x)) } + /// `ComputeSurfaceAddrFromCoordMacroTiled` for an XOR mode: the block's + /// place, then the pattern applied to the whole coordinates (shifted + /// into the tail for a tail mip), whose bits above the block still + /// pick the pipe. + fn xor_address(&self, pattern: &XorPattern, m: &Mip, x: u32, y: u32, z: u32) -> u64 { + let [bw, bh, _] = self.block; + let log2 = self.alignment.trailing_zeros(); + let (x, y) = (x + m.tail.map_or(0, |t| t.x), y + m.tail.map_or(0, |t| t.y)); + let (slice, _) = self.split(z); + let blocks = u64::from(y / bh) * u64::from(m.pitch / bw) + u64::from(x / bw); + u64::from(slice) * self.slice_size + + m.offset + + (blocks << log2) + + xor_offset(pattern, log2, x, y, z) + } + /// The part of an address that depends on the row (and depth in a /// thick block). fn row(&self, m: &Mip, y: u32, z: u32) -> u64 { @@ -773,13 +1009,8 @@ impl Layout { if tiled_len < tiled_need as usize || linear_len < need || row_pitch < bytes { return Err(Error::TooSmall); } - if let Some(config) = self.render_xor { - for y in 0..256 { - // X0 and X1 select adjacent dwords in both equations. - for x in (0..256).step_by(4) { - copy_run::(src, dst, config.offset(x, y), y * row_pitch + 4 * x, 16); - } - } + if let Some(pattern) = self.xor { + self.walk_xor::(pattern, src, dst, m, first, row_pitch, depth_pitch); return Ok(()); } let linear = self.desc.swizzle == Swizzle::LINEAR; @@ -835,6 +1066,57 @@ impl Layout { } Ok(()) } + + /// [`Layout::walk`] for an XOR mode: runs of elements whose x bits land + /// on consecutive address bits, the rest one element at a time. + #[allow(clippy::too_many_arguments)] + fn walk_xor( + &self, + pattern: &XorPattern, + src: &[u8], + dst: &mut [u8], + m: &Mip, + first: u32, + row_pitch: usize, + depth_pitch: usize, + ) { + let n = self.desc.element_bytes as usize; + let element_log2 = n.trailing_zeros(); + let bits = self.alignment.trailing_zeros() as usize; + // x bit i is plain when it alone gives address bit element_log2 + i + // and appears in no other address bit. + let plain = |i: u32| { + let at = (element_log2 + i) as usize; + at < bits + && pattern[..bits].iter().enumerate().all(|(b, &[px, py, pz])| { + let mine = (px >> i) & 1 != 0; + if b == at { + mine && px == 1 << i && py == 0 && pz == 0 + } else { + !mine + } + }) + }; + let run = 1u32 << (0..16).take_while(|&i| plain(i)).count(); + let tail_x = m.tail.map_or(0, |t| t.x); + for z in 0..m.depth { + for y in 0..m.height { + let linear_row = z as usize * depth_pitch + y as usize * row_pitch; + let mut x = 0; + while x < m.width { + let len = if (x + tail_x).is_multiple_of(run) && x + run <= m.width { + run + } else { + 1 + }; + let tiled = self.xor_address(pattern, m, x, y, first + z) as usize; + let at = linear_row + x as usize * n; + copy_run::(src, dst, tiled, at, len as usize * n); + x += len; + } + } + } + } } fn copy_run( @@ -1009,6 +1291,103 @@ impl Texture { mod tests { use super::*; + /// Every XOR mode, on both consoles: elements tiled by `tile` sit where + /// `offset` says, and `detile` gives the rows back, for arrays, thick + /// and thin 3D textures, mip tails, and 2- to 16-byte elements. + #[test] + fn xor_modes_tile_where_offset_points() { + let cases = [ + (Dimension::Tex2d, 300u32, 200u32, 3u32, 0u32, 4u32, Swizzle::SW_64KB_R_X), + (Dimension::Tex2d, 70, 50, 2, 0, 16, Swizzle::SW_4KB_D_X), + (Dimension::Tex2d, 129, 65, 1, 0, 2, Swizzle::SW_64KB_Z_X), + (Dimension::Tex2d, 40, 300, 5, 3, 8, Swizzle::SW_64KB_S_X), + (Dimension::Tex2d, 96, 96, 1, 0, 1, Swizzle::SW_64KB_D_X), + (Dimension::Tex2d, 64, 64, 2, 0, 4, Swizzle::SW_64KB_S_T), + (Dimension::Tex2d, 64, 64, 1, 0, 4, Swizzle::SW_64KB_D_T), + (Dimension::Tex2d, 33, 17, 4, 0, 4, Swizzle::SW_4KB_S_X), + (Dimension::Tex3d, 64, 32, 16, 0, 8, Swizzle::SW_64KB_S_X), + (Dimension::Tex3d, 20, 20, 20, 0, 4, Swizzle::SW_4KB_S_X), + (Dimension::Tex3d, 32, 32, 8, 0, 4, Swizzle::SW_64KB_D_X), + (Dimension::Tex3d, 50, 30, 6, 1, 4, Swizzle::SW_64KB_R_X), + ]; + for config in [PipeConfig::Pipes8Packers4, PipeConfig::Pipes32Packers8] { + for (dimension, width, height, depth, mips, bytes, swizzle) in cases { + let mips = match mips { + 0 => { + let deep = if dimension == Dimension::Tex3d { depth } else { 1 }; + 32 - width.max(height).max(deep).leading_zeros() + } + n => n, + }; + let desc = Desc { + dimension, + width, + height, + depth, + mips, + element_bytes: bytes, + block: 1, + samples: 1, + swizzle, + }; + let mut layout = Layout::new(&desc).unwrap(); + assert!(!layout.addressable()); + layout.configure_xor(config); + assert!(layout.addressable(), "{desc:?}"); + let n = bytes as usize; + let mut tiled = vec![0u8; layout.size as usize]; + let slices = if dimension == Dimension::Tex3d { 1 } else { depth }; + let value = |mip: u32, x: u32, y: u32, z: u32| { + let i = u64::from(mip) << 48 + | u64::from(z) << 32 + | u64::from(y) << 16 + | u64::from(x); + let mut v = [0u8; 16]; + v[..8].copy_from_slice(&i.wrapping_mul(0x9e37_79b9_7f4a_7c15).to_le_bytes()); + v[8..].copy_from_slice(&(!i).wrapping_mul(0xc2b2_ae3d_27d4_eb4f).to_le_bytes()); + v + }; + for mip in 0..mips { + let m = layout.mips[mip as usize]; + let (row, rows) = (m.width as usize * n, m.height as usize); + for slice in 0..slices { + let mut linear = vec![0u8; row * rows * m.depth as usize]; + for z in 0..m.depth { + for y in 0..m.height { + for x in 0..m.width { + let at = + (z as usize * rows + y as usize) * row + x as usize * n; + let v = value(mip, x, y, slice + z); + linear[at..at + n].copy_from_slice(&v[..n]); + } + } + } + layout.tile(&mut tiled, mip, slice, &linear, row, row * rows).unwrap(); + let mut back = vec![0u8; linear.len()]; + layout.detile(&tiled, mip, slice, &mut back, row, row * rows).unwrap(); + assert_eq!(back, linear, "{desc:?} mip {mip} slice {slice}"); + } + } + for mip in 0..mips { + let m = &layout.mips[mip as usize]; + let zs = if dimension == Dimension::Tex3d { m.depth } else { depth }; + for z in 0..zs { + for y in 0..m.height { + for x in 0..m.width { + let at = layout.offset(mip, x, y, z).unwrap() as usize; + assert_eq!( + tiled[at..at + n], + value(mip, x, y, z)[..n], + "{config:?} {desc:?} mip {mip} ({x}, {y}, {z})" + ); + } + } + } + } + } + } + } + #[test] fn render_xor_water_matches_both_consoles_with_padded_rows() { // Golden FNV-1a digests of every tiled byte from XCL 85e3826's @@ -1024,11 +1403,11 @@ mod tests { linear[at..at + 4].copy_from_slice(&((y * 256 + x) as u32).to_le_bytes()); } } - for (cfg, expected) in [(RenderPipeConfig::Pipes8Packers4, 0xc0e94c4e1b16af25), - (RenderPipeConfig::Pipes32Packers8, 0x49527ce701b6e325)] { + for (cfg, expected) in [(PipeConfig::Pipes8Packers4, 0xc0e94c4e1b16af25), + (PipeConfig::Pipes32Packers8, 0x49527ce701b6e325)] { let mut layout = Layout::new(&desc).unwrap(); assert!(!layout.addressable()); - layout.configure_render_xor(cfg); + layout.configure_xor(cfg); let mut tiled = vec![0xbc; layout.size as usize]; layout.tile(&mut tiled, 0, 0, &linear, pitch, 256 * pitch).unwrap(); let digest = tiled.iter().fold(0xcbf29ce484222325u64, |h, &b| { diff --git a/crates/victory-gpu/src/console.rs b/crates/victory-gpu/src/console.rs index ab7252c57..c7053d262 100644 --- a/crates/victory-gpu/src/console.rs +++ b/crates/victory-gpu/src/console.rs @@ -13,6 +13,15 @@ pub enum Console { } impl Console { + /// The GPU's pipes and packers, which the addresses of the XOR swizzle + /// modes depend on. + pub fn pipes(self) -> victory_formats::texture::PipeConfig { + match self { + Console::SeriesX => victory_formats::texture::PipeConfig::Pipes32Packers8, + Console::SeriesS => victory_formats::texture::PipeConfig::Pipes8Packers4, + } + } + /// Title memory in bytes: (GPU-optimal, standard). Series X in the /// advanced configuration; Series S has one range, counted as standard /// (7,776 MiB, the published console-mode figure). diff --git a/crates/victory-gpu/src/resource.rs b/crates/victory-gpu/src/resource.rs index a0bb30f9c..ce75b6ebb 100644 --- a/crates/victory-gpu/src/resource.rs +++ b/crates/victory-gpu/src/resource.rs @@ -3533,10 +3533,10 @@ pub(crate) fn texture_kind(this: This) -> Option<(u64, u32, u32)> { /// Texture `this`'s console layout (one plane), where it lies in title /// memory and the bytes that layout takes, for `crate::texback`; `None` for -/// a buffer or a texture with planes. An `R32_FLOAT` texture at a 64 KiB -/// boundary in `SW_64KB_R_X` (the ocean's height map) is addressed with the -/// console's pipes and packers -/// ([`victory_formats::texture::Layout::configure_render_xor`]). +/// a buffer or a texture with planes. A texture in an XOR mode at a block +/// boundary (as the ocean's height map in `SW_64KB_R_X`) is addressed with +/// the console's pipes and packers +/// ([`victory_formats::texture::Layout::configure_xor`]). #[cfg(windows)] pub(crate) fn title_texture(this: This) -> Option<(victory_formats::texture::Layout, usize, usize)> { if this.is_null() { @@ -3549,14 +3549,9 @@ pub(crate) fn title_texture(this: This) -> Option<(victory_formats::texture::Lay let t = texture_layout(&r.desc)?; let [mut plane]: [_; 1] = t.planes.try_into().ok()?; let at = r.data() as usize; - const R32_FLOAT: u32 = 41; - if r.desc.format == R32_FLOAT && at.is_multiple_of(65536) { - use victory_formats::texture::RenderPipeConfig; - let pipes = match crate::console::current() { - crate::console::Console::SeriesS => RenderPipeConfig::Pipes8Packers4, - crate::console::Console::SeriesX => RenderPipeConfig::Pipes32Packers8, - }; - plane.layout.configure_render_xor(pipes); + // The XOR modes' addresses assume a block-aligned start. + if at.is_multiple_of(plane.layout.alignment as usize) { + plane.layout.configure_xor(crate::console::current().pipes()); } Some((plane.layout, at, t.size as usize)) } @@ -4000,11 +3995,11 @@ mod tests { #[test] #[cfg(windows)] - fn the_ocean_height_map_layout_is_addressed_at_a_64_kib_boundary() { - // SW_4KB_S always; SW_64KB_R_X only at a 64 KiB boundary; SW_64KB_S_X - // not (no XOR mode but that one has addresses yet). + fn xor_layouts_are_addressed_at_a_block_boundary() { + // SW_4KB_S always; the XOR modes (SW_64KB_R_X, SW_64KB_S_X) only at + // a 64 KiB boundary. for (swizzle, bias, addressable) in [(0x105, 0, true), (0x11b, 0, true), - (0x11b, 256, false), (0x119, 0, false)] { + (0x11b, 256, false), (0x119, 0, true), (0x119, 4096, false)] { let desc = ResourceDesc { layout: swizzle, flags: 4, ..texture(256, 256, 41, 1) }; let bytes = footprint(&desc).unwrap().size as usize; let memory = vec![0u8; bytes + 65536 + bias]; diff --git a/crates/victory-hle/src/modules/xg.rs b/crates/victory-hle/src/modules/xg.rs index eb78ec58b..b775e2965 100644 --- a/crates/victory-hle/src/modules/xg.rs +++ b/crates/victory-hle/src/modules/xg.rs @@ -147,7 +147,7 @@ fn texture(desc: &ResourceDesc) -> Option { l if l & !0xff == SWIZZLED => Swizzle(l & 0xff), _ => return None, }; - let texture = Texture::new(&TextureDesc { + let mut texture = Texture::new(&TextureDesc { dimension, width: u32::try_from(desc.width).ok()?, height: desc.height, @@ -158,6 +158,11 @@ fn texture(desc: &ResourceDesc) -> Option { swizzle, }) .ok()?; + // Offsets are from the texture's start, which the title places on a + // block boundary. + for plane in &mut texture.planes { + plane.layout.configure_xor(crate::console::current().pipes()); + } // The layout struct has room for 15 mips. (texture.planes[0].layout.mips.len() <= MIPS).then_some(texture) } From 1b1ad182469f7a2e33a9f0faf2050657ab13584d Mon Sep 17 00:00:00 2001 From: Davide Date: Sat, 28 Nov 2026 10:16:54 +0100 Subject: [PATCH 4/4] Texture layouts: XOR test covers the 3D S_T mode and an R_X mip chain; the texture computer's XOR offsets are tested Review notes: the doc names the nibble tables used, says SW_4KB_R_X has no pattern, and the element sizes the test covers. --- crates/victory-formats/src/texture.rs | 11 +++++++---- crates/victory-hle/src/modules/xg.rs | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/crates/victory-formats/src/texture.rs b/crates/victory-formats/src/texture.rs index 5dd2cada1..b8ae23105 100644 --- a/crates/victory-formats/src/texture.rs +++ b/crates/victory-formats/src/texture.rs @@ -202,8 +202,8 @@ type XorPattern = [XorBit; 16]; /// The XOR mode patterns, by console, mode ([`xor_family`]) and log2 of the /// element size: addrlib's RB+ single-sample `ADDR_SW_PATINFO` rows for /// the console's pipes and packers, expanded from `GFX10_SW_PATTERN_NIBBLE01` -/// to `NIBBLE4` (`GetSwizzlePatternFromPatternInfo`), all from -/// `gfx10SwizzlePattern.h`. Each mode's table is named in its comment. +/// to `NIBBLE3` (`GetSwizzlePatternFromPatternInfo`; `NIBBLE4` holds bits +/// above 64 KiB, empty for these modes), all from `gfx10SwizzlePattern.h`. Each mode's table is named in its comment. #[rustfmt::skip] static XOR_PATTERNS: [[[XorPattern; 5]; 12]; 2] = [ // Series S: addrlib's "8 pipes (4 PKRs)" rows. @@ -814,6 +814,8 @@ impl Layout { /// linear, the modes without pipe or bank XOR, and the XOR modes once /// [`Layout::configure_xor`] has named the console; single-sampled. /// + /// `SW_4KB_R_X` stays unaddressed: GFX10 has no pattern for it. + /// /// shortcut: no addressing for MSAA; titles use it for render targets /// and depth, which the host renders. pub fn addressable(&self) -> bool { @@ -1293,7 +1295,7 @@ mod tests { /// Every XOR mode, on both consoles: elements tiled by `tile` sit where /// `offset` says, and `detile` gives the rows back, for arrays, thick - /// and thin 3D textures, mip tails, and 2- to 16-byte elements. + /// and thin 3D textures, mip tails, and 1- to 16-byte elements. #[test] fn xor_modes_tile_where_offset_points() { let cases = [ @@ -1308,7 +1310,8 @@ mod tests { (Dimension::Tex3d, 64, 32, 16, 0, 8, Swizzle::SW_64KB_S_X), (Dimension::Tex3d, 20, 20, 20, 0, 4, Swizzle::SW_4KB_S_X), (Dimension::Tex3d, 32, 32, 8, 0, 4, Swizzle::SW_64KB_D_X), - (Dimension::Tex3d, 50, 30, 6, 1, 4, Swizzle::SW_64KB_R_X), + (Dimension::Tex3d, 50, 30, 6, 0, 4, Swizzle::SW_64KB_R_X), + (Dimension::Tex3d, 40, 24, 12, 0, 2, Swizzle::SW_64KB_S_T), ]; for config in [PipeConfig::Pipes8Packers4, PipeConfig::Pipes32Packers8] { for (dimension, width, height, depth, mips, bytes, swizzle) in cases { diff --git a/crates/victory-hle/src/modules/xg.rs b/crates/victory-hle/src/modules/xg.rs index b775e2965..8ed0e4d98 100644 --- a/crates/victory-hle/src/modules/xg.rs +++ b/crates/victory-hle/src/modules/xg.rs @@ -658,6 +658,21 @@ mod tests { slot:: u32>(c, 1)(c); } + /// An XOR mode gets element offsets once the console is known: the + /// first rows of a 256x256 R32 `SW_64KB_R_X` texture on Series X. + #[test] + fn xor_modes_have_element_offsets() { + type Offset = extern "system" fn(This, u32, u32, u64, u32, u32, u32, *mut u32) -> u64; + let c = create(&desc(256, 256, 1, 41, 0x11b)); + let offset: Offset = slot(c, 6); + let at = |x, y| offset(c, 0, 0, x, y, 0, 0, std::ptr::null_mut()); + // x bits 0 and 1 land on address bits 2 and 3, y bit 0 on bit 4. + assert_eq!([at(0, 0), at(1, 0), at(2, 0), at(0, 1)], [0, 4, 8, 16]); + // x bit 7 also flips a pipe bit inside the block. + assert_eq!(at(128, 0), 65536 + 0x8100); + slot:: u32>(c, 1)(c); + } + #[test] fn suggestions_follow_the_use() { let mut out = 0;