This commit is contained in:
Fire Cube 2025-07-13 17:20:20 +02:00
parent 9195f59220
commit f9e199e1a0
3 changed files with 10 additions and 5 deletions

View File

@ -5,7 +5,10 @@
#include "common/types.h" #include "common/types.h"
template <typename T, typename U> [[nodiscard]] inline u64 HashCombine(const u64 seed, const u64 hash) {
T HashCombine(const T& seed, const U& value) { return seed ^ (hash + 0x9e3779b9 + (seed << 12) + (seed >> 4));
return seed ^ (static_cast<T>(value) + 0x9e3779b9 + (seed << 6) + (seed >> 2)); }
[[nodiscard]] inline u32 HashCombine(const u32 seed, const u32 hash) {
return seed ^ (hash + 0x9e3779b9 + (seed << 6) + (seed >> 2));
} }

View File

@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once #pragma once
#include <filesystem>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -569,7 +569,7 @@ PipelineCache::Result PipelineCache::GetProgram(Stage stage, LogicalStage l_stag
Shader::ShaderParams params, Shader::ShaderParams params,
Shader::Backend::Bindings& binding) { Shader::Backend::Bindings& binding) {
auto runtime_info = BuildRuntimeInfo(stage, l_stage); auto runtime_info = BuildRuntimeInfo(stage, l_stage);
auto [it_pgm, new_program] = program_cache.try_emplace(params.hash); // code in vs auto [it_pgm, new_program] = program_cache.try_emplace(params.hash);
if (new_program) { if (new_program) {
it_pgm.value() = std::make_unique<Program>(stage, l_stage, params); it_pgm.value() = std::make_unique<Program>(stage, l_stage, params);
auto& program = it_pgm.value(); auto& program = it_pgm.value();