Compare commits

...

2 Commits

Author SHA1 Message Date
lightningterror
ed09dca17e GS/DX11: Also check DrawMultiStretchRects copy for srv conflicts with rtv.
Also adjust the naming.
2025-06-23 15:09:03 +02:00
TheLastRar
e64fbb2f0e FSUI: Centre disc/exe icon in game list selected preview
The ImGui::Image path was missing the centring logic when drawing svg icons.
Covers where already correctly centred.
2025-06-23 15:07:56 +02:00
3 changed files with 11 additions and 4 deletions

View File

@@ -1281,7 +1281,7 @@ void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture*
if (dTex)
{
ds = dTex->GetSize();
PSUnbindConflictingSRVs(dTex, nullptr);
PSUnbindConflictingSRVs(dTex);
if (draw_in_depth)
OMSetRenderTargets(nullptr, dTex);
else
@@ -1457,6 +1457,7 @@ void GSDevice11::DrawMultiStretchRects(const MultiStretchRect* rects, u32 num_re
PSSetShader(m_convert.ps[static_cast<int>(shader)].get(), nullptr);
OMSetDepthStencilState(dTex->IsRenderTarget() ? m_convert.dss.get() : m_convert.dss_write.get(), 0);
PSUnbindConflictingSRVs(dTex);
OMSetRenderTargets(dTex->IsRenderTarget() ? dTex : nullptr, dTex->IsDepthStencil() ? dTex : nullptr);
const GSVector2 ds(static_cast<float>(dTex->GetWidth()), static_cast<float>(dTex->GetHeight()));
@@ -2365,13 +2366,13 @@ void GSDevice11::PSUpdateShaderState()
m_ctx->PSSetSamplers(0, m_state.ps_ss.size(), m_state.ps_ss.data());
}
void GSDevice11::PSUnbindConflictingSRVs(GSTexture* rt, GSTexture* ds)
void GSDevice11::PSUnbindConflictingSRVs(GSTexture* tex1, GSTexture* tex2)
{
// Make sure no SRVs are bound using the same texture before binding it to a RTV.
bool changed = false;
for (size_t i = 0; i < m_state.ps_sr_views.size(); i++)
{
if ((rt && m_state.ps_sr_views[i] == *(GSTexture11*)rt) || (ds && m_state.ps_sr_views[i] == *(GSTexture11*)ds))
if ((tex1 && m_state.ps_sr_views[i] == *(GSTexture11*)tex1) || (tex2 && m_state.ps_sr_views[i] == *(GSTexture11*)tex2))
{
m_state.ps_sr_views[i] = nullptr;
changed = true;

View File

@@ -325,7 +325,7 @@ public:
void PSSetShaderResource(int i, GSTexture* sr);
void PSSetShader(ID3D11PixelShader* ps, ID3D11Buffer* ps_cb);
void PSUpdateShaderState();
void PSUnbindConflictingSRVs(GSTexture* rt, GSTexture* ds);
void PSUnbindConflictingSRVs(GSTexture* tex1 = nullptr, GSTexture* tex2 = nullptr);
void PSSetSamplerState(ID3D11SamplerState* ss0);
void OMSetDepthStencilState(ID3D11DepthStencilState* dss, u8 sref);

View File

@@ -7009,6 +7009,9 @@ void FullscreenUI::DrawGameCover(const GameList::Entry* entry, const ImVec2& siz
const ImVec2 image_square(min_size, min_size);
GSTexture* const icon_texture = GetTextureForGameListEntryType(entry->type, image_square);
const ImRect image_rect(CenterImage(size, image_square));
ImGui::SetCursorPos(origin + image_rect.Min);
DrawSvgTexture(icon_texture, image_square);
}
// Pretend the image we drew was the the size passed to us
@@ -7050,6 +7053,9 @@ void FullscreenUI::DrawFallbackCover(const ImVec2& size)
const ImVec2 image_square(min_size, min_size);
GSTexture* const icon_texture = GetTextureForGameListEntryType(GameList::EntryType::PS2Disc, image_square);
const ImRect image_rect(CenterImage(size, image_square));
ImGui::SetCursorPos(origin + image_rect.Min);
DrawSvgTexture(icon_texture, image_square);
// Pretend the image we drew was the the size passed to us