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

Accessing command list on D3D9On12 #77

Open
ManjitBeeSys opened this issue Nov 14, 2022 · 8 comments
Open

Accessing command list on D3D9On12 #77

ManjitBeeSys opened this issue Nov 14, 2022 · 8 comments

Comments

@ManjitBeeSys
Copy link

Hello

We have our engine on Directx9 and we want to migrate to Directx12. We want migration step wise so using D3D9On12 where we have access to Directx12 device, command queue but no access to Command List.

Is there any way of getting acccess of command list to recored my command.

@jenatali
Copy link
Member

Not currently, no, it will need to be recorded into a separate command list.

@ManjitBeeSys
Copy link
Author

ManjitBeeSys commented Nov 15, 2022

Not currently, no, it will need to be recorded into a separate command list.

Thanks for your reply.

Can we have control over execution of command list created by D3D9On12. i.e. which function governs it ?
We want our engine's directx12 component's command list to be executed along wtih default command list created by D3D9On12 layer. How could we achive this ?

@jenatali
Copy link
Member

Can we have control over execution of command list created by D3D9On12. i.e. which function governs it ?

Command lists can be flushed at any point. They are done so when necessary, e.g. by Present, or when the CPU needs to wait for the GPU in Lock/LockRect, but can also be flushed opportunistically if the GPU is otherwise idle.

We want our engine's directx12 component's command list to be executed along wtih default command list created by D3D9On12 layer. How could we achive this ?

What do you mean by "along with"?

@ManjitBeeSys
Copy link
Author

ManjitBeeSys commented Nov 18, 2022

Can we have control over execution of command list created by D3D9On12. i.e. which function governs it ?

Command lists can be flushed at any point. They are done so when necessary, e.g. by Present, or when the CPU needs to wait for the GPU in Lock/LockRect, but can also be flushed opportunistically if the GPU is otherwise idle.

We want our engine's directx12 component's command list to be executed along wtih default command list created by D3D9On12 layer. How could we achive this ?

What do you mean by "along with"?

@jenatali thanks for reply.

along with means, executing Dx12 command list at the same time when D3D9On12 command list is executing.

@jenatali
Copy link
Member

If you want your DX12 work to execute in sequence with DX9 work, you can use the interior APIs described here. If you want your work to execute in parallel, you can just submit it to a different queue. I'm still not entirely sure what you're trying to accomplish.

@ManjitBeeSys
Copy link
Author

If you want your DX12 work to execute in sequence with DX9 work, you can use the interior APIs described here. If you want your work to execute in parallel, you can just submit it to a different queue. I'm still not entirely sure what you're trying to accomplish.

@jenatali thaks for reply.

Here we want our work to execute in parllel, but want some notification like GPU signal from D3D9On12 API to our new Directx12 created Queue.

We have following scenario. Let say we have 10 diffrent kinds of objects in a Scene, eache object's rendering written in Directx9. Our Engine renders each object in a ceratian FPS let say 25fps. Here, we have to convert our all 10 objects into Directx12, one by one. Say our 9 Objects are rendering in D3D9On12 default Queue and i have converted my 10th object's rendering complete in Directx12. Now all these 10 objects will be renderd by our Rendering Engine on 40 milliseconds. We need any mechanisim to render both D3D9On12 object and Directx12 object in a Synchronization.

Converting complete objects in Directx12 will take time so we want to go one by one.

@jenatali
Copy link
Member

Right, the interop APIs I linked earlier are what you want. When you want to transition from D3D9 rendering to 12, you'd unwrap your render targets and depth buffer, which would insert a wait on your command queue for the D3D9 rendering to finish. When you finish and want to go back to D3D9 rendering, you'd insert a signal on your queue, and return the resources, passing the fence that you signaled which 9on12 will then wait on.

Until you're done, you'll probably want to keep your swapchain in D3D9 so that Present flushes all the work.

And just to be clear, this isn't truly parallel work, it'll end up sequenced/serialized on the GPU, but it sounds like that's what you want.

@ManjitBeeSys
Copy link
Author

Right, the interop APIs I linked earlier are what you want. When you want to transition from D3D9 rendering to 12, you'd unwrap your render targets and depth buffer, which would insert a wait on your command queue for the D3D9 rendering to finish. When you finish and want to go back to D3D9 rendering, you'd insert a signal on your queue, and return the resources, passing the fence that you signaled which 9on12 will then wait on.

Until you're done, you'll probably want to keep your swapchain in D3D9 so that Present flushes all the work.

And just to be clear, this isn't truly parallel work, it'll end up sequenced/serialized on the GPU, but it sounds like that's what you want.

Thanks for your valuable reply.

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

2 participants