Skip to content

Commit

Permalink
Небольшая корректировка информации в статистики.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksoid1978 committed Mar 14, 2021
1 parent 4aa1750 commit 79665a2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Source/DX11VideoProcessor.cpp
Expand Up @@ -2366,9 +2366,13 @@ HRESULT CDX11VideoProcessor::Process(ID3D11Texture2D* pRenderTarget, const CRect
bool bNeedShaderTransform = (m_TexConvertOutput.desc.Width != dstRect.Width() || m_TexConvertOutput.desc.Height != dstRect.Height() || m_bFlip
|| dstRect.right > m_windowRect.right || dstRect.bottom > m_windowRect.bottom);
if (!bNeedShaderTransform && !bNeedPostProc && m_TexConvertOutput.desc.Format == m_SwapChainFmt) {
m_bVPScalingUseShaders = false;

hr = D3D11VPPass(pRenderTarget, rSrc, dstRect, second);
return hr;
}
m_bVPScalingUseShaders = true;

CRect rect(0, 0, m_TexConvertOutput.desc.Width, m_TexConvertOutput.desc.Height);
hr = D3D11VPPass(m_TexConvertOutput.pTexture, rSrc, rect, second);
pInputTexture = &m_TexConvertOutput;
Expand Down Expand Up @@ -3038,7 +3042,7 @@ HRESULT CDX11VideoProcessor::DrawStats(ID3D11Texture2D* pRenderTarget)
str += fmt::format(L"\nScaling : {}x{} -> {}x{}", m_srcRectWidth, m_srcRectHeight, dstW, dstH);
}
if (m_srcRectWidth != dstW || m_srcRectHeight != dstH) {
if (m_D3D11VP.IsReady() && m_bVPScaling) {
if (m_D3D11VP.IsReady() && m_bVPScaling && !m_bVPScalingUseShaders) {
str.append(L" D3D11");
} else {
str += L' ';
Expand Down
6 changes: 5 additions & 1 deletion Source/DX9VideoProcessor.cpp
Expand Up @@ -2286,9 +2286,13 @@ HRESULT CDX9VideoProcessor::Process(IDirect3DSurface9* pRenderTarget, const CRec
bool bNeedShaderTransform = (m_TexConvertOutput.Width != dstRect.Width() || m_TexConvertOutput.Height != dstRect.Height() || m_iRotation || m_bFlip
|| dstRect.left < 0 || dstRect.top < 0 || dstRect.right > m_windowRect.right || dstRect.bottom > m_windowRect.bottom);
if (!bNeedShaderTransform && !bNeedPostProc && m_TexConvertOutput.Format == m_d3dpp.BackBufferFormat) {
m_bVPScalingUseShaders = false;

hr = DxvaVPPass(pRenderTarget, rSrc, dstRect, second);
return hr;
}
m_bVPScalingUseShaders = true;

CRect rect(0, 0, m_TexConvertOutput.Width, m_TexConvertOutput.Height);
hr = DxvaVPPass(m_TexConvertOutput.pSurface, rSrc, rect, second);
pInputTexture = m_TexConvertOutput.pTexture;
Expand Down Expand Up @@ -2666,7 +2670,7 @@ HRESULT CDX9VideoProcessor::DrawStats(IDirect3DSurface9* pRenderTarget)
str += fmt::format(L"\nScaling : {}x{} -> {}x{}", m_srcRectWidth, m_srcRectHeight, dstW, dstH);
}
if (m_srcRectWidth != dstW || m_srcRectHeight != dstH) {
if (m_DXVA2VP.IsReady() && m_bVPScaling) {
if (m_DXVA2VP.IsReady() && m_bVPScaling && !m_bVPScalingUseShaders) {
str.append(L" DXVA2");
} else {
str += L' ';
Expand Down
2 changes: 2 additions & 0 deletions Source/VideoProcessor.h
Expand Up @@ -56,6 +56,8 @@ class CVideoProcessor
bool m_bHdrToggleDisplay = true;
bool m_bConvertToSdr = true;

bool m_bVPScalingUseShaders = false;

CopyFrameDataFn m_pConvertFn = nullptr;
CopyFrameDataFn m_pCopyGpuFn = CopyFrameAsIs;

Expand Down

0 comments on commit 79665a2

Please sign in to comment.