Open ArielG-NV opened 3 months ago
Update: this is because slang::BindingType::MutableTypedBuffer
, or TexelBuffer
, is not implemented in the gfx metal backend.
More fundamentally, the test has these lines:
//TEST_INPUT:ubuffer(format=R_UInt32, data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]):out,name outputBuffer
RWBuffer<uint> outputBuffer;
The ubuffer
test input line will create a buffer, and bind that buffer to outputBuffer
. However, in metal, RWBuffer
is translated into a texture, and we need a texture object to bind to this parameter. We currently don't have an abstraction in gfx that will map to a buffer in d3d/vulkan and a texture in metal. We probably need a TexelBuffer
class for this purpose.
Putting this to low priority as this is only due to a limitation in gfx abstraction and not due to any compiler issues. Texel buffers are a less commonly used feature so it is OK to put on-hold its support it in gfx for now.
Related to: #4291
tests/compute/atomics-buffer.slang
does not produce correct output with Metal target, RWBuffer data is never filled (or not read correctly). The data read back is all0
s, this may be a sign that a shader failed to launch.