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
2 changes: 1 addition & 1 deletion include/9on12draw.inl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace D3D9on12
{
// Data uploaded for a draw is only valid for that draw, and should be cleaned up immediately after to prevent
// successive draws from reading stale/deleted data
if (device.GetPipelineState().GetIntzRestoreZWrite())
if (!g_AppCompatInfo.DisableIntzDSVFix && device.GetPipelineState().GetIntzRestoreZWrite())
{
device.GetPipelineState().GetPixelStage().SetDepthStencilState(device, D3DRS_ZWRITEENABLE, 1);
device.GetPipelineState().SetIntzRestoreZWrite(false);
Expand Down
1 change: 1 addition & 0 deletions interface/d3d9on12ddi.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ typedef struct _D3D9ON12_APP_COMPAT_INFO
DWORD MaxAllocatedUploadHeapSpacePerCommandList; // Maximum amount of storage allocated for upload operations per command list before flush
DWORD MaxSRVHeapSize; // Maximum number of entries in the sharer resource view decriptor heap
DWORD BufferPoolTrimThreshold; // How many fences (roughly translates to frames) a buffer in the buffer pool is allowed to exist before it is eleigible for being reclaimed. Must be in the range 5-100 to have an effect
DWORD DisableIntzDSVFix; // Disables the fix for INTZ DSV also bound as SRV that disables ZWrite instead of hiding SRV. Some apps (ex: GTAIV) actually require the opposite behavior. This is a workaround until "feedback loop" surfaces are possible in d3d12
} D3D9ON12_APP_COMPAT_INFO;

typedef void (APIENTRY *PFND3D9ON12_SETAPPCOMPATDATA)(
Expand Down
1 change: 1 addition & 0 deletions src/9on12AppCompat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace D3D9on12
MAXDWORD, // MaxAllocatedUploadHeapSpacePerCommandList
MAXDWORD, // MaxSRVHeapSize
MAXDWORD, // BufferPoolTrimThreshold
0, // DisableIntzDSVFix
};

void APIENTRY SetAppCompatData(const D3D9ON12_APP_COMPAT_INFO *pAppCompatData)
Expand Down
2 changes: 1 addition & 1 deletion src/9on12PixelStage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ namespace D3D9on12
bool HideSRV = pResource->GetDSVBindingTracker().IsBound() && GetDepthStencilStateID().ZWriteEnable;

// resources with INTZ surface format, set ZWriteEnable to false instead of hiding SRV
if (HideSRV && (pResource->GetD3DFormat() == D3DFMT_INTZ))
if (!g_AppCompatInfo.DisableIntzDSVFix && HideSRV && (pResource->GetD3DFormat() == D3DFMT_INTZ))
{
HideSRV = false;
SetDepthStencilState(device, D3DRS_ZWRITEENABLE, 0);
Expand Down
Loading