forked from OSchip/llvm-project
[NFC] Rename dx.shader to hlsl.shader
This metadata annotation is HLSL-specific not DirectX specific. It will need to be attached for shaders regardless of whether they are targeting DXIL.
This commit is contained in:
parent
478cf94378
commit
9a478d5232
|
@ -90,7 +90,7 @@ void CGHLSLRuntime::annotateHLSLResource(const VarDecl *D, GlobalVariable *GV) {
|
||||||
void clang::CodeGen::CGHLSLRuntime::setHLSLFunctionAttributes(
|
void clang::CodeGen::CGHLSLRuntime::setHLSLFunctionAttributes(
|
||||||
llvm::Function *F, const FunctionDecl *FD) {
|
llvm::Function *F, const FunctionDecl *FD) {
|
||||||
if (HLSLShaderAttr *ShaderAttr = FD->getAttr<HLSLShaderAttr>()) {
|
if (HLSLShaderAttr *ShaderAttr = FD->getAttr<HLSLShaderAttr>()) {
|
||||||
const StringRef ShaderAttrKindStr = "dx.shader";
|
const StringRef ShaderAttrKindStr = "hlsl.shader";
|
||||||
F->addFnAttr(ShaderAttrKindStr,
|
F->addFnAttr(ShaderAttrKindStr,
|
||||||
ShaderAttr->ConvertShaderTypeToStr(ShaderAttr->getType()));
|
ShaderAttr->ConvertShaderTypeToStr(ShaderAttr->getType()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// Make sure not mangle entry.
|
// Make sure not mangle entry.
|
||||||
// CHECK:define void @foo()
|
// CHECK:define void @foo()
|
||||||
// Make sure add function attribute.
|
// Make sure add function attribute.
|
||||||
// CHECK:"dx.shader"="compute"
|
// CHECK:"hlsl.shader"="compute"
|
||||||
[numthreads(1,1,1)]
|
[numthreads(1,1,1)]
|
||||||
void foo() {
|
void foo() {
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// Make sure not mangle entry.
|
// Make sure not mangle entry.
|
||||||
// CHECK:define void @foo()
|
// CHECK:define void @foo()
|
||||||
// Make sure add function attribute.
|
// Make sure add function attribute.
|
||||||
// CHECK:"dx.shader"="compute"
|
// CHECK:"hlsl.shader"="compute"
|
||||||
[shader("compute")]
|
[shader("compute")]
|
||||||
[numthreads(1,1,1)]
|
[numthreads(1,1,1)]
|
||||||
void foo() {
|
void foo() {
|
||||||
|
|
Loading…
Reference in New Issue