Horizon: Zero Dawn

Anisotropic Filtering is not even supposed to be part of the Pipeline State Object, samplers are part of the resource descriptor heap.

I do not know who takes the blame for whatever the hell happened there, I have read and re-read the D3D12 specifications and can’t figure why/how anisotropy is being baked into the PSO / Shader cache. But it absolutely is, the only way to get anisotropic filtering working is a driver override + cache flush.

1 Like

Sounds like a oversight perhaps something that should be invalidated or not possible but can be done because well I don’t know maybe someone didn’t check the documentation well enough and the assumption on DO’s and DO NOT’s is that developers will be a bit familiar with the design and works but mistakes happen.

AMD and NVIDIA and Microsoft (D3D12 and SDK and all those tools.) should have plenty of validation possibilities and such to avoid problems like these as well.

Something must have gone pretty wrong somewhere.

EDIT: Hmm wonder if the initial studio that did the port work got removed from this project after launch and now Guerilla Games are doing the support in-house slowly getting it right over the course of what appears to be multiple smaller more focused patches and a tighter release cycle so far.
(Thus why there’s Guerilla employees active in the support roles on the forums and Reddit.)

If nothing else, I’m going full D3D12 spec. nerd here, which is how I learn new APIs best :stuck_out_tongue: I used to know the OpenGL 1.2 - 4.5 specs like the back of my hand because it was my job – Lead OpenGL Engine Dev.

If lucky, SK could have working D3D12 support for its UI in-game either by the end of this month or early next.

3 Likes

Shame – it does nothing for me. I haven’t changed the graphics settings since I forced the AF override in the game some 1-2 weeks ago, and since then I have had like three shader recompiles following driver upgrade/downgrades/upgrades.

Though in general I tend to play just fine for some 2-3 hours before it crashes.

Except in the vicinity of, or within, Meridian. ■■■■ Meridian.

Edit: Stopped using Steam006’s mod as well as it had no impact on the crashes either.

But, do you (more techy savy people) guys think this shader cache thing is here to stay in other games/future releases? I know the shader is cached in other games, but never saw one doing in this way and to it take so long at it … This seems to me like a brute force solution to a problem …

Yes, shader caches were here to stay a few years ago. There’s no reason to not precompile shaders if game developers wants to ensure the best possible performance and frame pacing.

Microsoft implemented D3D12 shader caching in some prior version of Windows 10, NVIDIA I think was first with it and AMD then followed.

AMD and NVIDIA are now having some issues due to the growing size of these caches which also increases their importance since having these pre-compiled reduces stuttering or loading times that were used to mask shader compilation and some games also do shader caching of their own including for D3D11 so not just the low-level API plus Vulkan and SPIRV I think is what that format is called.

Game implementation can vary a bit but the increase in shaders and also more complex shaders and shift into compute and later on mesh shaders also increases the reliance on shader compilation and the importance of a robust shader compiler which is something I believe AMD and the Valve Proton effort on Linux is currently involved in heavily and even on Windows Steam now has a way to preload shader caches which Valve has also added to and improved on over time but I think it’s predominantly for the Vulkan API so far.

For NVIDIA the cache should be in the ProgramData directory and from ManuelG the community representative and active on sites like Guru3D the cache is kept around 1 GB and cleaned I think on a daily basis for when this is exceeded.

AMD increased their cache a few years ago but I don’t know what the current limits are, cache doesn’t seem to be cleaned out other than on driver upgrade which wipes the D3D and VLK shader folders entirely. (Keeping the OGL one for some reason.)

I think AMD has improved their shader cache but the setting for actually toggling this disappeared in Adrenaline 2020 though the registry key for it is still there, usually it’s a per-profile system so older drivers or less known games won’t be part of this and it also for some reason tends to cache certain apps and programs although I think there are blacklists for some software too.

NVIDIA I believe has a per-profile setting for it’s toggle and you can also add new games and get it to work with these pretty sure both AMD and NVIDIA has a really good Vulkan and D3D12 driver code including shader handling less certain on AMD and D3D11 and earlier.

For Microsoft the cache invalidates on software updates and also driver or OS updates so the folder might have a number of older subfolders but it’s frequently system apps although UWP titles I don’t know if those caches end up here or in the apps user folder and settings.

Games like Borderlands 3 under D3D12 dumps some shader data here too but much smaller than the games own cache curiously enough, about 110 MB or so with the full cache at almost 900 MB split between Pixel, Vertex and Compute I think is how that worked for this game and it’s D3D12 API implementation.
(Some games also have a pipeline state file in the game folder or such think it makes things a bit faster for some of the core shader data not entirely certain here.)

Emulators might be a good way to see it too like the newer WiiU one with CEMU and compare how a game runs before and after the caching is (mostly) finished but that’s a bit more of a extreme situation and I think the Vulkan API implementation removed some prior OpenGL bottlenecks too speeding things up. :slight_smile:

EDIT: Err how to sum this all up then.
Storage API’s and file system limits, thousands of files getting processed and more so for the newest games so this makes a really big difference and makes it quite important for smoothness and minimizing stuttering or having it trying to compile things in the background or slowing down initial start or loading times although doing it all at ones will make the initial startup and any further required shader compilation times a bit slower even on higher-end SSD systems.

Also makes it important to get this right and not get a corrupt or incomplete or otherwise buggy shader cache or such.

And the summary of the lengthy post ended up being lengthy too. :smiley:

Think I attached this to the above post too instead of as a non-quote since this is more of a general bit about it.

EDIT: It’s slow and non-perfect but once it’s done it makes for a nice improvement. That should do it.
But when games have 10k+ shaders (Shadow of the Tomb Raider I think for issues around DXVK performance linked to just how much shader data this game had on analysis.) it’s not going to be the fastest of tasks to process and newer games even with possibilities of using newer shader techniques will see it increase further.

But it realy is annoying having to recompile it on settings change.
I give it to driver change and gpu change, but on settings change does not make sense to me.

I remember using CEMU and somekind of nvidia driver bug at the time, that the shader cache would use more than 8GB of RAM.

Yeah that’s a game specific issue only taking the current state and caching it plus some issues around texture filtering and perhaps more if someone were to dive deeper into this and see what else is going on here.

Not sure how much of SpecialK can be adapted for D3D12 and eventual Vulkan and these API’s doing certain things different from D3D11 although it sounds from one of Kaldaiens earlier posts that the OSD functionality is coming up so that should help a bit with using SpecialK under D3D12

How’s it looking anyway for patches here?

Well going by SteamDB the depots are updating and work is being done so another patch is happening. :slight_smile:

EDIT: That’s this.
https://steamdb.info/app/1151640/depots/

QA and development branches updated two days back and the public branch / release branch from around a week ago.

The developers are pretty active with communication so there will probably a notification for when they are readying for releasing this third update ahead of it’s release. :slight_smile:

Different settings uses different shaders. You want them to just cache the necessary shaders, or all permutations of the shaders regardless of your current graphical settings?

It can almost certainly be optimized, but for now they probably chose just to cache the current settings to keep shader compilation times and space requirements down.

Hello, I got a problem, the 60fps limiter seems to disengage when I enable vsync at 60hz, it does work when vsync is off or at 120hz vsync, however I get either tearing or stuttering with those options. Is there a way to fix this?

Try setting the FPS a bit lower… say 59.93 or so.

Although note that the FPS limiter is going to fight the vsync anyway if you have both enabled.

Ok, thank you, I will try that

That’s only true of the braindead limiters from NVIDIA and RTSS :slight_smile:

SK is designed to adapt to clock skew from VSYNC, it doesn’t fight with VSYNC unless you’re doing something really wrong.

Is it possible to hack the game into forcing AF override instead since AMD AF override is limited to DirectX 9 apps?

Hopefully they’re able to fix it with the next patch but if not, AMD users still have to play this game with broken shaders :frowning:

At the moment, no :-\

I sorta have been slacking off on learning D3D12. I know the basics finally, but I have been putting all my eggs in the D3D11 basket (for obvious reasons – most games ship on D3D11 and there’s a lot of room to make D3D11 software run better and I love every minute of it.)

If this were a D3D9, D3D11, GL or Vulkan game I could easily whip up an AF override mod. But I’m just now getting my sea legs in D3D12 :stuck_out_tongue: Ask again in a few months and I just may have such a feature, but that obviously isn’t going to help anyone trying to play the game while it’s relevant :slight_smile:

1 Like

on that note, shoudn’t that be done on the first gameplay load of the game? Like this:

  1. The game has no 3D intro at all, or only compile the shaders necessary for it.
  2. You enter the main menu and choose your desired settings.
  3. On the start of gameplay, if lack shaders compile cache or change of settings, compile everything.

I’m getting awful stuttering but i’m in Meridian right now. It was workable but then started crashing.

I was K’s recent post about the driver-forced filtering… is this correct? image

Also, how is my config?

Summary

[API.Hook]

LastKnown=64

d3d11=false

d3d12=true

d3d9=false

d3d9ex=false

OpenGL=false

Vulkan=false

[Macro.FPS]

Ctrl+Shift+1=TargetFPS 60

Ctrl+Shift+2=TargetFPS 45

Ctrl+Shift+3=TargetFPS 30

Ctrl+Shift+0=TargetFPS 0

[Window.System]

Borderless=true

Center=true

RenderInBackground=true

Fullscreen=true

OverrideRes=1920x1080

MuteInBackground=false

XOffset=0.0%

YOffset=0.0%

ConfineCursor=false

UnconfineCursor=false

PersistentDragPos=false

FixMouseCoords=false

AlwaysOnTop=0

DisableScreensaver=false

DontHookWndProc=false

[Render.FrameRate]

TargetFPS=45.0

SleeplessRenderThread=true

SleeplessWindowThread=true

PreRenderLimit=3

BackBufferCount=2

PresentationInterval=-1

BackgroundFPS=0.0

LimiterTolerance=2.0

EnableMMCSS=true

MaxBusyWaitPercent=0.825

WaitForVBLANK=false

RescanRatio=-1/1

RefreshRate=-1.0

[SpecialK.System]

EnableCEGUI=false

ShowEULA=false

Silent=false

LogLevel=0

IgnoreRTSSHookDelay=false

UseCrashHandler=true

GameOutput=true

SafeInitCEGUI=true

TraceLoadLibrary=true

StrictCompliant=false

Version=0.11.0.45

[Display.Output]

ForceWindowed=true

ForceFullscreen=false

[Render.DXGI]

UseFlipDiscard=true

AllowTearingInDWM=true

SwapChainWait=66

MaxDeltaTime=0

DisableFlipModel=false

AdaptiveTearing=false

MaxRes=0x0

MinRes=0x0

Scaling=DontCare

ScanlineOrder=DontCare

ExceptionMode=DontCare

EnableDebugLayer=false

SafeFullscreenMode=false

Use64BitDepthStencil=false

IsolateD3D11DeferredContexts=false

SkipSwapChainPresentTest=false

OverrideMSAA=-1

[SpecialK.HDR]

scRGBLuminance_[0]=1.0

scRGBGamma_[0]=1.0

InputColorSpace_[0]=1

OutputColorSpace_[0]=0

scRGBLuminance_[1]=1.0

scRGBGamma_[1]=1.0

InputColorSpace_[1]=1

OutputColorSpace_[1]=0

scRGBLuminance_[2]=1.0

scRGBGamma_[2]=1.0

InputColorSpace_[2]=1

OutputColorSpace_[2]=0

scRGBLuminance_[3]=1.0

scRGBGamma_[3]=1.0

InputColorSpace_[3]=1

OutputColorSpace_[3]=0

Use10BitSwapChain=false

Use16BitSwapChain=false

Promote8BitRTsTo16=false

Promote10BitRTsTo16=true

Promote11BitRTsTo16=true

AllowFullLuminance=false

Preset=0

[HDR.Presets]

Activate0=F1

Activate1=F2

Activate2=F3

Activate3=F4

[Compatibility.General]

DisableBloatWare_NVIDIA=false

RehookLoadLibrary=false

[ImGui.Render]

DisableAlpha=false

AntialiasLines=true

AntialiasContours=true

[NVIDIA.API]

DisableHDR=false

Disable=false

[NVIDIA.Bugs]

AnselSleepsWithFishes=true

[Input.Keyboard]

CatchAltF4=true

DisabledToGame=false

[Input.Mouse]

DisabledToGame=false

[Input.Cursor]

Manage=false

KeyboardActivates=true

Timeout=1.5

ForceCaptureInUI=false

UseHardwareCursor=true

BlockInvisibleCursorInput=false

NoWarpUI=true

NoWarpVisibleGameCursor=true

FixSynapticsTouchpadScroll=false

AntiwarpDeadzonePercent=2.5

UseRelativeInput=true

[Input.Gamepad]

DisabledToGame=false

DisablePS4HID=false

AllowHapticUI=true

DisableRumble=false

[Input.XInput]

Rehook=false

PlaceholderMask=0

UISlot=0

SlotReassignment=0,1,2,3

[Input.Steam]

UISlot=0

[Threads.Analyze]

MemoryAllocation=false

FileActivity=false

[FrameRate.Control]

MaxRenderAheadFrames=0

OverrideCPUCoreCount=-1

[Textures.D3D11]

Cache=true

PreciseHash=false

Inject=true

InjectionKeepsFormat=false

GenerateMipmaps=false

[Textures.Cache]

MaxEntries=65536

MinEntries=512

MaxEvict=1024

MinEvict=64

MaxSizeInMiB=2048

MinSizeInMiB=384

IgnoreNonMipmapped=false

AllowStaging=false

AllowUnsafeRefCounting=false

ManageResidency=false

[Render.OSD]

ShowInVideoCapture=true

HDRLuminance=4.375

[Textures.General]

ResourceRoot=SK_Res

DumpOnFirstLoad=false

[DPI.Scaling]

Disable=false

PerMonitorAware=false

MonitorAwareOnAllThreads=false

[Steam.Achievements]

SoundFile=

[Steam.System]

AppID=0

AutoInitDelay=0

AutoPumpCallbacks=true

BlockUserStatsCallback=false

FilterExternalDataFromCallbacks=false

PreLoadSteamClient=false

PreLoadSteamOverlay=false

ForceLoadSteamAPI=false

AutoInjectSteamAPI=true

NotifyCorner=DontCare

ReuseOverlayPause=true

SteamPipeDLL=

CallbackThrottle=-1

[Steam.Social]

OnlineStatus=-1

[Steam.Log]

Silent=false

[Steam.DRMWorks]

SpoofBLoggedOn=false

[Steam.Screenshots]

EnableSmartCapture=true

[AMD.ADL]

Disable=false

Sure, and some games do. Other games does it when you go to apply the graphics settings, for example.

Where they position it is not really important as long as it’s done before scenes actually gets rendered.

For Horizon: Zero Dawn, for example, you have a built-in benchmark that can be used without actually starting a game – meaning shaders needs to be compiled before that can be started.

To get proper Force AF it needs to be 16x for maximum quality.