GPUDevice: Add API version field

Also tie shader caches to API version and device LUID. That way we don't
have tons of cache files, and they're regenerated if the GPU/driver
changes.
This commit is contained in:
Stenzek
2024-09-08 23:33:05 +10:00
parent c42fb7c16e
commit 4c31218d2b
23 changed files with 222 additions and 195 deletions

View File

@ -25,8 +25,10 @@ struct DXGI_MODE_DESC;
namespace D3DCommon {
// returns string representation of feature level
const char* GetFeatureLevelString(D3D_FEATURE_LEVEL feature_level);
const char* GetFeatureLevelShaderModelString(D3D_FEATURE_LEVEL feature_level);
const char* GetFeatureLevelString(u32 render_api_version);
u32 GetRenderAPIVersionForFeatureLevel(D3D_FEATURE_LEVEL feature_level);
D3D_FEATURE_LEVEL GetFeatureLevelForNumber(u32 render_api_version);
u32 GetShaderModelForFeatureLevelNumber(u32 render_api_version);
// returns max feature level of a device
D3D_FEATURE_LEVEL GetDeviceMaxFeatureLevel(IDXGIAdapter1* adapter);
@ -57,8 +59,6 @@ std::string GetAdapterName(IDXGIAdapter1* adapter);
// returns the driver version from the registry as a string
std::string GetDriverVersionFromLUID(const LUID& luid);
u32 GetShaderModelForFeatureLevel(D3D_FEATURE_LEVEL feature_level);
std::optional<DynamicHeapArray<u8>> CompileShader(u32 shader_model, bool debug_device, GPUShaderStage stage,
std::string_view source, const char* entry_point, Error* error);