Skip to content

Commit 591929e

Browse files
committed
Include entry layer name in PTX cache key
Signed-off-by: Chris Hellmuth <chellmuth@gmail.com>
1 parent c48d717 commit 591929e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/liboslexec/instance.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -857,10 +857,14 @@ ShaderGroup::generate_optix_cache_key(string_view code)
857857
safegroup = Strutil::replace(name(), "/", "_", true);
858858
safegroup = Strutil::replace(safegroup, ":", "_", true);
859859

860-
// Cache key includes the groupname in addition to the serialized IR.
861-
// This is because the groupname makes its way into the ptx's direct callable name,
862-
// but isn't included in the serialization.
863-
std::string cache_key = fmtformat("cache-osl-ptx-{}-{}", safegroup, ir_key);
860+
ShaderInstance* inst = layer(nlayers() - 1);
861+
ustring layername = inst->layername();
862+
863+
// Cache key includes group and entry layer names in addition to the serialized IR.
864+
// This is because the group and layer names make their way into the ptx's
865+
// direct callable name, but isn't included in the serialization.
866+
std::string cache_key = fmtformat("cache-osl-ptx-{}-{}-{}", safegroup,
867+
layername, ir_key);
864868

865869
m_optix_cache_key = cache_key;
866870
}

0 commit comments

Comments
 (0)