AlpyneDreams / d8vk

Direct3D 8 to Vulkan translation for DXVK! Merged into dxvk: https://github.com/doitsujin/dxvk
zlib License
486 stars 6 forks source link

[d3d8] Return S_FALSE if VCache queries are unsupported #212

Closed WinterSnowfall closed 2 days ago

WinterSnowfall commented 1 month ago

Related to https://github.com/doitsujin/dxvk/pull/4020. While testing the behavior on native platforms, I uncovered the fact that native drivers actually adhered to spec and returned S_FALSE when VCache queries are unsupported.

Additionally, both modern AMD drivers and ATI native drivers of old (on WinXP) zero out the return struct:

Listing VCache query result:
  ~ Response: S_FALSE
  ~ Pattern: 0
  ~ OptMethod: 0
  ~ CacheSize: 0
  ~ MagicNumber: 0

The behavior on Nvidia is correct and we should be inline with what d3d9 returns.

I'm not entirely sure if I've implemented this correctly, but I rather added the D3DDEVINFO_VCACHE struct declaration to our headers than messing about with D3D9Types.h. Let me know if that's a problem.

WinterSnowfall commented 3 weeks ago

I've moved the definition of D3DDEVINFO_VCACHE as part of d3d8_include.h, since AFAIU it should be included in d3d8.h (but MinGW doesn't seem to provide it). @AlpyneDreams In case MSVC has it, let me know, and we can gate it behind an ifdef.