Skip to content

Commit e86cd31

Browse files
committed
Added flag for disabling HLSL intrinsics
1 parent ecd3f93 commit e86cd31

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

include/dxc/Support/HLSLOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,3 +601,6 @@ def rw_decl_global_cb : Flag<["-", "/"], "decl-global-cb">, Group<hlslrewrite_Gr
601601
HelpText<"Collect all global constants outside cbuffer declarations into cbuffer GlobalCB { ... }. Still experimental, not all dependency scenarios handled.">;
602602
// Also removed: compress, decompress, /Gch (child effect), /Gpp (partial precision)
603603
// /Op - no support for preshaders.
604+
605+
def devsh_disable_hlsl_intrinsics : Flag<["-"], "devsh-disable-hlsl-intrinsics">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
606+
HelpText<"Disable HLSL intrinsics">;

include/dxc/Support/SPIRVOptions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ enum class SpirvLayoutRule {
3838
};
3939

4040
struct SpirvCodeGenOptions {
41+
bool devshDisableHLSLIntrinsics;
4142
/// Disable legalization and optimization and emit raw SPIR-V
4243
bool codeGenHighLevel;
4344
bool debugInfoFile;

lib/DxcSupport/HLSLOptions.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,8 @@ int ReadDxcOpts(const OptTable *optionTable, unsigned flagsToInclude,
10741074

10751075
// SPIRV Change Starts
10761076
#ifdef ENABLE_SPIRV_CODEGEN
1077+
opts.SpirvOptions.devshDisableHLSLIntrinsics =
1078+
Args.hasFlag(OPT_devsh_disable_hlsl_intrinsics, OPT_INVALID, false);
10771079
opts.GenSPIRV = Args.hasFlag(OPT_spirv, OPT_INVALID, false);
10781080
opts.SpirvOptions.invertY =
10791081
Args.hasFlag(OPT_fvk_invert_y, OPT_INVALID, false);

0 commit comments

Comments
 (0)