Skip to content

Commit

Permalink
Disabled anisotropic filtering optimizations in Metaphor: ReFantazio …
Browse files Browse the repository at this point in the history
…because most textures are not mipmap-complete
  • Loading branch information
Kaldaien committed Dec 12, 2024
1 parent 12c42a0 commit b80dd20
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 34 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
24.12.8
24.12.12
========
+ Disabled anisotropic filtering optimizations in Metaphor: ReFantazio because
most textures are not mipmap-complete.

24.12.8
=======
+ Uncommented checks for PlayStation controllers when a game uses
Windows.Gaming.Input warning about potential incompatibility.
Expand Down
2 changes: 1 addition & 1 deletion include/SpecialK/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#define SK_YEAR 24
#define SK_MONTH 12
#define SK_DATE 8
#define SK_DATE 12
#define SK_REV_N 0
#define SK_REV 0

Expand Down
35 changes: 3 additions & 32 deletions src/render/d3d11/hooks/d3d11_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,17 +514,6 @@ D3D11Dev_CreateShaderResourceView1_Override (
if (pResource == nullptr)
return E_INVALIDARG;

if (SK_GetCurrentGameID () == SK_GAME_ID::Metaphor &&
pDesc != nullptr &&
pDesc->ViewDimension == D3D11_SRV_DIMENSION_TEXTURE2D)
{
if (DirectX::IsCompressed (pDesc->Format))
{
((D3D11_SHADER_RESOURCE_VIEW_DESC*)pDesc)->Texture2D.MostDetailedMip = 0;
((D3D11_SHADER_RESOURCE_VIEW_DESC*)pDesc)->Texture2D.MipLevels = (UINT)-1;
}
}

D3D11_SHADER_RESOURCE_VIEW_DESC1 desc =
{ .Format = DXGI_FORMAT_UNKNOWN,
.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D,
Expand Down Expand Up @@ -838,23 +827,6 @@ D3D11Dev_CreateDepthStencilView_Override (
(pDesc_ != nullptr) ?
&_desc : nullptr;

#if 0
if (pDesc != nullptr && SK_IsCurrentGame (SK_GAME_ID::Metaphor))
{
// Depth Buffer Upgrade for Less Aliasing...
if (pDesc->Format == DXGI_FORMAT_D24_UNORM_S8_UINT)
pDesc->Format = DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
else
{
if (pDesc->Format == DXGI_FORMAT_UNKNOWN ||
pDesc->Format == DXGI_FORMAT_R32G8X24_TYPELESS)
{
pDesc->Format = DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
}
}
}
#endif

#ifdef _SK_D3D11_VALIDATE_DEVICE_RESOURCES
if (pResource != nullptr)
{
Expand Down Expand Up @@ -1295,7 +1267,7 @@ D3D11Dev_CreateSamplerState_Override
new_desc.ComparisonFunc, new_desc.AddressU, new_desc.AddressV, new_desc.AddressW, SK_SummarizeCaller ().c_str () );
#endif

#pragma region "UglyGameHacksThatShouldNotBeHere"
#pragma region UglyGameHacksThatShouldNotBeHere
static const bool bShenmue =
SK_GetCurrentGameID () == SK_GAME_ID::Shenmue;

Expand Down Expand Up @@ -1475,9 +1447,7 @@ D3D11Dev_CreateSamplerState_Override
}
}
#endif
#pragma endregion

#if 1
#if 0
if (SK_GetCurrentGameID () == SK_GAME_ID::Metaphor)
{
if ( new_desc.Filter <= D3D11_FILTER_ANISOTROPIC &&
Expand All @@ -1500,6 +1470,7 @@ D3D11Dev_CreateSamplerState_Override
}
}
#endif
#pragma endregion

//
// Modern codepath for generic configurable sampler overrides
Expand Down

0 comments on commit b80dd20

Please sign in to comment.