summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit-metal.cpp
diff options
context:
space:
mode:
authorArielG-NV <159081215+ArielG-NV@users.noreply.github.com>2024-06-24 09:16:28 -0400
committerGitHub <noreply@github.com>2024-06-24 09:16:28 -0400
commitcf8d1ceffcfbbb64734e6180a2c0cebd033f5b2e (patch)
tree5ccbc854e3c363822d6e85c2fb5812d7c2572381 /source/slang/slang-emit-metal.cpp
parentd349fd9e1f65fd32b2f4ea0e38c5084256d0dd04 (diff)
Implementing `tbuffer` layout(s) (#4436)
* Implementing `tbuffer` layouts. 1. Add to layout options 'TextureBuffer' layouts. 2. Add on to existing logic a way to allocate appropriate registers for TextureBufferType (this was made to work with parameter block logic). 3. Added asserts so objects missing a layout will gracefully crash This means `tbuffer` now works for hlsl,glsl,metal targets, spirv has yet to implement logic for `TextureBufferType`. * disable metal tests and fix emitting code a bit fixing the emitting code means metal compilation emits a useful error (help point users/developers to #4435) * fix warning
Diffstat (limited to 'source/slang/slang-emit-metal.cpp')
-rw-r--r--source/slang/slang-emit-metal.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/slang/slang-emit-metal.cpp b/source/slang/slang-emit-metal.cpp
index 07d5b9f6c..0a5506776 100644
--- a/source/slang/slang-emit-metal.cpp
+++ b/source/slang/slang-emit-metal.cpp
@@ -690,6 +690,13 @@ void MetalSourceEmitter::emitSimpleTypeImpl(IRType* type)
_emitHLSLTextureType(texType);
return;
}
+ else if (as<IRTextureBufferType>(type))
+ {
+ m_writer->emit("texture_buffer<");
+ emitVal(type->getOperand(0), getInfo(EmitOp::General));
+ m_writer->emit(">");
+ return;
+ }
else if (auto imageType = as<IRGLSLImageType>(type))
{
_emitHLSLTextureType(imageType);