diff options
| author | kirigayakazima <46666711+kirigayakazima@users.noreply.github.com> | 2026-11-28 09:19:14 +0800 |
|---|---|---|
| committer | kirigayakazima <46666711+kirigayakazima@users.noreply.github.com> | 2026-11-28 09:19:14 +0800 |
| commit | 243e536bd8fa3f36ea94deff725d3b509d73bb15 (patch) | |
| tree | 175369b1596dc16785dc40f3a8468cd48c1e6666 | |
| parent | 431ceba4f4a55c69c26fcf0e36fd83e86e1b9a32 (diff) | |
D3D12: give the placed-view regression a fixed backing origin
| -rw-r--r-- | d3d12/crates/leonida-gpu/src/descriptor/host.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/d3d12/crates/leonida-gpu/src/descriptor/host.rs b/d3d12/crates/leonida-gpu/src/descriptor/host.rs index d93c86929..f8b4d7ed9 100644 --- a/d3d12/crates/leonida-gpu/src/descriptor/host.rs +++ b/d3d12/crates/leonida-gpu/src/descriptor/host.rs | |||
| @@ -6408,6 +6408,17 @@ void BY_FLOATS_OR_NOT(uint3 id : SV_DispatchThreadID) { | |||
| 6408 | }; | 6408 | }; |
| 6409 | let memory = vec![0u64; 1 << 13]; | 6409 | let memory = vec![0u64; 1 << 13]; |
| 6410 | let start = (memory.as_ptr() as u64).next_multiple_of(4096); | 6410 | let start = (memory.as_ptr() as u64).next_multiple_of(4096); |
| 6411 | // Give every placed view the same backing buffer. A loose-memory | ||
| 6412 | // window has its own origin, so start + 456 need not be on one of | ||
| 6413 | // its 456-byte elements. | ||
| 6414 | struct Backing(u64); | ||
| 6415 | impl Drop for Backing { | ||
| 6416 | fn drop(&mut self) { | ||
| 6417 | crate::shadow::unregister(self.0 as usize, self.0); | ||
| 6418 | } | ||
| 6419 | } | ||
| 6420 | crate::shadow::register(start as usize, start, 4096); | ||
| 6421 | let _backing = Backing(start); | ||
| 6411 | // SAFETY: a plain CPU-side heap of one view. | 6422 | // SAFETY: a plain CPU-side heap of one view. |
| 6412 | let cpu: ID3D12DescriptorHeap = unsafe { | 6423 | let cpu: ID3D12DescriptorHeap = unsafe { |
| 6413 | host.device.CreateDescriptorHeap(&D3D12_DESCRIPTOR_HEAP_DESC { | 6424 | host.device.CreateDescriptorHeap(&D3D12_DESCRIPTOR_HEAP_DESC { |