|
@@ -244,7 +244,7 @@ void HLSignatureLower::ProcessArgument(Function *func,
|
|
|
if (sigPoint->GetKind() == DXIL::SigPointKind::MSPOut) {
|
|
|
if (interpMode != InterpolationMode::Kind::Undefined &&
|
|
|
interpMode != InterpolationMode::Kind::Constant) {
|
|
|
- Entry->getContext().emitError(
|
|
|
+ dxilutil::EmitErrorOnFunction(func,
|
|
|
"Mesh shader's primitive outputs' interpolation mode must be constant or undefined.");
|
|
|
}
|
|
|
interpMode = InterpolationMode::Kind::Constant;
|
|
@@ -266,7 +266,7 @@ void HLSignatureLower::ProcessArgument(Function *func,
|
|
|
|
|
|
llvm::StringRef semanticStr = paramAnnotation.GetSemanticString();
|
|
|
if (semanticStr.empty()) {
|
|
|
- func->getContext().emitError(
|
|
|
+ dxilutil::EmitErrorOnFunction(func,
|
|
|
"Semantic must be defined for all parameters of an entry function or "
|
|
|
"patch constant function");
|
|
|
return;
|
|
@@ -298,9 +298,8 @@ void HLSignatureLower::ProcessArgument(Function *func,
|
|
|
auto &SemanticIndexSet = SemanticUseMap[(unsigned)pSemantic->GetKind()];
|
|
|
for (unsigned idx : paramAnnotation.GetSemanticIndexVec()) {
|
|
|
if (SemanticIndexSet.count(idx) > 0) {
|
|
|
- func->getContext().emitError(
|
|
|
- Twine("Parameter with semantic ") + semanticStr +
|
|
|
- Twine(" has overlapping semantic index at ") + Twine(idx));
|
|
|
+ dxilutil::EmitErrorOnFunction(func, "Parameter with semantic " + semanticStr +
|
|
|
+ " has overlapping semantic index at " + std::to_string(idx) + ".");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -316,7 +315,7 @@ void HLSignatureLower::ProcessArgument(Function *func,
|
|
|
0) ||
|
|
|
(pSemantic->GetKind() == DXIL::SemanticKind::InnerCoverage &&
|
|
|
SemanticUseMap.count((unsigned)DXIL::SemanticKind::Coverage) > 0)) {
|
|
|
- func->getContext().emitError(
|
|
|
+ dxilutil::EmitErrorOnFunction(func,
|
|
|
"Pixel shader inputs SV_Coverage and SV_InnerCoverage are mutually "
|
|
|
"exclusive");
|
|
|
return;
|
|
@@ -328,12 +327,13 @@ void HLSignatureLower::ProcessArgument(Function *func,
|
|
|
// intrinsics
|
|
|
{
|
|
|
switch (interpretation) {
|
|
|
- case DXIL::SemanticInterpretationKind::NA:
|
|
|
- func->getContext().emitError(Twine("Semantic ") + semanticStr +
|
|
|
- Twine(" is invalid for shader model: ") +
|
|
|
- ShaderModel::GetKindName(props.shaderKind));
|
|
|
+ case DXIL::SemanticInterpretationKind::NA: {
|
|
|
+ dxilutil::EmitErrorOnFunction(func, Twine("Semantic ") + semanticStr +
|
|
|
+ Twine(" is invalid for shader model: ") +
|
|
|
+ ShaderModel::GetKindName(props.shaderKind));
|
|
|
|
|
|
return;
|
|
|
+ }
|
|
|
case DXIL::SemanticInterpretationKind::NotInSig:
|
|
|
case DXIL::SemanticInterpretationKind::Shadow: {
|
|
|
IRBuilder<> funcBuilder(func->getEntryBlock().getFirstInsertionPt());
|
|
@@ -389,11 +389,10 @@ void HLSignatureLower::ProcessArgument(Function *func,
|
|
|
pSE = FindArgInSignature(arg, paramAnnotation.GetSemanticString(),
|
|
|
interpMode, sigPoint->GetKind(), *pSig);
|
|
|
if (!pSE) {
|
|
|
- func->getContext().emitError(
|
|
|
- Twine("Signature element ") + semanticStr +
|
|
|
- Twine(", referred to by patch constant function, is not found in "
|
|
|
- "corresponding hull shader ") +
|
|
|
- (sigKind == DXIL::SignatureKind::Input ? "input." : "output."));
|
|
|
+ dxilutil::EmitErrorOnFunction(func, Twine("Signature element ") + semanticStr +
|
|
|
+ Twine(", referred to by patch constant function, is not found in "
|
|
|
+ "corresponding hull shader ") +
|
|
|
+ (sigKind == DXIL::SignatureKind::Input ? "input." : "output."));
|
|
|
return;
|
|
|
}
|
|
|
m_patchConstantInputsSigMap[arg.getArgNo()] = pSE;
|
|
@@ -454,7 +453,7 @@ void HLSignatureLower::CreateDxilSignatures() {
|
|
|
}
|
|
|
|
|
|
if (bHasClipPlane) {
|
|
|
- Entry->getContext().emitError("Cannot use clipplanes attribute without "
|
|
|
+ dxilutil::EmitErrorOnFunction(Entry, "Cannot use clipplanes attribute without "
|
|
|
"specifying a 4-component SV_Position "
|
|
|
"output");
|
|
|
}
|
|
@@ -464,7 +463,7 @@ void HLSignatureLower::CreateDxilSignatures() {
|
|
|
if (props.shaderKind == DXIL::ShaderKind::Hull) {
|
|
|
Function *patchConstantFunc = props.ShaderProps.HS.patchConstantFunc;
|
|
|
if (patchConstantFunc == nullptr) {
|
|
|
- Entry->getContext().emitError(
|
|
|
+ dxilutil::EmitErrorOnFunction(Entry,
|
|
|
"Patch constant function is not specified.");
|
|
|
}
|
|
|
|
|
@@ -493,14 +492,14 @@ void HLSignatureLower::AllocateDxilInputOutputs() {
|
|
|
|
|
|
hlsl::PackDxilSignature(EntrySig.InputSignature, packing);
|
|
|
if (!EntrySig.InputSignature.IsFullyAllocated()) {
|
|
|
- HLM.GetCtx().emitError(
|
|
|
+ dxilutil::EmitErrorOnFunction(Entry,
|
|
|
"Failed to allocate all input signature elements in available space.");
|
|
|
}
|
|
|
|
|
|
if (props.shaderKind != DXIL::ShaderKind::Amplification) {
|
|
|
hlsl::PackDxilSignature(EntrySig.OutputSignature, packing);
|
|
|
if (!EntrySig.OutputSignature.IsFullyAllocated()) {
|
|
|
- HLM.GetCtx().emitError(
|
|
|
+ dxilutil::EmitErrorOnFunction(Entry,
|
|
|
"Failed to allocate all output signature elements in available space.");
|
|
|
}
|
|
|
}
|
|
@@ -510,7 +509,8 @@ void HLSignatureLower::AllocateDxilInputOutputs() {
|
|
|
props.shaderKind == DXIL::ShaderKind::Mesh) {
|
|
|
hlsl::PackDxilSignature(EntrySig.PatchConstOrPrimSignature, packing);
|
|
|
if (!EntrySig.PatchConstOrPrimSignature.IsFullyAllocated()) {
|
|
|
- HLM.GetCtx().emitError("Failed to allocate all patch constant signature "
|
|
|
+ dxilutil::EmitErrorOnFunction(Entry,
|
|
|
+ "Failed to allocate all patch constant signature "
|
|
|
"elements in available space.");
|
|
|
}
|
|
|
}
|
|
@@ -1195,7 +1195,7 @@ void HLSignatureLower::GenerateDxilCSInputs() {
|
|
|
|
|
|
llvm::StringRef semanticStr = paramAnnotation.GetSemanticString();
|
|
|
if (semanticStr.empty()) {
|
|
|
- Entry->getContext().emitError("Semantic must be defined for all "
|
|
|
+ dxilutil::EmitErrorOnFunction(Entry, "Semantic must be defined for all "
|
|
|
"parameters of an entry function or patch "
|
|
|
"constant function");
|
|
|
return;
|
|
@@ -1220,7 +1220,7 @@ void HLSignatureLower::GenerateDxilCSInputs() {
|
|
|
default:
|
|
|
DXASSERT(semantic->IsInvalid(),
|
|
|
"else compute shader semantics out-of-date");
|
|
|
- Entry->getContext().emitError("invalid semantic found in CS");
|
|
|
+ dxilutil::EmitErrorOnFunction(Entry, "invalid semantic found in CS");
|
|
|
return;
|
|
|
}
|
|
|
|