[all-commits] [llvm/llvm-project] 721651: [HLSL][clang][Driver] Support target profile comma...
Xiang Li via All-commits
all-commits at lists.llvm.org
Fri Apr 15 12:18:34 PDT 2022
Author: Xiang Li <python3kgae at outlook.com>
Date: 2022-04-15 (Fri, 15 Apr 2022)
[HLSL][clang][Driver] Support target profile command line option.
The target profile option(/T) decide the shader model when compile hlsl.
The format is shaderKind_major_minor like ps_6_1.
The shader model is saved as llvm::Triple is clang/llvm like
The main job to support the option is translating ps_6_1 into
That is done inside tryParseProfile at HLSL.cpp.
To integrate the option into clang Driver, a new DriverMode DxcMode is
created. When DxcMode is enabled, OSType for TargetTriple will be
forced into Triple::ShaderModel. And new ToolChain HLSLToolChain will
be created when OSType is Triple::ShaderModel.
In HLSLToolChain, ComputeEffectiveClangTriple is overridden to call
tryParseProfile when targetProfile option is set.
To make test work, Fo option is added and .hlsl is added for active
Reviewed By: beanz
Differential Revision: https://reviews.llvm.org/D122865
Patch by: Xiang Li <python3kgae at outlook.com>
More information about the All-commits