mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-07-18 01:41:02 +00:00
* Fix shader cache invalidation caused by struct padding memcmp * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Harshalj2108 <harshalj.2608@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -52,6 +52,8 @@ struct Profile {
|
||||
bool needs_unorm_fixup{};
|
||||
bool needs_clip_distance_emulation{};
|
||||
bool supports_shader_stencil_export{};
|
||||
|
||||
bool operator==(const Profile&) const = default;
|
||||
};
|
||||
|
||||
} // namespace Shader
|
||||
|
||||
@@ -313,7 +313,17 @@ void PipelineCache::WarmUp() {
|
||||
std::move(profile_data));
|
||||
return;
|
||||
}
|
||||
if (std::memcmp(profile_data.data(), &profile, sizeof(profile)) != 0) {
|
||||
if (profile_data.size() != sizeof(Shader::Profile)) {
|
||||
LOG_WARNING(Render,
|
||||
"Pipeline cache profile has unexpected size ({} != {}). Ignoring the cache",
|
||||
profile_data.size(), sizeof(Shader::Profile));
|
||||
Storage::DataBase::Instance().Close();
|
||||
return;
|
||||
}
|
||||
|
||||
Shader::Profile cached_profile{};
|
||||
std::memcpy(&cached_profile, profile_data.data(), sizeof(cached_profile));
|
||||
if (cached_profile != profile) {
|
||||
LOG_WARNING(Render,
|
||||
"Pipeline cache isn't compatible with current system. Ignoring the cache");
|
||||
Storage::DataBase::Instance().Close();
|
||||
|
||||
Reference in New Issue
Block a user