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

@@ -137,11 +137,6 @@ MetalDevice::~MetalDevice()
Assert(m_device == nil);
}
RenderAPI MetalDevice::GetRenderAPI() const
{
return RenderAPI::Metal;
}
bool MetalDevice::HasSurface() const
{
return (m_layer != nil);
@@ -234,6 +229,8 @@ bool MetalDevice::CreateDevice(std::string_view adapter, std::optional<bool> exc
void MetalDevice::SetFeatures(FeatureMask disabled_features)
{
m_render_api = RenderAPI::Metal;
m_render_api_version = 100; // TODO: Make this more meaningful.
m_max_texture_size = GetMetalMaxTextureSize(m_device);
m_max_multisamples = GetMetalMaxMultisamples(m_device);