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

Cannot create UAV for 3D texture #381

Open
Bundas102 opened this issue Sep 12, 2023 · 0 comments
Open

Cannot create UAV for 3D texture #381

Bundas102 opened this issue Sep 12, 2023 · 0 comments

Comments

@Bundas102
Copy link

Creating a UAV for any MIP level other than the base level fails.

auto tex = Texture::create3D(mpDevice, 32, 32, 32, ResourceFormat::R8Uint, 2, nullptr, ResourceBindFlags::AllColorViews);
auto uav = tex->getUAV(1);

The above code results in the following error.
D3D12 ERROR: ID3D12Device::CreateUnorderedAccessView: The Dimensions of the View are invalid. MipSlice (value = 1) must be between 0 and MipLevels-1 of the Texture Resource, 1, inclusively. FirstWSlice (value = 0) must be between 0 and the Depth size of the Mip Level, 15, inclusively. With the current FirstWSlice, WSize (value = 32) must be between 1 and 16, or -1 to default to all slices from MipSlice, inclusively, in order that the View fit on the Texture. [ STATE_CREATION ERROR #345: CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS]

The problem is WSize being 32 insted of 16 (since level 1 is half the size of the full texture). Similar things happen for larger MIP levels; WSize seems to be always set to the base size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant