Jump to content
  • Advertisement
mark_braga

DX12: Should I create the resource in COMMON state if it will be used by the copy queue right after creation

This topic is 503 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 working on a resource loader / manager for a DX12 framework. Until now, I was creating the resources in their intended state before transitioning them to COMMON for the copy engine.

Eg:

  • Create texture in COPY_DEST.
  • Transition to COMMON on graphics queue and give ownership to copy engine.
  • Transition to COPY_DEST on copy queue.
  • Copy operations on copy queue.
  • Transition to SRV on graphics engine.

Is it better or even possible to create the texture in COMMON state to avoid that first transition from COPY_DEST to COMMON?

Also, why can't the resource be in COPY_DEST / COPY_SRC when it enters copy queue. The first operation that happens on the copy queue is anyways transition the resource to COPY_DEST or COPY_SRC.

Edited by mark_braga

Share this post


Link to post
Share on other sites
Advertisement

Yes, you should create the resource in the COMMON state if you intend to initialize its data using the Copy queue. The docs comfirm this.

You actually don't need any transition barriers for your scenario, thanks to state decay and promotion. When you access the resource on the copy queue, it will automatically get promoted from COMMON to COPY_DEST. The resource will then decay back to COMMON after the copy command list finishes executing, which means that it will auto-promote to a read state when accessed through an SRV on a graphics queue.

Share this post


Link to post
Share on other sites

Thanks for the answer. So I can avoid the first transition.

Lets say I want to transition the auto promoted SRV to UAV. Do I use COMMON as statebefore or SRV?

Edited by mark_braga

Share this post


Link to post
Share on other sites

If it's been auto-promoted, you have to transition from an SRV state to a UAV state.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!