mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
AMD drivers reject system memory surfaces that are larger than the maximum texture width/height supported by the driver (usually 4096x4096 for AMD). This can cause issues in games that create larger system memory surfaces. This workaround crops the driver resource dimensions to the allowed maximum values and handles blitting outside this region by creating a temporary resource that maps to the actual affected system memory region. Fixes crashes with AMD drivers in Rainbow Six games and Desperados, mentioned in issue #2 and #8.
25 lines
564 B
C++
25 lines
564 B
C++
#pragma once
|
|
|
|
#define CINTERFACE
|
|
|
|
#include <d3d.h>
|
|
#include <d3dumddi.h>
|
|
#include <d3dnthal.h>
|
|
|
|
#include "Common/CompatVtable.h"
|
|
#include "D3dDdi/Log/AdapterFuncsLog.h"
|
|
#include "D3dDdi/Visitors/AdapterFuncsVisitor.h"
|
|
|
|
namespace D3dDdi
|
|
{
|
|
class AdapterFuncs : public CompatVtable<D3DDDI_ADAPTERFUNCS>
|
|
{
|
|
public:
|
|
static const D3DNTHAL_D3DEXTENDEDCAPS& getD3dExtendedCaps(HANDLE adapter);
|
|
static void onOpenAdapter(HANDLE adapter);
|
|
static void setCompatVtable(D3DDDI_ADAPTERFUNCS& vtable);
|
|
};
|
|
}
|
|
|
|
SET_COMPAT_VTABLE(D3DDDI_ADAPTERFUNCS, D3dDdi::AdapterFuncs);
|