When compiling HLSL that uses a ternary expression to select between two global resources and assign to a local resource variable, DXC's SPIRV backend emits:
error: casting to type 'RWByteAddressBuffer' unimplemented
Repro:
RWByteAddressBuffer gBuf0 : register(u0);
RWByteAddressBuffer gBuf1 : register(u1);
[numthreads(1,1,1)]
void main() {
RWByteAddressBuffer buf = (true ? gBuf0 : gBuf1);
buf.Store(0, 42);
}
Command:
dxc.exe -spirv -fspv-target-env=vulkan1.3 -T cs_6_0 -Fo out.spv repro.hlsl
This also reproduces with nested if/else phi patterns (e.g. buf = false ? gBuf0 : gBuf1 inside an if block). DXC DXIL and Clang DXIL both compile this successfully. DXC version: main (built from source).
When compiling HLSL that uses a ternary expression to select between two global resources and assign to a local resource variable, DXC's SPIRV backend emits:
error: casting to type 'RWByteAddressBuffer' unimplementedRepro:
Command:
dxc.exe -spirv -fspv-target-env=vulkan1.3 -T cs_6_0 -Fo out.spv repro.hlslThis also reproduces with nested if/else phi patterns (e.g.
buf = false ? gBuf0 : gBuf1inside an if block). DXC DXIL and Clang DXIL both compile this successfully. DXC version: main (built from source).