• Advertisement
Sign in to follow this  

Change Render Target Mip Map Slice

This topic is 975 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Edited by WFP

Share this post


Link to post
Share on other sites

 

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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"

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement