Skip to content

Commit

Permalink
[d3d8] Tidy up D3DDEVINFO_VCACHE handling
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpyneDreams committed Jul 7, 2024
1 parent 8a18e13 commit 2a74707
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 8 additions & 2 deletions src/d3d8/d3d8_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,18 @@ namespace dxvk {
// on modern native AMD drivers and D3D8-era native ATI drivers.
res = GetD3D9()->CreateQuery(d3d9::D3DQUERYTYPE_VCACHE, &pQuery);

struct D3DDEVINFO_VCACHE {
DWORD Pattern;
DWORD OptMethod;
DWORD CacheSize;
DWORD MagicNumber;
};

if(FAILED(res)) {
if (DevInfoStructSize != sizeof(D3DDEVINFO_VCACHE))
return D3DERR_INVALIDCALL;

D3DDEVINFO_VCACHE vCacheDevInfo = {0};
memcpy(pDevInfoStruct, &vCacheDevInfo, DevInfoStructSize);
memset(pDevInfoStruct, 0, std::min(size_t(DevInfoStructSize), sizeof(D3DDEVINFO_VCACHE)));
return S_FALSE;
}

Expand Down
7 changes: 0 additions & 7 deletions src/d3d8/d3d8_include.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,6 @@ namespace d3d9 {
#define D3DDEVINFOID_VCACHE 4
#endif

typedef struct D3DDEVINFO_VCACHE {
DWORD Pattern;
DWORD OptMethod;
DWORD CacheSize;
DWORD MagicNumber;
} D3DDEVINFO_VCACHE;

// MinGW headers are broken. Who'dve guessed?
#ifndef _MSC_VER

Expand Down

0 comments on commit 2a74707

Please sign in to comment.