GPU: D3D12 fails to create multisample texture #13084
< 8000 /div>
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Creating a multisample texture on an Intel iGPU
D3D12 feature set 11_1
fails with an error for incorrect alignment setting.This is update sets the alignment of multisample textures to
D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT
. According to Microsoft documentation the alignment could also be set to0
and it would automatically get detected.https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_resource_desc#alignment
I notice that it talks about small size restriction which would allow using the current 64kb alignment. Looking at the error this doesn't appear that useful as 1200x800 sample count 2 needed 494 tiles whereas 16 tiles is the maximum for the small size restriction.
Tested and working on NVidia RTX 30 series GPU and Intel iGPU.
Error
D3D12 WARNING: ID3D12Device::CreateCommittedResource: D3D12_RESOURCE_DESC::Alignment cannot be 64KB, since D3D12_RESOURCE_DESC::Width, D3D12_RESOURCE_DESC::Height, and/ or D3D12_RESOURCE_DESC::DepthOrArraySize are too large. 64KB alignment requires the most detailed mip level be theoretically 4MB or smaller. A 64KB tile shape for D3D12_RESOURCE_DIMENSION_TEXTURE2D and D32_FLOAT is 32 texels wide, 64 texels high, and 1 texels deep. When Width = 1200, Height = 800, and Depth = 1, the number of tiles needed is 494, while 16 tiles is the maximum. D3D12_RESOURCE_DESC::Alignment must be 0 or 4MB (aka D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT).