D3D12使用后缓冲表面作为无序访问视图(UAV) [英] D3D12 Use backbuffer surface as unordered access view (UAV)

查看:451
本文介绍了D3D12使用后缓冲表面作为无序访问视图(UAV)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为学校项目制作一个简单的raytracer,假设应该使用计算着色器来阴影三角形或其他一些图元. 为此,我想直接在计算着色器中写入backbuffer-surface,然后直接呈现结果.我确定可以在DX11中实现,尽管我似乎无法使其在DX12中正常工作.

我无法收集到太多有关此的信息,但是我发现解决方案

您将必须访问答案.他们删除了创建无人飞行器的功能,就像删除了在交换链中使用多样本表面的功能一样.

在交换链表面授权无人机的问题在于,他们将不得不放弃对正在发生的事情的跟踪. DX12依赖于在运行时对UAV具有100%易失性的描述符堆(渲染目标仅在CPU端可以跟踪).

Microsoft需要强烈跟踪交换链表面状态,以保证桌面演示的行为,因此,他们选择拒绝UAV绑定.

Im making a simple raytracer for a schoolproject were a compute shader is supposed to be used to shade a triangle or some other primitive. For this I'd like to write to a backbuffer-surface directly in the compute shader, to then present the results imideatly. I know for certain that this is possible in DX11 though i can't seem to get it to work in DX12.

I couldn't gather that much information about this, but i found this gamedev thread discussing the exact same problem I try to figure out and they seem to come to the conclusion which was my go to workaround: writing to an intermediate texture and then sampling in a pipeline. I can't fully accept that this would be impossible to achieve in dx12. Why would that feature be removed? Could it be that the queuing-systems removes some overhead that makes it unnecessary to have this feature?

Is there any way to achieve a raytracer without writing to a separate texture and then sampling in a pipeline or copy it onto the back-buffer? What are my best alternatives for achieving performance?

解决方案

You will have to access the answer. They removed the capability to create an UAV the same way they removed the capability to use multisample surface in the swapchain.

The problem with authorizing UAV on the swapchain surface is that they would have to forfeit tracking of what is happening to it. DX12 rely on descriptor heaps that are 100% volatile at runtime for UAVs ( render targets are CPU side only and can be tracked ).

Microsoft need to track the swapchain surface status strongly in order to guarantee behavior with the desktop presentation and for that reason, they choose to deny the UAV binding.

这篇关于D3D12使用后缓冲表面作为无序访问视图(UAV)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆