Skip to content

Commit 9c4c26f

Browse files
committed
change language
1 parent 2ebbc27 commit 9c4c26f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,13 +1018,14 @@ void SemaHLSL::diagnoseSemanticStageMismatch(
10181018
SmallVector<std::string, 8> ValidCases;
10191019
llvm::transform(
10201020
Allowed, std::back_inserter(ValidCases), [](SemanticStageInfo Case) {
1021-
std::string Type =
1022-
Case.AllowedIOTypesMask == IOType::InOut
1023-
? " inout"
1024-
: (Case.AllowedIOTypesMask & IOType::In ? " in" : " out");
1021+
SmallVector<std::string, 2> ValidType;
1022+
if (Case.AllowedIOTypesMask & IOType::In)
1023+
ValidType.push_back("input");
1024+
if (Case.AllowedIOTypesMask & IOType::Out)
1025+
ValidType.push_back("output");
10251026
return std::string(
10261027
HLSLShaderAttr::ConvertEnvironmentTypeToStr(Case.Stage)) +
1027-
Type;
1028+
" " + join(ValidType, "/");
10281029
});
10291030
Diag(A->getLoc(), diag::err_hlsl_semantic_unsupported_iotype_for_stage)
10301031
<< A->getAttrName() << (IsInput ? "input" : "output")

clang/test/SemaHLSL/Semantics/position.ps.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
// RUN: %clang_cc1 -triple spirv-pc-vulkan1.3-pixel -finclude-default-header -x hlsl -verify -o - %s
33

44
float4 main(float4 a : A) : SV_Position {
5-
// expected-error@-1 {{semantic 'SV_Position' is unsupported in pixel shaders as output, requires one of the following: vertex inout, pixel in}}
5+
// expected-error@-1 {{semantic 'SV_Position' is unsupported in pixel shaders as output, requires one of the following: vertex input/output, pixel input}}
66
return a;
77
}

0 commit comments

Comments
 (0)