Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disassemble SPIR-V via IDxcCompilerX::Disassemble? #5090

Closed
MarijnS95 opened this issue Mar 9, 2023 · 1 comment
Closed

Disassemble SPIR-V via IDxcCompilerX::Disassemble? #5090

MarijnS95 opened this issue Mar 9, 2023 · 1 comment
Labels
enhancement Feature suggestion spirv Work related to SPIR-V

Comments

@MarijnS95
Copy link
Contributor

MarijnS95 commented Mar 9, 2023

Backstory

Running dxc -spirv ... without -Fo for object output, or explicitly requesting a disassembly file with -Fc emits human-readable SPIR-V disassembly. However, it seems this functionality is only available in the dxc executable (and tracing it back to dxclib), but not in libdxcompiler.so.

Confusion/caveats

For one, it seems that CompileWithDebug does not output a debug ppDebugBlob/ppDebugBlobName (despite the _COM_Outptr_opt_/_Outptr_opt_result_z_ annotation stating that Parameter may be null, but in the post-state the pointed-to location can't be null and must be valid), and this data originates from DXC_OUT_PDB which is not in the returned IDxcResult for a SPIR-V compilation unit (SPIR-V doesn't define a separate debug/disassemble-able file/format).

(Then, I'm not sure about this, does Disassemble have enough data when a DXIL object is compiled with -Zi -Qembed_debug or does it require the full PDB here? It seems it cannot disassemble DXC_OUT_OBJECT output regardless of the flags, but may be lacking validation for example)

Goal/request

Since spirv_tools are already used in dxcompiler, would it be possible to move this functionality from dxclib to be reachable via the ::Disassemble APIs (and simply switch on the header magic), allowing dxcompiler to be used for SPIR-V disassembly in a more streamlined manner like DXIL?

@s-perron s-perron added the enhancement Feature suggestion label May 9, 2023
@sudonatalie sudonatalie added the spirv Work related to SPIR-V label Aug 9, 2023
@s-perron
Copy link
Collaborator

This is not something we will be supporting.

@s-perron s-perron closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2024
@github-project-automation github-project-automation bot moved this to Triaged in HLSL Triage Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature suggestion spirv Work related to SPIR-V
Projects
Archived in project
Development

No branches or pull requests

3 participants