summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-wgsl.cpp
diff options
context:
space:
mode:
authorCopilot <198982749+Copilot@users.noreply.github.com>2025-07-11 03:22:59 +0000
committerGitHub <noreply@github.com>2025-07-11 03:22:59 +0000
commitd0f342c9263a0e47947ac3be9fa4d9f665831e63 (patch)
treead413058f5b635e60a57aba59870e344c5d847d4 /source/slang/slang-emit-wgsl.cpp
parent6f11c50ba101948b110aa7310fc4fb5732b2b708 (diff)
Fix int16_t/uint16_t support for WGSL target (#7692)
* Initial plan * Implement int16_t/uint16_t support for WGSL target Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Change int16_t/uint16_t to emit proper diagnostics instead of auto-promoting Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Implement diagnoseOnce to prevent duplicate diagnostics Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Optimize diagnoseOnce to use HashSet::add() return value Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Apply code formatting to slang-emit-c-like.h Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Fix diagnoseOnce to use all parameters instead of first parameter only Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-emit-wgsl.cpp')
-rw-r--r--source/slang/slang-emit-wgsl.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/slang/slang-emit-wgsl.cpp b/source/slang/slang-emit-wgsl.cpp
index 97b57d352..fbcb54d10 100644
--- a/source/slang/slang-emit-wgsl.cpp
+++ b/source/slang/slang-emit-wgsl.cpp
@@ -515,8 +515,10 @@ void WGSLSourceEmitter::emitSimpleTypeImpl(IRType* type)
return;
}
case kIROp_Int16Type:
+ diagnoseOnce(SourceLoc(), Diagnostics::int16NotSupportedInWGSL, "int16_t");
+ return;
case kIROp_UInt16Type:
- SLANG_UNEXPECTED("16 bit integer value emitted");
+ diagnoseOnce(SourceLoc(), Diagnostics::int16NotSupportedInWGSL, "uint16_t");
return;
case kIROp_Int64Type:
case kIROp_IntPtrType:
@@ -976,9 +978,13 @@ void WGSLSourceEmitter::emitSimpleValueImpl(IRInst* inst)
break;
}
case BaseType::Int16:
+ {
+ diagnoseOnce(SourceLoc(), Diagnostics::int16NotSupportedInWGSL, "int16_t");
+ break;
+ }
case BaseType::UInt16:
{
- SLANG_UNEXPECTED("16 bit integer value emitted");
+ diagnoseOnce(SourceLoc(), Diagnostics::int16NotSupportedInWGSL, "uint16_t");
break;
}
case BaseType::Int: