LIBDXCOMPILER.SO:(1)
π¦ 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).anyis 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 isutf8-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/Ziis 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 thatfxcbehavior)-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 thealwaysinlineannotation 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_1if 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 tostdout-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 is2021-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.dextension 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 intocbuffer 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β setexternon 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 theMaximallyReconvergesKHRexecution 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 is0x3FFFFF, 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, oruniversal1.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 thevk::image_formatattribute. 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β applyfvk-*-shiftto 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$Globalscbuffer. 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β flipsSV_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 fors-type registers π-fvk-support-nonzero-base-instanceβ follows the Vulkan spec and usesgl_BaseInstanceas the first vertex instance, soSV_InstanceID = gl_InstanceIndex - gl_BaseInstance. and no, without this option it's justSV_InstanceID = gl_InstanceIndex. that difference? iconic π«Ά-fvk-support-nonzero-base-vertexβ same vibe for vertices: follows the Vulkan spec, usesgl_BaseVertexas the first vertex, makingSV_VertexID = gl_VertexIndex - gl_BaseVertex. without it?SV_VertexID = gl_VertexIndex. periodt π-fvk-t-shift <shift> <space>β Vulkan binding number shift fort-type registers β¨-fvk-u-shift <shift> <space>β and foru-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β reciprocatesSV_Position.wafter reading from stage input in PS, fixing up the whole Vulkan-vs-DirectX situation π₯-fvk-use-gl-layoutβ strict OpenGLstd140/std430memory 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 athttp://khr.io/hlsl2spirv#optimizationif 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 of4_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 ano-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
- ubuntu stonking: dxc 1.9.2602+dfsg-0ubuntu1 Β· llvm-release-license
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms