Im’ trying to add support for nsight aftermath in my engine. As there is so many shader modules in the engine, I use aftermath’s hash function to name the shader binary and pdb, for conveniently locate and download the shader binary/pdb(offline generated and store in a server). Using GFSDK_Aftermath_GetShaderHash to generate the hash code, but unable to match the hash code in nsight graphics.
The NsightGraphics version i use is 2024.3.0.0, whith the aftermath sdk in this NsightGraphics. The aftermath dump and shader binary: aftermath_dump.zip (26.4 KB). The hash code I generated is ‘1BC4D85D4E9B3E2D’, but nsight show the shader’s hash code is
‘53E3EAA16D28F7CD’.
The code I used to generate the hash is:
std::string calcShaderHash(const std::string &shader_file)
{
std::ifstream cso_file(shader_file, std::ios::binary);
auto begin = cso_file.tellg();
cso_file.seekg(0, std::ios::end);
auto end = cso_file.tellg();
auto file_size = end - begin;
cso_file.seekg(0, std::ios::beg);
std::vector cso_data(file_size);
cso_file.read(cso_data.data(), file_size);
GFSDK_Aftermath_ShaderBinaryHash shaderHash = {};
const D3D12_SHADER_BYTECODE shader{ cso_data.data(), cso_data.size() };
GFSDK_Aftermath_Result aftermathRes = GFSDK_Aftermath_GetShaderHash(
GFSDK_Aftermath_Version_API,
&shader,
&shaderHash
);
assert(shaderHash.hash != 0x53E3EAA16D28F7CD);
// output hex hash
std::stringstream ss;
ss << std::hex << std::uppercase << shaderHash.hash;
return ss.str();
}
Hi wegatron,
Thank you for using Nsight Graphics & Aftermath SDK and providing your feedback. We are sorry for any inconvenience you have encountered. Can you explain your issue here? Why does the shader hash value need to match each other between Aftermath SDK and Nsight Graphics? Does it work after setting the folder
path to Nsight Graphics -> Options -> Search Paths
?
Thanks
An