Skip to content

Commit

Permalink
MP1-5171: Additional Direct3DDevice9 rendering backup/restore
Browse files Browse the repository at this point in the history
  • Loading branch information
epbk committed Aug 2, 2023
1 parent 8b4f3d1 commit 306de5c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion DirectShowFilters/mpc-hc_subs/src/mpc-hc_subs/SubManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,17 @@ void CSubManager::Render(int x, int y, int width, int height, int xOffsetInPixel
//ATLTRACE("src: (%d,%d) - (%d,%d)", rcSource.left, rcSource.top, rcSource.right, rcSource.bottom);
//ATLTRACE("dst: (%d,%d) - (%d,%d)\n", rcDest.left, rcDest.top, rcDest.right, rcDest.bottom);
rcDest.OffsetRect(x, y);
DWORD fvf, alphaTest, colorOp, samplerAddressU, samplerAddressV;
DWORD fvf, alphaTest, colorOp, samplerAddressU, samplerAddressV, samplerFtMag, samplerFtMin, samplerFtMip;
m_d3DDev->GetFVF(&fvf);
m_d3DDev->GetRenderState(D3DRS_ALPHATESTENABLE, &alphaTest);
m_d3DDev->GetTextureStageState(0, D3DTSS_COLOROP, &colorOp); //change to it causes "white" osd artifact
m_d3DDev->GetSamplerState(0, D3DSAMP_ADDRESSU, &samplerAddressU);
m_d3DDev->GetSamplerState(0, D3DSAMP_ADDRESSV, &samplerAddressV);

m_d3DDev->GetSamplerState(0, D3DSAMP_MAGFILTER, &samplerFtMag);
m_d3DDev->GetSamplerState(0, D3DSAMP_MINFILTER, &samplerFtMin);
m_d3DDev->GetSamplerState(0, D3DSAMP_MIPFILTER, &samplerFtMip);

m_d3DDev->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);

pSubPic->AlphaBlt(rcSource, rcDest, NULL/*pTarget*/);
Expand All @@ -387,6 +391,10 @@ void CSubManager::Render(int x, int y, int width, int height, int xOffsetInPixel

m_d3DDev->SetSamplerState(0, D3DSAMP_ADDRESSU, samplerAddressU);
m_d3DDev->SetSamplerState(0, D3DSAMP_ADDRESSV, samplerAddressV);

m_d3DDev->SetSamplerState(0, D3DSAMP_MAGFILTER, samplerFtMag);
m_d3DDev->SetSamplerState(0, D3DSAMP_MINFILTER, samplerFtMin);
m_d3DDev->SetSamplerState(0, D3DSAMP_MIPFILTER, samplerFtMip);
}
}
}
Expand Down

0 comments on commit 306de5c

Please sign in to comment.