EFB2RAM: Downsample higher resolutions with linear filtering.

This commit is contained in:
Scott Mansell 2016-09-07 11:17:32 +12:00
parent 18030ebfb4
commit f5c70a4b27
3 changed files with 15 additions and 5 deletions

View File

@ -126,8 +126,11 @@ void PSTextureEncoder::Encode(u8* dst, u32 format, u32 native_width, u32 bytes_p
D3D::context->UpdateSubresource(m_encodeParams, 0, nullptr, &params, 0, 0); D3D::context->UpdateSubresource(m_encodeParams, 0, nullptr, &params, 0, 0);
D3D::stateman->SetPixelConstants(m_encodeParams); D3D::stateman->SetPixelConstants(m_encodeParams);
// Use linear filtering if (bScaleByHalf), use point filtering otherwise // We also linear filtering for both box filtering and downsampling higher resolutions to 1x
if (scaleByHalf) // TODO: This only produces perfect downsampling for 1.5x and 2x IR, other resolution will
// need more complex down filtering to average all pixels and produce the correct result.
// Also, box filtering won't be correct for anything other than 1x IR
if (scaleByHalf || g_ActiveConfig.iEFBScale != SCALE_1X)
D3D::SetLinearCopySampler(); D3D::SetLinearCopySampler();
else else
D3D::SetPointCopySampler(); D3D::SetPointCopySampler();

View File

@ -151,8 +151,11 @@ void PSTextureEncoder::Encode(u8* dst, u32 format, u32 native_width, u32 bytes_p
D3D::command_list_mgr->SetCommandListDirtyState(COMMAND_LIST_STATE_PS_CBV, true); D3D::command_list_mgr->SetCommandListDirtyState(COMMAND_LIST_STATE_PS_CBV, true);
// Use linear filtering if (bScaleByHalf), use point filtering otherwise // We also linear filtering for both box filtering and downsampling higher resolutions to 1x
if (scale_by_half) // TODO: This only produces perfect downsampling for 1.5x and 2x IR, other resolution will
// need more complex down filtering to average all pixels and produce the correct result.
// Also, box filtering won't be correct for anything other than 1x IR
if (scale_by_half || g_ActiveConfig.iEFBScale != SCALE_1X)
D3D::SetLinearCopySampler(); D3D::SetLinearCopySampler();
else else
D3D::SetPointCopySampler(); D3D::SetPointCopySampler();

View File

@ -227,7 +227,11 @@ static void EncodeToRamUsingShader(GLuint srcTexture, u8* destAddr, u32 dst_line
glActiveTexture(GL_TEXTURE9); glActiveTexture(GL_TEXTURE9);
glBindTexture(GL_TEXTURE_2D_ARRAY, srcTexture); glBindTexture(GL_TEXTURE_2D_ARRAY, srcTexture);
if (linearFilter) // We also linear filtering for both box filtering and downsampling higher resolutions to 1x
// TODO: This only produces perfect downsampling for 1.5x and 2x IR, other resolution will
// need more complex down filtering to average all pixels and produce the correct result.
// Also, box filtering won't be correct for anything other than 1x IR
if (linearFilter || g_ActiveConfig.iEFBScale != SCALE_1X)
g_sampler_cache->BindLinearSampler(9); g_sampler_cache->BindLinearSampler(9);
else else
g_sampler_cache->BindNearestSampler(9); g_sampler_cache->BindNearestSampler(9);