shader_cache: Fix type deduction

This commit is contained in:
GPUCode
2022-11-06 21:41:57 +02:00
parent 009dfa5265
commit 479c7ed162

View File

@ -14,8 +14,7 @@ namespace Pica::Shader {
template <typename ShaderType> template <typename ShaderType>
using ShaderCacheResult = std::pair<ShaderType, std::optional<std::string>>; using ShaderCacheResult = std::pair<ShaderType, std::optional<std::string>>;
template <typename KeyType, typename ShaderType, auto ModuleCompiler, template <typename KeyType, typename ShaderType, auto ModuleCompiler, auto CodeGenerator>
auto (*CodeGenerator)(const KeyType&)>
class ShaderCache { class ShaderCache {
public: public:
ShaderCache() {} ShaderCache() {}
@ -51,9 +50,7 @@ public:
* program buffer from the previous shader, which is hashed into the config, resulting several * program buffer from the previous shader, which is hashed into the config, resulting several
* different config values from the same shader program. * different config values from the same shader program.
*/ */
template <typename KeyType, typename ShaderType, auto ModuleCompiler, template <typename KeyType, typename ShaderType, auto ModuleCompiler, auto CodeGenerator>
std::optional<std::string> (*CodeGenerator)(const Pica::Shader::ShaderSetup&,
const KeyType&)>
class ShaderDoubleCache { class ShaderDoubleCache {
public: public:
ShaderDoubleCache() = default; ShaderDoubleCache() = default;