Compare commits

...

4 Commits

Author SHA1 Message Date
lightningterror
7782d930d5 GS/HW: Always swap DATE with DATE_BARRIER if we have barriers on when alpha write is masked.
This is always enabled on vk/gl but not on dx11/12 as copies are
slow so we can selectively enable it like now.
2025-11-24 16:09:46 +01:00
lightningterror
d1a53fe29b GS/DX11/GL: Move vertices for stencil date in SetupDATE.
The vertices are used only in SetupDATE so let's move them there.
VK/DX12 already do this.
2025-11-24 16:09:46 +01:00
lightningterror
c484cf286c GS/DX11: Don't unbind shader resource if depth stencil view is read only.
We don't need to unbind conflicting srv with dsv if the dsv itself is read only, it is used for depth testing and both can be bind at the same time.

Avoids re binding srv using a read only dsv.
2025-11-24 16:08:50 +01:00
PCSX2 Bot
f8882c4da6 [ci skip] Qt: Update Base Translation. 2025-11-22 06:31:36 +01:00
6 changed files with 49 additions and 48 deletions

View File

@@ -25,32 +25,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../AboutDialog.cpp" line="51"/>
<location filename="../AboutDialog.cpp" line="52"/>
<source>Website</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../AboutDialog.cpp" line="53"/>
<location filename="../AboutDialog.cpp" line="54"/>
<source>Support Forums</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../AboutDialog.cpp" line="55"/>
<location filename="../AboutDialog.cpp" line="56"/>
<source>GitHub Repository</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../AboutDialog.cpp" line="57"/>
<location filename="../AboutDialog.cpp" line="58"/>
<source>License</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../AboutDialog.cpp" line="59"/>
<location filename="../AboutDialog.cpp" line="60"/>
<source>Third-Party Licenses</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../AboutDialog.cpp" line="119"/>
<location filename="../AboutDialog.cpp" line="120"/>
<source>View Document</source>
<translation type="unfinished"></translation>
</message>
@@ -21029,12 +21029,12 @@ Ejecting {3} and replacing it with {2}.</source>
<context>
<name>Pcsx2Config</name>
<message>
<location filename="../../pcsx2/Pcsx2Config.cpp" line="1159"/>
<location filename="../../pcsx2/Pcsx2Config.cpp" line="1160"/>
<source>Disabled (Noisy)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/Pcsx2Config.cpp" line="1160"/>
<location filename="../../pcsx2/Pcsx2Config.cpp" line="1161"/>
<source>TimeStretch (Recommended)</source>
<translation type="unfinished"></translation>
</message>

View File

@@ -2158,7 +2158,7 @@ void GSDevice11::RenderImGui()
m_ctx->IASetVertexBuffers(0, 1, m_vb.addressof(), &m_state.vb_stride, &vb_offset);
}
void GSDevice11::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, SetDATM datm)
void GSDevice11::SetupDATE(GSTexture* rt, GSTexture* ds, SetDATM datm, const GSVector4i& bbox)
{
// sfex3 (after the capcom logo), vf4 (first menu fading in), ffxii shadows, rumble roses shadows, persona4 shadows
@@ -2179,6 +2179,17 @@ void GSDevice11::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vert
// ia
const GSVector4 src = GSVector4(bbox) / GSVector4(ds->GetSize()).xyxy();
const GSVector4 dst = src * 2.0f - 1.0f;
const GSVertexPT1 vertices[] =
{
{GSVector4(dst.x, -dst.y, 0.5f, 1.0f), GSVector2(src.x, src.y)},
{GSVector4(dst.z, -dst.y, 0.5f, 1.0f), GSVector2(src.z, src.y)},
{GSVector4(dst.x, -dst.w, 0.5f, 1.0f), GSVector2(src.x, src.w)},
{GSVector4(dst.z, -dst.w, 0.5f, 1.0f), GSVector2(src.z, src.w)},
};
IASetVertexBuffer(vertices, sizeof(vertices[0]), 4);
IASetInputLayout(m_convert.il.get());
IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
@@ -2447,7 +2458,7 @@ void GSDevice11::PSUnbindConflictingSRVs(GSTexture* tex1, GSTexture* tex2)
bool changed = false;
for (size_t i = 0; i < m_state.ps_sr_views.size(); i++)
{
if ((tex1 && m_state.ps_sr_views[i] == *(GSTexture11*)tex1) || (tex2 && m_state.ps_sr_views[i] == *(GSTexture11*)tex2))
if ((tex1 && m_state.ps_sr_views[i] == *static_cast<GSTexture11*>(tex1)) || (tex2 && m_state.ps_sr_views[i] == *static_cast<GSTexture11*>(tex2)))
{
m_state.ps_sr_views[i] = nullptr;
changed = true;
@@ -2639,20 +2650,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
}
else if (config.destination_alpha == GSHWDrawConfig::DestinationAlphaMode::Stencil ||
config.destination_alpha == GSHWDrawConfig::DestinationAlphaMode::StencilOne)
{
const GSVector4 src = GSVector4(config.drawarea) / GSVector4(config.ds->GetSize()).xyxy();
const GSVector4 dst = src * 2.0f - 1.0f;
GSVertexPT1 vertices[] =
{
{GSVector4(dst.x, -dst.y, 0.5f, 1.0f), GSVector2(src.x, src.y)},
{GSVector4(dst.z, -dst.y, 0.5f, 1.0f), GSVector2(src.z, src.y)},
{GSVector4(dst.x, -dst.w, 0.5f, 1.0f), GSVector2(src.x, src.w)},
{GSVector4(dst.z, -dst.w, 0.5f, 1.0f), GSVector2(src.z, src.w)},
};
SetupDATE(colclip_rt ? colclip_rt : config.rt, config.ds, vertices, config.datm);
}
SetupDATE(colclip_rt ? colclip_rt : config.rt, config.ds, config.datm, config.drawarea);
if (config.vs.expand != GSHWDrawConfig::VSExpand::None)
{
@@ -2697,8 +2695,13 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
}
IASetPrimitiveTopology(topology);
// Depth testing and sampling, bind resource as dsv read only and srv at the same time without the need of a copy.
ID3D11DepthStencilView* read_only_dsv = nullptr;
if (config.tex && config.tex == config.ds)
read_only_dsv = static_cast<GSTexture11*>(config.ds)->ReadOnlyDepthStencilView();
// Should be called before changing local srv state.
PSUnbindConflictingSRVs(colclip_rt ? colclip_rt : config.rt, config.ds);
PSUnbindConflictingSRVs(colclip_rt ? colclip_rt : config.rt, read_only_dsv ? nullptr : config.ds);
if (config.tex)
{
@@ -2714,11 +2717,6 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
SetupVS(config.vs, &config.cb_vs);
SetupPS(config.ps, &config.cb_ps, config.sampler);
// Depth testing and sampling, bind resource as dsv read only and srv at the same time without the need of a copy.
ID3D11DepthStencilView* read_only_dsv = nullptr;
if (config.tex && config.tex == config.ds)
read_only_dsv = static_cast<GSTexture11*>(config.ds)->ReadOnlyDepthStencilView();
if (primid_texture)
{
OMDepthStencilSelector dss = config.depth;

View File

@@ -309,7 +309,7 @@ public:
void DrawMultiStretchRects(const MultiStretchRect* rects, u32 num_rects, GSTexture* dTex, ShaderConvert shader) override;
void DoMultiStretchRects(const MultiStretchRect* rects, u32 num_rects, const GSVector2& ds);
void SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, SetDATM datm);
void SetupDATE(GSTexture* rt, GSTexture* ds, SetDATM datm, const GSVector4i& bbox);
void* IAMapVertexBuffer(u32 stride, u32 count);
void IAUnmapVertexBuffer(u32 stride, u32 count);

View File

@@ -5769,9 +5769,6 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
m_conf.ps.a_masked = 1;
m_conf.ps.blend_c = 0;
m_conf.require_one_barrier |= true;
// Alpha write is masked, by default this is enabled on vk/gl but not on dx11/12 as copies are slow so we can enable it now since rt alpha is read.
DATE_BARRIER = DATE;
}
else
blend_ad_alpha_masked = false;
@@ -7698,6 +7695,11 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
}
}
// Always swap DATE with DATE_BARRIER if we have barriers on when alpha write is masked.
// This is always enabled on vk/gl but not on dx11/12 as copies are slow so we can selectively enable it like now.
if (DATE && !m_conf.colormask.wa && (m_conf.require_one_barrier || m_conf.require_full_barrier))
DATE_BARRIER = true;
if ((m_conf.ps.tex_is_fb && rt && rt->m_rt_alpha_scale) || (tex && tex->m_from_target && tex->m_target_direct && tex->m_from_target->m_rt_alpha_scale))
m_conf.ps.rta_source_correction = 1;

View File

@@ -1912,7 +1912,7 @@ void GSDeviceOGL::DoShadeBoost(GSTexture* sTex, GSTexture* dTex, const float par
StretchRect(sTex, sRect, dTex, dRect, m_shadeboost.ps, false);
}
void GSDeviceOGL::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, SetDATM datm)
void GSDeviceOGL::SetupDATE(GSTexture* rt, GSTexture* ds, SetDATM datm, const GSVector4i& bbox)
{
GL_PUSH("DATE First Pass");
@@ -1933,6 +1933,17 @@ void GSDeviceOGL::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* ver
// ia
const GSVector4 src = GSVector4(bbox) / GSVector4(ds->GetSize()).xyxy();
const GSVector4 dst = src * 2.f - 1.f;
const GSVertexPT1 vertices[] =
{
{GSVector4(dst.x, dst.y, 0.0f, 0.0f), GSVector2(src.x, src.y)},
{GSVector4(dst.z, dst.y, 0.0f, 0.0f), GSVector2(src.z, src.y)},
{GSVector4(dst.x, dst.w, 0.0f, 0.0f), GSVector2(src.x, src.w)},
{GSVector4(dst.z, dst.w, 0.0f, 0.0f), GSVector2(src.z, src.w)},
};
IASetVAO(m_vao);
IASetVertexBuffer(vertices, 4);
IASetPrimitiveTopology(GL_TRIANGLE_STRIP);
@@ -2490,18 +2501,8 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
}
[[fallthrough]];
case GSHWDrawConfig::DestinationAlphaMode::Stencil:
{
const GSVector4 src = GSVector4(config.drawarea) / GSVector4(config.ds->GetSize()).xyxy();
const GSVector4 dst = src * 2.f - 1.f;
GSVertexPT1 vertices[] =
{
{GSVector4(dst.x, dst.y, 0.0f, 0.0f), GSVector2(src.x, src.y)},
{GSVector4(dst.z, dst.y, 0.0f, 0.0f), GSVector2(src.z, src.y)},
{GSVector4(dst.x, dst.w, 0.0f, 0.0f), GSVector2(src.x, src.w)},
{GSVector4(dst.z, dst.w, 0.0f, 0.0f), GSVector2(src.z, src.w)},
};
SetupDATE(colclip_rt ? colclip_rt : config.rt, config.ds, vertices, config.datm);
}
SetupDATE(colclip_rt ? colclip_rt : config.rt, config.ds, config.datm, config.drawarea);
break;
}
GSTexture* draw_rt_clone = nullptr;

View File

@@ -332,7 +332,7 @@ public:
void RenderHW(GSHWDrawConfig& config) override;
void SendHWDraw(const GSHWDrawConfig& config, bool one_barrier, bool full_barrier);
void SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vertices, SetDATM datm);
void SetupDATE(GSTexture* rt, GSTexture* ds, SetDATM datm, const GSVector4i& bbox);
void IASetVAO(GLuint vao);
void IASetPrimitiveTopology(GLenum topology);