GetResourceAllocation errors while using castable formats and CreateResource3 #62
Labels
bug
Something isn't working
investigating
Still to be determined whether we work on this
next release
To be done as soon as possible
Hi ! Long time no see !
I'm encountering an issue while creating a resource with CreateResource3 and castable formats.
I'm creating a BC3_UNORM 2D texture with UAV allowed and it can cast to R32G32B32A32_UINT and BC3_UNORM_SRGB. CreatePlacedResource2 or CreateCommittedResource3 accepts this compressed UAV as it can cast to uncompressed format that is coherent.
The issue is that CreateResource3 will do a GetResourceAllocationInfo1 or GetResourceAllocationInfo2 that don't accept castable format, lead to D3D12 errors and return an allocation info with SizeInBytes == (uint64_t)-1. As you save this size and give it to RemoveAllocation, it leads to a failed assert.
To avoid this and errors in D3D12, it seems that it should use GetResourceAllocationInfo3 in ID3D12Device12 interface. I can't create a pull request from a private repo but this is my patch to fix the issue. It fixes for me but it is not perfect and I'm not sure it respects guideline when ID3D12Device12 is not supported 🤔.
resourceAllocation3.patch
Have a nice day !
Robin
The text was updated successfully, but these errors were encountered: