MCPcopy Create free account
hub / github.com/TheRealMJP/Shadows / MakeShaderCacheName

Function MakeShaderCacheName

Shadows/SampleFramework11/ShaderCompilation.cpp:101–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101static wstring MakeShaderCacheName(const std::string& shaderCode, const char* functionName,
102 const char* profile, const D3D_SHADER_MACRO* defines)
103{
104 string hashString = shaderCode;
105 hashString += "\n";
106 hashString += functionName;
107 hashString += "\n";
108 hashString += profile;
109 hashString += "\n";
110
111 hashString += MakeDefinesString(defines);
112
113 Hash codeHash = GenerateHash(hashString.data(), int(hashString.length()), 0);
114
115 return cacheDir + codeHash.ToString() + L".cache";
116}
117
118static ID3DBlob* CompileShader(const wchar* path, const char* functionName, const char* profile,
119 const D3D_SHADER_MACRO* defines, bool forceOptimization,

Callers 1

CompileShaderFunction · 0.85

Calls 3

MakeDefinesStringFunction · 0.85
GenerateHashFunction · 0.85
ToStringMethod · 0.80

Tested by

no test coverage detected