[llvm] [HLSL] Leave out entryname from string table for PSV versions < 3 (PR #191528)

Tex Riddell via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 22 17:59:36 PDT 2026


================
@@ -770,8 +770,11 @@ void DXContainerYAML::PSVInfo::mapInfoForVersion(yaml::IO &IO) {
   IO.mapRequired("NumThreadsY", Info.NumThreadsY);
   IO.mapRequired("NumThreadsZ", Info.NumThreadsZ);
 
-  if (Version == 2)
+  if (Version == 2) {
+    if (!IO.outputting())
+      IO.mapOptional("EntryName", EntryName);
----------------
tex3d wrote:

Why wouldn't we want obj2yaml to recognize fields from all versions? For one, isn't it essentially a tool for use in tests? For another, an overall version isn't encoded in the data format because of the way records are independently extended to add fields in newer versions and record sizes in the PSV0 data indicate each record version independently. The idea is that a consumer can read up to the size of records it knows about, and ignore the rest, allowing it to read the common data in the older version from a newer version of the serialized record.

The reason for the overall version number is because the DXIL validator can't validate newer versions than what it recognizes. As long as the validator is external to the compiler, the compiler needs to initialize a validator version that matches the version that will be used to validate the container, then make sure it writes only the appropriate version of the records to the PSV0 part, so the validator can recognize and validate that whole part.

But for the purpose of obj2yaml and yaml2obj, I don't see why you couldn't recognize fields for all versions in the yaml, and then only write appropriate versioned records to the binary based on the selected version, omitting fields specified in the yaml from the binary if the version you're writing doesn't contain them.

https://github.com/llvm/llvm-project/pull/191528


More information about the llvm-commits mailing list