Quad fails to run on DX12. Maybe related to #1978?
$ RUST_BACKTRACE=1 cargo run --bin quad --features dx12
Finished dev [unoptimized + debuginfo] target(s) in 0.18 secs
Running `C:\Projects\rust\gfx\gfx\target\debug\quad.exe`
AdapterInfo { name: "NVIDIA GeForce GTX 970", vendor: 4318, device: 5058, software_rendering: false }
AdapterInfo { name: "Microsoft Basic Render Driver", vendor: 5140, device: 140, software_rendering: true }
Surface format: Bgra8Srgb
Memory types: [MemoryType { properties: DEVICE_LOCAL, heap_index: 0 }, MemoryType { properties: COHERENT | CPU_VISIBLE, heap_index: 1 }, MemoryType { properties: COHERENT | CPU_VISIBLE | CPU_CACHED, heap_index: 1 }, MemoryType { properties: DEVICE_LOCAL, heap_index: 0 }, MemoryType { properties: COHERENT | CPU_VISIBLE, heap_index: 1 }, MemoryType { properties: COHERENT | CPU_VISIBLE | CPU_CACHED, heap_index: 1 }, MemoryType { properties: DEVICE_LOCAL, heap_index: 0 }, MemoryType { properties: COHERENT, heap_index: 1 }, MemoryType { properties: COHERENT | CPU_CACHED, heap_index: 1 }, MemoryType { properties: DEVICE_LOCAL, heap_index: 0 }, MemoryType { properties: COHERENT, heap_index: 1 }, MemoryType { properties: COHERENT | CPU_CACHED, heap_index: 1 }]
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `0`,
right: `-2147024809`', src\backend\dx12\src\device.rs:2070:9
Works for me, also on master. What does the debug layer say? (launch through visual studio or open Dbgview.exe)
C:\Dev\gfx\examples\hal>cargo run --bin quad --features=dx12
Finished dev [unoptimized + debuginfo] target(s) in 0.36 secs
Running `C:\Dev\gfx\target\debug\quad.exe`
AdapterInfo { name: "Radeon (TM) RX 470 Graphics", vendor: 4098, device: 26591,
software_rendering: false }
AdapterInfo { name: "Microsoft Basic Render Driver", vendor: 5140, device: 140,
software_rendering: true }
Surface format: Bgra8Srgb
Memory types: [MemoryType { properties: DEVICE_LOCAL, heap_index: 0 }, MemoryTyp
e { properties: COHERENT | CPU_VISIBLE, heap_index: 1 }, MemoryType { properties
: COHERENT | CPU_VISIBLE | CPU_CACHED, heap_index: 1 }]
Appears to be the following:
D3D12 ERROR: ID3D12Device::CreatePlacedResource: A texture resource with either D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET or D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL set cannot be created on a heap with the D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES flag. [ STATE_CREATION ERROR #638: CREATERESOURCEANDHEAP_INVALIDHEAPPROPERTIES]
Exception thrown at 0x00007FFB763C4008 in quad.exe: Microsoft C++ exception: _com_error at memory location 0x000000CE7DEF3490.
Exception thrown at 0x00007FFB763C4008 in quad.exe: Microsoft C++ exception: unsigned __int64 at memory location 0x000000CE7DEF3598.
~ty nvidia! the issue is having both TRANSFER_DST and SAMPLED usage set. Internally require RT/DS usage for transfer operations atm as we implemented those as a graphics pipeline. NVIDIA gpu's only support heap tier1, requiring that a heap can only support one 'resource type'. For our image we require two types resulting in the error.~
~How to resolve this? Implement additional compute shader paths for transfer operations.~
We need to enforce the RT/DS memory type for TRANSFER_DST
Most helpful comment
~ty nvidia! the issue is having both TRANSFER_DST and SAMPLED usage set. Internally require RT/DS usage for transfer operations atm as we implemented those as a graphics pipeline. NVIDIA gpu's only support heap tier1, requiring that a heap can only support one 'resource type'. For our image we require two types resulting in the error.~~How to resolve this? Implement additional compute shader paths for transfer operations.~We need to enforce the RT/DS memory type for TRANSFER_DST