Change Render Target Mip Map Slice

Started by
3 comments, last by Adam Miles 8 years, 8 months ago

I am manually rendering a chain of mip maps with DirectX 12. Right now, I am setting the applicable D3D12_RENDER_TARGET_VIEW_DESC::Texture2D.MipSlice value and calling CreateRenderTargetView for each mip map level. Is there any way to change the MipSlice value of an already created render target view, or am I right in creating an array of these things?

Advertisement

Sounds like you're doing it right. You'll need a separate render target view for each subresource you want to render to.

The only way to change the mip slice value of an already created render target view would be to overwrite its location in the descriptor heap. If the GPU is still using that data, you'll obviously run into issues.

The only way to change the mip slice value of an already created render target view would be to overwrite its location in the descriptor heap. If the GPU is still using that data, you'll obviously run into issues.

Given that descriptor heaps for RTVs are not shader visible I don't think you can overwrite an RTV descriptor while the GPU is using it. RTV descriptors are copied into the command list during a call to OMSetRenderTargets and I believe you're then free to overwrite the descriptors in the heap immediately if you won't need them again.

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

Interesting. I understand they're not shader visible, but hadn't considered they'd be copied immediately on calls to OMSetRenderTargets. I'll have to give that a try.

The particular line from the docs that I think is relevant is here:

"For example, Render Target Views (RTVs), Depth Stencil Views (DSVs), Index Buffer Views (IBVs), and other descriptors get bound to the pipeline by having their contents recorded into the command list directly rather than via descriptor tables which reference the descriptor heap at command list execution"

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

This topic is closed to new replies.

Advertisement