HLSL
Overview of the HLSL technology.
To develop HLSL, you need these headers:
For programming guidance for this technology, see:
Enumerations
D3D_BLOB_PART Values that identify parts of the content of an arbitrary length data buffer. |
D3D_BLOB_PART Values that identify parts of the content of an arbitrary length data buffer. |
D3DCOMPILER_STRIP_FLAGS Strip flag options. |
D3DCOMPILER_STRIP_FLAGS Strip flag options. |
DXC_OUT_KIND Specifies the kind of output to retrieve from an IDxcResult. |
Functions
AddArguments Adds additional arguments to this list of compiler arguments. |
AddArgumentsUTF8 Adds additional UTF-8-encoded arguments to this list of compiler arguments. |
AddDefines Adds additional defines to this list of compiler arguments. |
AddPart Adds a part to the container. |
AssembleToContainer Assemble DXIL in LL or LLVM bitcode to a DXIL container. |
BuildArguments Build arguments that can be passed to the Compile method. |
Compile Compile a single entry point to the target shader model. IDxcCompiler::Compile is deprecated; use IDxcCompiler3::Compile instead. |
Compile Compile a single entry point to the target shader model, or compile a library to a library target, or compile a root signature, or preprocess HLSL source. |
CompileForFullPDB TBD |
CompileWithDebug Compile a single entry point to the target shader model with debug information. IDxcCompiler::CompileWithDebug is deprecated; use IDxcCompiler3::Compile instead. |
CreateBlob Copy blob contents to memory that's owned by the new blob. New blobs and copied contents are allocated with the current allocator. |
CreateBlobFromBlob IDxcUtils replaces IDxcLibrary; use IDxcUtils insted. |
CreateBlobFromBlob Create a sub-blob that holds a reference to the outer blob, and points to its memory. |
CreateBlobFromFile IDxcUtils replaces IDxcLibrary; use IDxcUtils insted. |
CreateBlobFromPinned Creates a blob referencing existing memory, with no copy. You must manage the memory lifetime separately. |
CreateBlobWithEncodingFromPinned IDxcUtils replaces IDxcLibrary; use IDxcUtils insted. |
CreateBlobWithEncodingOnHeapCopy IDxcUtils replaces IDxcLibrary; use IDxcUtils insted. |
CreateBlobWithEncodingOnMalloc IDxcUtils replaces IDxcLibrary; use IDxcUtils insted. |
CreateDefaultIncludeHandler Create a default file-based include handler. |
CreateIncludeHandler IDxcUtils replaces IDxcLibrary; use IDxcUtils insted. |
CreateReadOnlyStreamFromBlob Create a stream that reads data from a blob. |
CreateReflection Create a reflection interface from a serialized DXIL container, or the DXC_PART_REFLECTION_DATA blob contents. |
CreateStreamFromBlobReadOnly IDxcUtils replaces IDxcLibrary; use IDxcUtils insted. |
D3DCompile Compile HLSL code or an effect file into bytecode for a given target. |
D3DCompile Compile HLSL code or an effect file into bytecode for a given target. |
D3DCompile2 Compiles Microsoft High Level Shader Language (HLSL) code into bytecode for a given target. (D3DCompile2) |
D3DCompile2 Compiles Microsoft High Level Shader Language (HLSL) code into bytecode for a given target. (D3DCompile2) |
D3DCompileFromFile Compiles Microsoft High Level Shader Language (HLSL) code into bytecode for a given target. (D3DCompileFromFile) |
D3DCompileFromFile Compiles Microsoft High Level Shader Language (HLSL) code into bytecode for a given target. (D3DCompileFromFile) |
D3DCompressShaders Compresses a set of shaders into a more compact form. |
D3DCompressShaders Compresses a set of shaders into a more compact form. |
D3DCreateBlob Creates a buffer. |
D3DCreateBlob Creates a buffer. |
D3DCreateFunctionLinkingGraph Creates a function-linking-graph interface. |
D3DCreateFunctionLinkingGraph Creates a function-linking-graph interface. |
D3DCreateLinker Creates a linker interface. Note This function is part of the HLSL shader linking technology that you can use on all Direct3D 11 platforms to create precompiled HLSL functions, package them into libraries, and link them into full shaders at run time. . |
D3DCreateLinker Creates a linker interface. Note This function is part of the HLSL shader linking technology that you can use on all Direct3D 11 platforms to create precompiled HLSL functions, package them into libraries, and link them into full shaders at run time. . |
D3DDecompressShaders Decompresses one or more shaders from a compressed set. |
D3DDecompressShaders Decompresses one or more shaders from a compressed set. |
D3DDisassemble Disassembles compiled HLSL code. |
D3DDisassemble Disassembles compiled HLSL code. |
D3DDisassemble10Effect Disassembles compiled HLSL code from a Direct3D10 effect. |
D3DDisassemble10Effect Disassembles compiled HLSL code from a Direct3D10 effect. |
D3DDisassembleRegion Disassembles a specific region of compiled Microsoft High Level Shader Language (HLSL) code. |
D3DDisassembleRegion Disassembles a specific region of compiled Microsoft High Level Shader Language (HLSL) code. |
D3DGetBlobPart Retrieves a specific part from a compilation result. |
D3DGetBlobPart Retrieves a specific part from a compilation result. |
D3DGetDebugInfo Note You can use this API to develop your Windows Store apps, but you can't use it in apps that you submit to the Windows Store. Gets shader debug information. |
D3DGetDebugInfo Note You can use this API to develop your Windows Store apps, but you can't use it in apps that you submit to the Windows Store. Gets shader debug information. |
D3DGetInputAndOutputSignatureBlob Note D3DGetInputAndOutputSignatureBlob may be altered or unavailable for releases after Windows 8.1. Instead use D3DGetBlobPart with the D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB value. Gets the input and output signatures from a compilation result. |
D3DGetInputAndOutputSignatureBlob Note D3DGetInputAndOutputSignatureBlob may be altered or unavailable for releases after Windows 8.1. Instead use D3DGetBlobPart with the D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB value. Gets the input and output signatures from a compilation result. |
D3DGetInputSignatureBlob Note D3DGetInputSignatureBlob may be altered or unavailable for releases after Windows 8.1. Instead use D3DGetBlobPart with the D3D_BLOB_INPUT_SIGNATURE_BLOB value. Gets the input signature from a compilation result. |
D3DGetInputSignatureBlob Note D3DGetInputSignatureBlob may be altered or unavailable for releases after Windows 8.1. Instead use D3DGetBlobPart with the D3D_BLOB_INPUT_SIGNATURE_BLOB value. Gets the input signature from a compilation result. |
D3DGetOutputSignatureBlob Note D3DGetOutputSignatureBlob may be altered or unavailable for releases after Windows 8.1. Instead use D3DGetBlobPart with the D3D_BLOB_OUTPUT_SIGNATURE_BLOB value. Gets the output signature from a compilation result. |
D3DGetOutputSignatureBlob Note D3DGetOutputSignatureBlob may be altered or unavailable for releases after Windows 8.1. Instead use D3DGetBlobPart with the D3D_BLOB_OUTPUT_SIGNATURE_BLOB value. Gets the output signature from a compilation result. |
D3DGetTraceInstructionOffsets Retrieves the byte offsets for instructions within a section of shader code. |
D3DGetTraceInstructionOffsets Retrieves the byte offsets for instructions within a section of shader code. |
D3DLoadModule Creates a shader module interface from source data for the shader module. |
D3DLoadModule Creates a shader module interface from source data for the shader module. |
D3DPreprocess Preprocesses uncompiled HLSL code. |
D3DPreprocess Preprocesses uncompiled HLSL code. |
D3DReadFileToBlob Reads a file that is on disk into memory. |
D3DReadFileToBlob Reads a file that is on disk into memory. |
D3DReflect Gets a pointer to a reflection interface. |
D3DReflect Gets a pointer to a reflection interface. |
D3DReflectLibrary Creates a library-reflection interface from source data that contains an HLSL library of functions. |
D3DReflectLibrary Creates a library-reflection interface from source data that contains an HLSL library of functions. |
D3DSetBlobPart Sets information in a compilation result. |
D3DSetBlobPart Sets information in a compilation result. |
D3DStripShader Removes unwanted blobs from a compilation result. |
D3DStripShader Removes unwanted blobs from a compilation result. |
D3DWriteBlobToFile Writes a memory blob to a file on disk. |
D3DWriteBlobToFile Writes a memory blob to a file on disk. |
Disassemble Disassemble a program. IDxcCompiler::Disassemble is deprecated; use IDxcCompiler3::Disassemble instead. |
Disassemble Disassemble a program. |
DxcCreateInstance Creates a single uninitialized object of the class associated with a specified CLSID. |
DxcCreateInstance2 Creates a single uninitialized object of the class associated with a specified CLSID (can be used to create an instance of the compiler with a custom memory allocator). |
DxcCreateInstance2Proc The DxcCreateInstance2Proc typedef is provided to make it more convenient for you to use GetProcAddress to call DxcCreateInstance2. |
DxcCreateInstanceProc The DxcCreateInstanceProc typedef is provided to make it more convenient for you to use GetProcAddress to call DxcCreateInstance. |
FindFirstPartKind Retrieves the index of the first part that has the specified kind. |
GetArg TBD |
GetArgCount TBD |
GetArgPair TBD |
GetArgPairCount TBD |
GetArguments Retrieves the array of arguments. |
GetAvailablePass TBD |
GetAvailablePassCount TBD |
GetBlobAsUtf16 IDxcUtils replaces IDxcLibrary; use IDxcUtils insted. |
GetBlobAsUtf16 Convert or return matching encoded text blob as UTF-16. |
GetBlobAsUtf8 IDxcUtils replaces IDxcLibrary; use IDxcUtils insted. |
GetBlobAsUtf8 Convert or return matching encoded text blob as UTF-8. |
GetBufferPointer Retrieves a pointer to the blob's data. |
GetBufferSize Retrieves the size (in bytes, and including the null-terminator) of the blob's data. |
GetCommitInfo TBD |
GetCount Retrieves the number of arguments. |
GetCustomVersionString TBD |
GetDefine TBD |
GetDefineCount TBD |
GetDescription TBD |
GetDxilContainerPart TBD |
GetEncoding Retrieve the encoding for this blob. |
GetEntryPoint TBD |
GetErrorBuffer Retrieves the error buffer from the operation, if there is one. This corresponds to calling IDxcResult::GetOutput with DXC_OUT_ERRORS. |
GetFlag TBD |
GetFlagCount TBD |
GetFlags TBD |
GetFullPDB TBD |
GetHash TBD |
GetMainFileName TBD |
GetName TBD |
GetNumOutputs Retrieves the number of outputs available in this result. |
GetOptionArgCount TBD |
GetOptionArgDescription TBD |
GetOptionArgName TBD |
GetOptionName TBD |
GetOutput Retrieves the specified output. |
GetOutput Retrieves the specified output. |
GetOutputByIndex Retrieves the output kind at the specified index. |
GetOutputCount Retrieves the number of outputs available. |
GetPartContent Retrieves the content of the specified part. |
GetPartCount Retrieves the number of parts in the container. |
GetPartKind Retrieves the kind of the specified part. |
GetPartReflection Retrieves the reflection interface for the specified part. |
GetPDBContents Retrieves the hash and contents of a shader PDB. |
GetResult Retrieves the primary output of the operation. |
GetSource TBD |
GetSourceCount TBD |
GetSourceName TBD |
GetStatus Retrieves the overall status of the operation. |
GetStringLength Retrieves the length of the string stored in this blob, in characters, excluding the null-terminator. |
GetStringPointer Retrieves a pointer to the string stored in this blob. |
GetTargetProfile TBD |
GetVersion TBD |
GetVersionInfo TBD |
HasOutput Determines whether or not this result has the specified output. |
IsFullPDB TBD |
Link Links the shader, and produces a shader blob that the Direct3D runtime can use. |
Load Loads a DxilContainer to the builder. |
Load Chooses the container to perform reflection on. |
Load TBD |
LoadFile Create a blob with data loaded from a file. |
LoadSource TBD |
OverrideArgs TBD |
OverrideRootSignature TBD |
Preprocess Preprocess source text. |
PrimaryOutput TBD |
RegisterLibrary Register a library with a name so that you can later reference it by that name. |
RemovePart Remove a part from the container. |
RunOptimizer TBD |
SerializeContainer Build the container. |
SetCompiler TBD |
SetMalloc IDxcUtils replaces IDxcLibrary; use IDxcUtils insted. |
Validate Validate a shader. |
ValidateWithDebug Validate a shader, with optional debug bitcode. |
Structures
D3D_SHADER_DATA Describes shader data. (D3D_SHADER_DATA) |
D3D_SHADER_DATA Describes shader data. (D3D_SHADER_DATA) |
DxcArgPair TBD |
DxcDefine Structure for supplying defines to Dxc APIs. |
DxcShaderHash Hash digest type for ShaderHash. |
DxcText Structure for supplying bytes or text input to Dxc APIs. |
IDxcAssembler Interface representing the DxcAssembler. |
IDxcBlob A sized buffer that can be passed into and out of DXC APIs. IDxcBlob is an alias of ID3D10Blob and ID3DBlob. |
IDxcBlobEncoding A blob that might have a known encoding. |
IDxcBlobUtf8 TBD |
IDxcCompiler IDxcCompiler is deprecated; use IDxcCompiler3 instead. |
IDxcCompiler2 IDxcCompiler2 is deprecated; use IDxcCompiler3 instead. |
IDxcCompiler3 Interface that represents the DirectX Shader Compiler. |
IDxcCompilerArgs An interface for managing arguments passed to DXC. |
IDxcContainerBuilder Interface representing the DXC container builder. |
IDxcContainerReflection Interface representing DxcContainerReflection. |
IDxcExtraOutputs Represents additional outputs from a DXC operation. |
IDxcIncludeHandler Interface for handling include directives. To customize the handling of include directives, you can provide an implementation of this interface. |
IDxcLibrary IDxcUtils replaces IDxcLibrary; use IDxcUtils insted. |
IDxcLinker The DXC linker interface. |
IDxcOperationResult The results of a DXC operation. IDxcResult replaces IDxcOperationResult, and should be used wherever possible. |
IDxcOptimizer Interface representing DxcOptimizer. |
IDxcOptimizerPass Interface representing an optimizer pass. |
IDxcPdbUtils Represents PDB version information. |
IDxcResult Represents the result of a DXC operation. A DXC operation might have multiple outputs, such as a shader object and errors. This interface provides access to the outputs. |
IDxcUtils Various utility functions for DXC. |
IDxcValidator Interface representing the DXC shader validator. |
IDxcValidator2 Interface representing the DXC shader validator. |
IDxcVersionInfo Represents PDB version information. |
IDxcVersionInfo2 Represents PDB version information. |
IDxcVersionInfo3 Represents PDB version information. |
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for