[vk] invalidate shader cache automatically if !=driverId or !=driverVersion (#4174)

this integrates neatly into the existing GraphicsPipelineKey system
no need for extra funcs :)

Signed-off-by: lizzie <lizzie@eden-emu.dev>

Co-authored-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4174
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
This commit is contained in:
lizzie
2026-07-07 19:57:45 +02:00
committed by crueter
parent fe1b8ff0ab
commit 1643d8766f
3 changed files with 10 additions and 1 deletions
@@ -56,6 +56,9 @@ void FixedPipelineState::Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFe
const Maxwell& regs = maxwell3d.regs;
const auto topology_ = maxwell3d.draw_manager.draw_state.topology;
driver_id = features.driver_id;
driver_version = features.driver_version;
raw1 = 0;
extended_dynamic_state.Assign(features.has_extended_dynamic_state ? 1 : 0);
extended_dynamic_state_2.Assign(features.has_extended_dynamic_state_2 ? 1 : 0);
@@ -21,6 +21,8 @@ namespace Vulkan {
using Maxwell = Tegra::Engines::Maxwell3D::Regs;
struct DynamicFeatures {
u32 driver_id;
u32 driver_version;
bool has_extended_dynamic_state;
bool has_extended_dynamic_state_2;
bool has_extended_dynamic_state_2_logic_op;
@@ -228,6 +230,8 @@ struct FixedPipelineState {
};
std::array<u8, Maxwell::NumRenderTargets> color_formats;
u32 driver_id;
u32 driver_version;
u32 alpha_test_ref;
u32 point_size;
@@ -62,7 +62,7 @@ using VideoCommon::FileEnvironment;
using VideoCommon::GenericEnvironment;
using VideoCommon::GraphicsEnvironment;
constexpr u32 CACHE_VERSION = 17;
constexpr u32 CACHE_VERSION = 18;
constexpr std::array<char, 8> VULKAN_CACHE_MAGIC_NUMBER{'y', 'u', 'z', 'u', 'v', 'k', 'c', 'h'};
template <typename Container>
@@ -479,6 +479,8 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_,
LOG_INFO(Render_Vulkan, "DynamicState setting value: {}", u32(Settings::values.dyna_state.GetValue()));
dynamic_features = {};
dynamic_features.driver_id = device.GetDriverID();
dynamic_features.driver_version = device.GetDriverVersion();
// User granularity enforced in vulkan_device.cpp switch statement:
// Level 0: Core Dynamic States only