DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

ByteAddressBufferLoad<T> fails when T contains an enum value

Open mcbouterse opened this issue 3 years ago • 2 comments

Templated ByteAddressBuffer loads will generate a compiler error if used to load a struct containing an enumeration value (Explicit template arguments on intrinsic Load must be a single numeric type). We currently work around this issue by storing enums as plain uint, but it would be nice if it would work with the enumeration type directly.

Sample Program: https://godbolt.org/z/GvGzb16Ej

Related to #4735

mcbouterse avatar Mar 13 '23 08:03 mcbouterse

Note: I think the fix for this is updating HlslTypes.cop to accept Enums. I think that should be safe, but @tex3d would know for sure.

llvm-beanz avatar Mar 16 '23 13:03 llvm-beanz

@bob80905 - we should make sure that this works in clang.

damyanp avatar Sep 24 '24 17:09 damyanp

It looks to me that this is now fixed with #7449. Tested on Compiler Explorer: https://godbolt.org/z/GvGzb16Ej

I think this just missed the 6.9 preview branch, but it should be available in our next non-preview release.

llvm-beanz avatar May 19 '25 20:05 llvm-beanz