Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetResourceAllocation errors while using castable formats and CreateResource3 #62

Open
rbertin-aso opened this issue Jan 11, 2024 · 0 comments
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

Comments

@rbertin-aso
Copy link
Contributor

rbertin-aso commented Jan 11, 2024

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

@adam-sawicki-a adam-sawicki-a added bug Something isn't working next release To be done as soon as possible investigating Still to be determined whether we work on this labels Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants