summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-glsl.cpp
diff options
context:
space:
mode:
authorDarren Wihandi <65404740+fairywreath@users.noreply.github.com>2024-12-27 02:52:49 -0500
committerGitHub <noreply@github.com>2024-12-26 23:52:49 -0800
commit7cecc518e753a90d9b638e8dd1140730ab010ca7 (patch)
tree2d8769853421ffda8671e7d10b79e53f2e9c25f9 /source/slang/slang-emit-glsl.cpp
parent2ad1f8138771cef32b710f8c47d4c7beb3f4eab5 (diff)
Add packed 8bit builtin types (#5939)
* Add packed bytes builtin type * fix test
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
-rw-r--r--source/slang/slang-emit-glsl.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp
index d6f3795e3..a19c9c01f 100644
--- a/source/slang/slang-emit-glsl.cpp
+++ b/source/slang/slang-emit-glsl.cpp
@@ -1236,6 +1236,8 @@ void GLSLSourceEmitter::emitSimpleValueImpl(IRInst* inst)
return;
}
case BaseType::UInt:
+ case BaseType::Int8x4Packed:
+ case BaseType::UInt8x4Packed:
{
m_writer->emit(UInt(uint32_t(litInst->value.intVal)));
m_writer->emit("U");
@@ -1984,6 +1986,8 @@ bool GLSLSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inOu
break;
case BaseType::UInt:
+ case BaseType::Int8x4Packed:
+ case BaseType::UInt8x4Packed:
if (fromType == BaseType::Float)
{
m_writer->emit("floatBitsToUint");
@@ -3050,6 +3054,18 @@ void GLSLSourceEmitter::emitSimpleTypeImpl(IRType* type)
#endif
return;
}
+ case kIROp_Int8x4PackedType:
+ {
+ _requireBaseType(BaseType::Int8x4Packed);
+ m_writer->emit("uint");
+ return;
+ }
+ case kIROp_UInt8x4PackedType:
+ {
+ _requireBaseType(BaseType::UInt8x4Packed);
+ m_writer->emit("uint");
+ return;
+ }
case kIROp_VoidType:
case kIROp_BoolType:
case kIROp_Int8Type: