mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-04 16:24:29 +01:00
[d3d9] Transition DS too if there's a feedback loop
This commit is contained in:
parent
a20869fb93
commit
60b6e98529
@ -5592,10 +5592,25 @@ namespace dxvk {
|
||||
|
||||
|
||||
void D3D9DeviceEx::MarkRenderHazards() {
|
||||
EmitCs([](DxvkContext* ctx) {
|
||||
EmitCs([
|
||||
cActiveHazardsRT = m_activeHazardsRT,
|
||||
cActiveHazardsDS = m_activeHazardsDS
|
||||
](DxvkContext* ctx) {
|
||||
VkPipelineStageFlags srcStages = 0;
|
||||
VkAccessFlags srcAccess = 0;
|
||||
|
||||
if (cActiveHazardsRT != 0) {
|
||||
srcStages |= VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
||||
srcAccess |= VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
|
||||
}
|
||||
if (cActiveHazardsDS != 0) {
|
||||
srcStages |= VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT;
|
||||
srcAccess |= VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
|
||||
}
|
||||
|
||||
ctx->emitGraphicsBarrier(
|
||||
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
|
||||
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
|
||||
srcStages,
|
||||
srcAccess,
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
VK_ACCESS_SHADER_READ_BIT);
|
||||
});
|
||||
@ -5608,6 +5623,15 @@ namespace dxvk {
|
||||
m_flags.set(D3D9DeviceFlag::DirtyFramebuffer);
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32_t samplerIdx : bit::BitMask(m_activeHazardsDS)) {
|
||||
// Guaranteed to not be nullptr...
|
||||
auto tex = GetCommonTexture(m_state.textures[samplerIdx]);
|
||||
if (unlikely(!tex->MarkHazardous())) {
|
||||
TransitionImage(tex, m_hazardLayout);
|
||||
m_flags.set(D3D9DeviceFlag::DirtyFramebuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6400,7 +6424,7 @@ namespace dxvk {
|
||||
|
||||
|
||||
void D3D9DeviceEx::PrepareDraw(D3DPRIMITIVETYPE PrimitiveType) {
|
||||
if (unlikely(m_activeHazardsRT != 0))
|
||||
if (unlikely(m_activeHazardsRT != 0 || m_activeHazardsDS != 0))
|
||||
MarkRenderHazards();
|
||||
|
||||
if (unlikely((!m_lastHazardsDS) != (!m_activeHazardsDS))
|
||||
|
Loading…
Reference in New Issue
Block a user