DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

Integer vector as enum type causes ICE rather than error

Open Ipotrick opened this issue 2 years ago • 3 comments

Hi, I am using the DXC c++ interface to compile hlsl to spirv. I found an internal compiler crash inside the "Compile" function of DxcCompiler3. I am using the msvc clang toolchain version 13.0.0 to compile. I downloaded the latest version of dxc from the repository (dbd8db0e84420e063f6f7da974a32d58aa79b64b). I can compile other code just fine and i also get error messages for other mistakes in my hlsl. Here are my used arguments: -Zpc -spirv -fspv-target-env=vulkan1.1 _o3 -E -T cs_6_0 -HV 2021. Minimal example that causes the compiler crash (reading illegal memory address, address varies from run to run):

enum EE : uint3 {
    E = uint3(0,0,0),
};

I am new to dxc and hlsl and i dont even know if it is legal to use a uint3 as a "Supper" for an enum, but i am sure it should NOT crash when i give a missinput like that.

Ipotrick avatar Apr 09 '22 01:04 Ipotrick