mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-13 16:08:50 +01:00
[dxvk] Make emitRenderTargetReadbackBarrier more generic
And also remove the redundant pipeline barrier.
This commit is contained in:
parent
5ff6f3a2ca
commit
bd68f05c9b
@ -6084,7 +6084,7 @@ namespace dxvk {
|
||||
void D3D9DeviceEx::PrepareDraw(D3DPRIMITIVETYPE PrimitiveType) {
|
||||
if (unlikely(m_activeHazardsRT != 0)) {
|
||||
EmitCs([](DxvkContext* ctx) {
|
||||
ctx->emitRenderTargetReadbackBarrier();
|
||||
ctx->emitGraphicsBarrier();
|
||||
});
|
||||
|
||||
if (m_d3d9Options.generalHazards)
|
||||
|
@ -1441,18 +1441,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::emitRenderTargetReadbackBarrier() {
|
||||
if (m_flags.test(DxvkContextFlag::GpRenderPassBound))
|
||||
this->spillRenderPass(true);
|
||||
|
||||
emitMemoryBarrier(0,
|
||||
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
|
||||
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
VK_ACCESS_SHADER_READ_BIT);
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::initBuffer(
|
||||
const Rc<DxvkBuffer>& buffer) {
|
||||
auto slice = buffer->getSliceHandle();
|
||||
@ -1570,6 +1558,12 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::emitGraphicsBarrier() {
|
||||
if (!m_barrierControl.test(DxvkBarrierControl::IgnoreGraphicsBarriers))
|
||||
this->spillRenderPass(true);
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::generateMipmaps(
|
||||
const Rc<DxvkImageView>& imageView,
|
||||
VkFilter filter) {
|
||||
|
@ -707,12 +707,14 @@ namespace dxvk {
|
||||
uint32_t counterBias);
|
||||
|
||||
/**
|
||||
* \brief Emits barrier for render target readback
|
||||
* \brief Emits graphics barrier
|
||||
*
|
||||
* Use between draw calls if the fragment shader
|
||||
* reads one of the currently bound render targets.
|
||||
* Needs to be used when the fragment shader reads a bound
|
||||
* render target, or when subsequent draw calls access any
|
||||
* given resource for writing. It is assumed that no hazards
|
||||
* can happen between storage descriptors and other resources.
|
||||
*/
|
||||
void emitRenderTargetReadbackBarrier();
|
||||
void emitGraphicsBarrier();
|
||||
|
||||
/**
|
||||
* \brief Generates mip maps
|
||||
|
Loading…
Reference in New Issue
Block a user