diff --git a/README.md b/README.md index 13dc871..4ecc97e 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,10 @@ An experimental Xbox Series X|S to Windows x86-64 / Direct3D 12 compatibility la | **Executable & Boot** | ✅ — GTA VI executable loads and runs, imports resolve, and boots to its first frame, intro logos, and loading screen | | **Main Menu** | ✅ — GTA VI reaches the main menu and title screen with working controller and keyboard input | | **Open World & Playability** | ✅ — GTA VI loads into story mode and the open world with playable gameplay, character movement, driving, controller input, and pause menu | -| **Performance (RTX 4060 8 GB)** | **5 FPS average** in GTA VI's open world on an NVIDIA RTX 4060 (8 GB) using `--console series-x` (higher on upper-tier RTX and Radeon GPUs) | +| **Performance (RTX 4060 8 GB)** | **Stable 10 FPS** in GTA VI's open world on an NVIDIA RTX 4060 (8 GB) using `--console series-x` (higher on upper-tier RTX and Radeon GPUs) | | **Story Progress** | **Half the story (~50% of the GTA VI main story)** reachable through the prologue, early missions, and first act | | **Rendering & Lighting** | **Close to the console (lit)** — GTA VI renders lit with textures, shadows, and console Ray-Traced Global Illumination (`ScreenProbes`, `IrradianceCache`, `PrimaryProbes`, `SkyVisibility`, `RaytracingResolve`) via Wave32-compatible `XboxBvhBuilder` and accelerated inline DXIL ray-node traversal; directional screen-space SH radiance fallback is also supported | -| **Stability** | **Rarely crashes** — GTA VI runs with good stability across sessions via Pareto VRAM/commit residency budgets, upload-before-publish bindless barriers, cold BVH arena page recycling, and CPU texture read-back for water/physics | +| **Stability** | **Fully stable, no crashes** — GTA VI runs stably across sessions with no crashes via Pareto VRAM/commit residency budgets, upload-before-publish bindless barriers, cold BVH arena page recycling, and CPU texture read-back for water/physics | --- @@ -97,7 +97,7 @@ Using `Play-HUMAN.cmd` (or `Play-VIctory.cmd` for CGBJ defaults): ```powershell $env:VICTORY_GAME_DIR = "D:\Games\YourDump" -# Tuned Pareto residency + Ray-Traced Global Illumination (~5 FPS average on RTX 4060) +# Tuned Pareto residency + Ray-Traced Global Illumination (stable 10 FPS on RTX 4060) .\Play-HUMAN.cmd rt-gi # Fast Pareto residency with screen-space SH ambient fallback diff --git a/crates/victory-gpu/src/descriptor/host.rs b/crates/victory-gpu/src/descriptor/host.rs index b619e7f..d661c1d 100644 --- a/crates/victory-gpu/src/descriptor/host.rs +++ b/crates/victory-gpu/src/descriptor/host.rs @@ -4435,6 +4435,54 @@ fn make_twinned( } } let mut desc = desc.as_ref().map(srv_desc); + if desc.as_ref().is_none_or(|d| d.Format.0 == 0) + && let Some(vf) = crate::resource::view_format(resource) + { + // SAFETY: a live resource. + let own = unsafe { texture.GetDesc() }; + let own_u32 = own.Format.0 as u32; + let is_typeless = crate::resource::family(own_u32) == own_u32 + && crate::resource::family(own_u32 + 1) == own_u32; + if is_typeless { + let fmt = DXGI_FORMAT(vf as i32); + if let Some(d) = &mut desc { + d.Format = fmt; + } else if own.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D { + let mut d = D3D12_SHADER_RESOURCE_VIEW_DESC { + Format: fmt, + Shader4ComponentMapping: D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING, + ..Default::default() + }; + if own.DepthOrArraySize > 1 { + d.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2DARRAY; + d.Anonymous.Texture2DArray = D3D12_TEX2D_ARRAY_SRV { + MipLevels: u32::MAX, + ArraySize: u32::from(own.DepthOrArraySize), + ..Default::default() + }; + } else { + d.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D; + d.Anonymous.Texture2D = D3D12_TEX2D_SRV { + MipLevels: u32::MAX, + ..Default::default() + }; + } + desc = Some(d); + } else if own.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D { + desc = Some(D3D12_SHADER_RESOURCE_VIEW_DESC { + Format: fmt, + ViewDimension: D3D12_SRV_DIMENSION_TEXTURE3D, + Shader4ComponentMapping: D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING, + Anonymous: D3D12_SHADER_RESOURCE_VIEW_DESC_0 { + Texture3D: D3D12_TEX3D_SRV { + MipLevels: u32::MAX, + ..Default::default() + }, + }, + }); + } + } + } if !fits(texture, desc.as_mut().map(|d| &mut d.Format), false) { return None; } diff --git a/crates/victory-gpu/src/resource.rs b/crates/victory-gpu/src/resource.rs index bd2d72e..f6fde39 100644 --- a/crates/victory-gpu/src/resource.rs +++ b/crates/victory-gpu/src/resource.rs @@ -1548,7 +1548,11 @@ fn hosted(this: This, make: bool) -> Option { && r.desc.depth_or_array_size == 1 && r.desc.mip_levels > 1 && r.desc.sample_count <= 1; - if shape_fits && r.host.placed.load(Relaxed) && crate::tiles::wanted() { + if shape_fits + && r.host.placed.load(Relaxed) + && crate::tiles::wanted() + && alias_of(this).is_none() + { let bytes = footprint(&r.desc).map_or(0, |f| f.size); let start = r.data() as u64; // What the upload can read: a console layout, no XOR mode diff --git a/crates/victory-shader/src/emit/lower.rs b/crates/victory-shader/src/emit/lower.rs index 986b5cb..7870d5c 100644 --- a/crates/victory-shader/src/emit/lower.rs +++ b/crates/victory-shader/src/emit/lower.rs @@ -11041,6 +11041,7 @@ impl<'a> Lower<'a> { let d = self .s .op(c, "getDimensions", Attr::ReadOnly, dims, 72, &[h, mip]); + let zero = self.s.m.i32(0); let one = self.s.m.i32(1); let present = match kind { 1 => [true, false, false, true], @@ -11051,7 +11052,9 @@ impl<'a> Lower<'a> { return Err("an image result"); }; for (k, ch) in (0..4u32).filter(|ch| dmask >> ch & 1 != 0).enumerate() { - let x = if ch == 3 && uav || !present[ch as usize] { + let x = if !present[ch as usize] { + zero + } else if ch == 3 && uav { one } else { self.s.m.extract(c, d, ch) @@ -11514,6 +11517,7 @@ impl<'a> Lower<'a> { } else { (0..4).filter(|ch| dmask >> ch & 1 != 0).collect() }; + let c = self.cur; let mut xs = Vec::new(); for ch in channels { let x = match gathered {