LIBDXCOMPILER.SO:(1)

πŸ“¦ version 1.9.2602, in ubuntu stonking

πŸ¦‹ libdxcompiler.so: β€” DirectX Shader Compiler πŸ¦‹

okay so bestie, this whole thing comes from the User Commands section of the manual, page 1 β€” aka LIBDXCOMPILER.SO:(1) ✨ it's the DirectX Shader Compiler and she is lowkey iconic πŸ’…

πŸ’– NAME πŸ’–

libdxcompiler.so: β€” DirectX Shader Compiler

🌸 DESCRIPTION 🌸

OVERVIEW: HLSL Compiler for Linux

Version: libdxcompiler.so: 1.9(0-00000000)(1.9.2602.0)

USAGE:

dxc.exe [options] <inputs>

✨ Common Options ✨

  • -help β€” spills all the available options, the whole tea β˜•
  • -Qunused-arguments β€” don't throw a warning at us for unused driver arguments, we're not gonna snitch
  • --version β€” shows off the compiler version info πŸŽ€

πŸŽ€ Compilation Options πŸŽ€

  • -all-resources-bound β€” turns on agressive flattening
  • -auto-binding-space <value> β€” sets the auto binding space; this is what enables auto resource binding in libraries
  • -Cc β€” output color coded assembly listings 🌈
  • -default-linkage <value> β€” sets the default linkage for non-shader functions when you're compiling or linking to a library target (values: internal, external)
  • -denorm <value> β€” picks your denormal value options (any, preserve, ftz). any is the default fr
  • -disable-payload-qualifiers β€” turns OFF support for payload access qualifiers for raytracing payloads in SM 6.7
  • -D <value> β€” define a macro
  • -enable-16bit-types β€” enables 16bit types and disables min precision types. available in HLSL 2018 and shader model 6.2
  • -enable-lifetime-markers β€” enables generation of lifetime markers
  • -enable-payload-qualifiers β€” turns ON support for payload access qualifiers for raytracing payloads in SM 6.6
  • -encoding <value> β€” sets the default encoding for source inputs and text outputs (utf8|utf16(win)|utf32(*nix)|wide), default is utf8
  • -export-shaders-only β€” only export shaders when compiling a library
  • -exports <value> β€” specify exports when compiling a library, like: export1[[,export1_clone,...]=internal_name][;...]
  • -E <value> β€” the entry point name
  • -Fc <file> β€” output that assembly code listing file
  • -fdiagnostics-format=<value> β€” select your diagnostic message format. supported values: clang, msvc, mdvc-fallback, vi
  • -fdiagnostics-show-option β€” print the option name alongside mappable diagnostics
  • -fdisable-loc-tracking β€” disables source location tracking in IR. ⚠️ heads up: this will break diagnostic generation for late validation. (it gets ignored if /Zi is passed)
  • -Fd <file> β€” write debug information to the given file, or to an automatically named file in a directory when the name ends in \
  • -Fe <file> β€” send warnings and errors to the given file
  • -Fh <file> β€” output a header file containing object code
  • -Fi <file> β€” set the preprocess output file name (used with /P)
  • -flegacy-macro-expansion β€” expand the operands before doing the token-pasting operation (aka that fxc behavior)
  • -flegacy-resource-reservation β€” reserve unused explicit register assignments for compatibility with shader model 5.0 and below
  • -fnew-inlining-behavior β€” πŸ§ͺ experimental option to use heuristics-driven late inlining and disable the alwaysinline annotation for library shaders
  • -fno-diagnostics-show-option β€” do NOT print the option name with mappable diagnostics
  • -force-rootsig-ver <profile> β€” force that root signature version (rootsig_1_1 if omitted)
  • -Fo <file> β€” output object file
  • -Fre <file> β€” output reflection to the given file
  • -Frs <file> β€” output root signature to the given file
  • -Fsh <file> β€” output shader hash to the given file
  • -ftime-report β€” print a time report ⏱️
  • -ftime-trace-granularity=<value> β€” minimum time granularity (in microseconds) traced by the time profiler
  • -ftime-trace=<value> β€” print hierchial time tracing to a file
  • -ftime-trace β€” print hierchial time tracing to stdout
  • -Gec β€” enable backward compatibility mode
  • -Ges β€” enable strict mode
  • -Gfa β€” avoid flow control constructs
  • -Gfp β€” prefer flow control constructs
  • -Gis β€” force IEEE strictness
  • -HV <value> β€” HLSL version (2016, 2017, 2018, 2021). default is 2021
  • -H β€” show header includes and nesting depth
  • -ignore-line-directives β€” ignore line directives
  • -I <value> β€” add a directory to the include search path
  • -Lx β€” output hexadecimal literals
  • -Ni β€” output instruction numbers in assembly listings
  • -no-warnings β€” suppress warnings 🀫
  • -No β€” output instruction byte offsets in assembly listings
  • -Odump β€” print the optimizer commands.
  • -Od β€” disable optimizations
  • -pack-optimized β€” optimize signature packing assuming an identical signature is provided for each connecting stage
  • -pack-prefix-stable β€” (default) pack signatures preserving the prefix-stable property β€” appended elements will not disturb the placement of prior elements
  • -recompile β€” recompile from a DXIL container with Debug Info or a Debug Info bitcode file
  • -res-may-alias β€” assume that UAVs/SRVs may alias
  • -rootsig-define <value> β€” read the root signature from a #define
  • -T <profile> β€” set the target profile. here's the whole menu, bestie:
<profile>: ps_6_0, ps_6_1, ps_6_2, ps_6_3, ps_6_4, ps_6_5, ps_6_6, ps_6_7, ps_6_8, ps_6_9,

vs_6_0, vs_6_1, vs_6_2, vs_6_3, vs_6_4, vs_6_5, vs_6_6, vs_6_7, vs_6_8, vs_6_9, gs_6_0, gs_6_1, gs_6_2, gs_6_3, gs_6_4, gs_6_5, gs_6_6, gs_6_7, gs_6_8, gs_6_9, hs_6_0, hs_6_1, hs_6_2, hs_6_3, hs_6_4, hs_6_5, hs_6_6, hs_6_7, hs_6_8, hs_6_9, ds_6_0, ds_6_1, ds_6_2, ds_6_3, ds_6_4, ds_6_5, ds_6_6, ds_6_7, ds_6_8, ds_6_9, cs_6_0, cs_6_1, cs_6_2, cs_6_3, cs_6_4, cs_6_5, cs_6_6, cs_6_7, cs_6_8, cs_6_9, lib_6_1, lib_6_2, lib_6_3, lib_6_4, lib_6_5, lib_6_6, lib_6_7, lib_6_8, lib_6_9, ms_6_5, ms_6_6, ms_6_7, ms_6_8, ms_6_9, as_6_5, as_6_6, as_6_7, as_6_8, as_6_9,
  • -Vd β€” disable validation
  • -verbose β€” allow emission of verbose compiler information
  • -verify<value> β€” verify diagnostic output using comment directives
  • -Vi β€” display details about the include process.
  • -Vn <name> β€” use <name> as the variable name in the header file
  • -v β€” alias for -verbose
  • -WX β€” treat warnings as errors 😀
  • -Zi β€” enable debug information. cannot be used together with -Zs
  • -Zpc β€” pack matrices in column-major order
  • -Zpr β€” pack matrices in row-major order
  • -Zsb β€” compute Shader Hash considering only the output binary
  • -Zss β€” compute Shader Hash considering source information
  • -Zs β€” generate a small PDB with just sources and compile options. cannot be used together with -Zi

🌟 OPTIONS 🌟

  • -MD β€” write a file with a .d extension that will hold the list of compilation target dependencies.
  • -MF <file> β€” write the specfied file that will hold the list of compilation target dependencies.
  • -M β€” dumps the list of compilation target dependencies.

πŸ”₯ Optimization Options πŸ”₯

  • -ffinite-math-only β€” allow optimizations for floating-point arithmetic that assume arguments and results are not NaNs or +-Infs.
  • -fno-finite-math-only β€” disallow optimizations for floating-point arithmetic that assume arguments and results are not NaNs or +-Infs.
  • -O0 β€” Optimization Level 0
  • -O1 β€” Optimization Level 1
  • -O2 β€” Optimization Level 2
  • -O3 β€” Optimization Level 3 (Default)

🧚 Rewriter Options 🧚

  • -decl-global-cb β€” collect all global constants outside cbuffer declarations into cbuffer GlobalCB { ... }. still experimental πŸ§ͺ, not all dependency scenarios are handled.
  • -extract-entry-uniforms β€” move uniform parameters from the entry point to global scope
  • -global-extern-by-default β€” set extern on non-static globals
  • -keep-user-macro β€” write out user defines after the rewritten HLSL
  • -line-directive β€” add line directive
  • -remove-unused-functions β€” remove unused functions and types
  • -remove-unused-globals β€” remove unused static globals and functions
  • -skip-fn-body β€” translate function definitions to declarations
  • -skip-static β€” remove static functions and globals when used with -skip-fn-body
  • -unchanged β€” rewrite HLSL, without changes. (she's just standing there, menacingly βœ‹)

πŸ’œ SPIR-V CodeGen Options πŸ’œ

  • -fspv-debug=<value> β€” specify a whitelist of debug info category (file -> source -> line, tool, vulkan-with-source)
  • -fspv-enable-maximal-reconvergence β€” enables the MaximallyReconvergesKHR execution mode for this module.
  • -fspv-entrypoint-name=<value> β€” specify the SPIR-V entry point name. defaults to the HLSL entry point name.
  • -fspv-extension=<value> β€” specify a SPIR-V extension permitted to use
  • -fspv-flatten-resource-arrays β€” flatten arrays of resources so each array element takes one binding number
  • -fspv-max-id <shift> <space> β€” set the maximum value for an id in the SPIR-V binary. default is 0x3FFFFF, which is the largest value all drivers must support.
  • -fspv-preserve-bindings β€” preserves all bindings declared within the module, even when those bindings are unused
  • -fspv-preserve-interface β€” preserves all interface variables in the entry point, even when those variables are unused
  • -fspv-print-all β€” print the SPIR-V module before each pass and after the last one. so useful for debugging SPIR-V legalization and optimization passes πŸ›
  • -fspv-reduce-load-size β€” replaces loads of composite objects to reduce memory pressure for the loads
  • -fspv-reflect β€” emit additional SPIR-V instructions to aid reflection
  • -fspv-target-env=<value> β€” specify the target environment: vulkan1.0 (default), vulkan1.1, vulkan1.1spirv1.4, vulkan1.2, vulkan1.3, or universal1.5
  • -fspv-use-legacy-buffer-matrix-order β€” assume the legacy matrix order (row major) when accessing raw buffers (e.g., ByteAdddressBuffer)
  • -fspv-use-unknown-image-format β€” for storage images and texel buffers, sets the default format to 'Unknown' when not specified via the vk::image_format attribute. if you don't use this option, the format gets inferred from the resource's data type.
  • -fspv-use-vulkan-memory-model β€” generates SPIR-V modules that use the Vulkan memory model instead of GLSL450.
  • -fvk-auto-shift-bindings β€” apply fvk-*-shift to resources without an explicit register assignment.
  • -fvk-b-shift <shift> <space> β€” specify the Vulkan binding number shift for a b-type register
  • -fvk-bind-counter-heap <binding> <set> β€” specify the Vulkan binding number and set number for the counter heap.

okay bestie we are SO not done yet β€” hold that thought, because part 2 is right there waiting for you πŸ’…βœ¨

okay so we're still in the option list bestie, no we're not stopping, we're gonna finish her πŸ’ͺ continuing right where we left off:

  • -fvk-bind-globals <binding> <set> β€” sets the Vulkan binding number and the set number for the $Globals cbuffer. two numbers, one job πŸŽ€
  • -fvk-bind-register <type-number> <space> <binding> <set> β€” wanna pin down the Vulkan descriptor set and binding for one specific register? this is the one. it eats four things: type-number, space, binding, set. count them or perish 😭
  • -fvk-bind-resource-heap <binding> <set> β€” Vulkan binding number + set number for the resource heap ✨
  • -fvk-bind-sampler-heap <binding> <set> β€” same deal but for the sampler heap πŸŽ€
  • -fvk-invert-y β€” flips SV_Position.y (negates it, bestie) before it gets written to stage output in VS/DS/GS/MS/Lib, so Vulkan's coordinate system stops being weird about it πŸ™ƒ
  • -fvk-s-shift <shift> <space> β€” the Vulkan binding number shift for s-type registers πŸ’…
  • -fvk-support-nonzero-base-instance β€” follows the Vulkan spec and uses gl_BaseInstance as the first vertex instance, so SV_InstanceID = gl_InstanceIndex - gl_BaseInstance. and no, without this option it's just SV_InstanceID = gl_InstanceIndex. that difference? iconic 🫢
  • -fvk-support-nonzero-base-vertex β€” same vibe for vertices: follows the Vulkan spec, uses gl_BaseVertex as the first vertex, making SV_VertexID = gl_VertexIndex - gl_BaseVertex. without it? SV_VertexID = gl_VertexIndex. periodt πŸ’œ
  • -fvk-t-shift <shift> <space> β€” Vulkan binding number shift for t-type registers ✨
  • -fvk-u-shift <shift> <space> β€” and for u-type registers too, we love a matching set 🌸
  • -fvk-use-dx-layout β€” DirectX memory layout for your Vulkan resources. we're doing it DX style 😎
  • -fvk-use-dx-position-w β€” reciprocates SV_Position.w after reading from stage input in PS, fixing up the whole Vulkan-vs-DirectX situation πŸ”₯
  • -fvk-use-gl-layout β€” strict OpenGL std140/std430 memory layout for Vulkan resources. strict! she said what she said πŸ’…
  • -fvk-use-scalar-layout β€” scalar memory layout for Vulkan resources. simple, clean, main character energy ✨
  • -metal β€” generates Metal code 🍎
  • -Oconfig=<value> β€” takes a comma-separated list of SPIRV-Tools passes so you can customise the optimization configuration. the docs live at http://khr.io/hlsl2spirv#optimization if you wanna read up πŸ“–
  • -spirv β€” generates SPIR-V code πŸ’«

✨ Utility Options ✨ (the little helpers, the sidekicks, the icons)

  • -dumpbin β€” loads a binary file instead of compiling. like, just look at it. no compiling today πŸ’€
  • -extractrootsignature β€” pulls the root signature out of shader bytecode. ⚠️ must be used with /Fo <file>, okay? required, not optional πŸ™ˆ
  • -getprivate <file> β€” saves the private data from a shader blob πŸŽ€
  • -link β€” links the list of libraries you handed over in the <inputs> argument, separated by ';' πŸ”—
  • -P β€” preprocess to file πŸ“„
  • -Qembed_debug β€” embeds the PDB inside the shader container. ⚠️ must be used with /Zi 🌸
  • -Qsource_in_debug_module β€” embeds the source code inside the PDB 🫢
  • -Qstrip_debug β€” strips the debug info out of 4_0+ shader bytecode. ⚠️ must be used with /Fo <file> πŸ’…
  • -Qstrip_priv β€” strips the private data out of shader bytecode. ⚠️ also must be used with /Fo <file> 🌈
  • -Qstrip_reflect β€” strips the reflection data out of shader bytecode. ⚠️ yep, must be used with /Fo <file> ⭐
  • -Qstrip_rootsignature β€” strips the root signature data out of shader bytecode. ⚠️ must be used with /Fo <file> πŸ”₯
  • -setprivate <file> β€” the private data you want added to the compiled shader blob πŸ’œ
  • -setrootsignature <file> β€” attaches a root signature to shader bytecode πŸŽ€
  • -verifyrootsignature <file> β€” verifies shader bytecode against a root signature. vibe check but for your root signature βœ…

⚠️ Warning Options ⚠️

  • -W[no-]<warning> β€” enables or disables the warning you name. slap a no- in there and it's off instead of on. so -W<warning> turns it on, -Wno-<warning> turns it off πŸ’…

🌈 SEE ALSO 🌈

the full documentation for libdxcompiler.so: lives as a Texinfo manual, bestie. so if info and the libdxcompiler.so: programs are properly installed on your system, then this:

info libdxcompiler.so:

is gonna hand you the entire complete manual 🫢 go get it.


and that's the whole page, we did it, we actually did it 😭 this was libdxcompiler.so: version 1.9(0-0000000..., dated March 2026 β€” LIBDXCOMPILER.SO:(1) fr fr. love u, go compile something gorgeous, mwah πŸ’–βœ¨πŸ’…

πŸ“¦ where this page comes from