Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pcsx2/GS/Renderers/DX11/GSDevice11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,10 @@ void GSDevice11::VSSetShader(ID3D11VertexShader* vs, ID3D11Buffer* vs_cb)
void GSDevice11::PSSetShaderResource(int i, GSTexture* sr)
{
// Update local state only, PSUpdateShaderState updates gpu state.
m_state.ps_pending_srv[i] = *static_cast<GSTexture11*>(sr);
if (sr)
m_state.ps_pending_srv[i] = *static_cast<GSTexture11*>(sr);
else
m_state.ps_pending_srv[i] = nullptr;
}

void GSDevice11::PSSetSamplerState(ID3D11SamplerState* ss0)
Expand Down
7 changes: 2 additions & 5 deletions pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2153,7 +2153,7 @@ void GSDeviceOGL::PSSetShaderResource(int i, GSTexture* sr)
{
pxAssert(i < static_cast<int>(std::size(GLState::tex_unit)));

const GLuint id = static_cast<GSTextureOGL*>(sr)->GetID();
const GLuint id = sr ? static_cast<GSTextureOGL*>(sr)->GetID() : 0;
if (GLState::tex_unit[i] != id)
{
GLState::tex_unit[i] = id;
Expand Down Expand Up @@ -2855,10 +2855,7 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
// Clear texture binding when it's bound to RT or DS.
if (!config.tex && ((draw_rt && static_cast<GSTextureOGL*>(draw_rt)->GetID() == GLState::tex_unit[0]) ||
(draw_ds && static_cast<GSTextureOGL*>(draw_ds)->GetID() == GLState::tex_unit[0])))
{
GLState::tex_unit[0] = 0;
glBindTextureUnit(0, 0);
}
PSSetShaderResource(0, nullptr);

// Avoid changing framebuffer just to switch from rt+depth to rt and vice versa.
bool fb_optimization_needs_barrier = false;
Expand Down
Loading