dxvk-remix icon indicating copy to clipboard operation
dxvk-remix copied to clipboard

Use a precompiled header in dxvk and d3d9 subprojects

Open Nukem9 opened this issue 1 year ago • 3 comments

Preface: Shoving dxvk_device.h into a precompiled header is my last-ditch effort to get Visual Studio's intellisense working properly. I do not expect this PR to be merged as-is, if at all. These are just my observations since I figured it'd be worth investigating and maybe worth some input.

Pros:

  • In my opinion, intellisense now works to an acceptable degree.
  • Fresh builds using build_dxvk_all_ninja.ps1 are reduced from 11 minutes to roughly 4 minutes (local machine).
  • Fresh release builds using the VS solution are reduced from 4 minutes to roughly 1 minute (local machine).

Cons:

  • Intellisense still occasionally trips up and freezes when opening many files.
  • Virtually no benefits with incremental builds.
  • Implicit includes are fragile in the long run and obfuscate real dependencies. The changes in rtx_ngx_wrapper.cpp are one example of this.
  • Changes to dxvk_device.h and dependent headers are amplified. It's now part of ~200 translation units, up from ~100.

It seems like a combination of transitive USD includes and hundreds of macros/templates in remix cause intellisense to break down. Death by a thousand cuts with no simple fix.

Nukem9 avatar Jun 05 '24 22:06 Nukem9

Thanks for sending this out. PCH support has been on my list of nice things to do sometime, since we know we're leaving some compile time on the table overall.

I'm not sure I understand the Intellisense problems. Can you clarify what you're running into? Is it just slow, or is it failing to find sources or something like that?

nsubtil avatar Jun 06 '24 17:06 nsubtil

REMIX-3140 for tracking

NV-LL avatar Jun 06 '24 19:06 NV-LL

I'm not sure I understand the Intellisense problems. Can you clarify what you're running into? Is it just slow, or is it failing to find sources or something like that?

Ah, yeah. Overall intellisense seems to behave correctly. It slows to a crawl and becomes unusable after several minutes of editing/browsing code in remix's VS solution. There's a few symptoms: syntax highlighting and autocompletion lag behind (30s+) or never show up, go to definition never resolves, find symbol never resolves, cl.exe pins one CPU core at 100% in the background. Restarting VS alleviates these for a short time.

I've seen this brought up in RTX Remix Showcase on 2-3 occasions but I don't exactly think it's pervasive.

Nukem9 avatar Jun 06 '24 21:06 Nukem9