You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPIR-V] Using bool types or their arrays in Hull and Domain stage IO fails compilation (works with DXIL backend)
Functional impact
Can't use bool types or their arrays in Hull stage input or output or domain input without the SPIR-V backend failing to compile. Using them only in Hull output fails validation and the error message asks to report a bug.
Minimal repro steps
Compile repro_shader_0.txt with either dxc.exe -T hs_6_0 -E Hull -spirv repro_shader_0.txt or dxc.exe -T ds_6_0 -E Domain -spirv repro_shader_0.txt and observe the output:
error: translating binary operator '!=' unimplemented
error: getting value 0 for type unsigned int [3] unimplemented
Compile repro_shader_1.txt with dxc.exe -T hs_6_0 -E Hull -spirv repro_shader_1.txt and observe the output:
fatal error: generated SPIR-V is invalid: OpStore Pointer <id> '33[%33]'s type does not match Object <id> '16[%false]'s type.
OpStore %33 %false
note: please file a bug report on https://github.com/Microsoft/DirectXShaderCompiler/issues with source code if possible
Expected result
Compilation should succeed when bools, their vectors or arrays are used in Hull and Domain stage IO as they work for vertex output and also work with the DXIL backend.
Actual result
Compilation fails with the errors seen in the Minimal repro steps section
Further technical details
If the control point member's b type is changed from bool to an array of bools e.g. bool[2] the compiler will generate the following validation error:
fatal error: generated SPIR-V is invalid: If OpTypeBool is stored in conjunction with OpVariable, it can only be used with non-externally visible shader Storage Classes: Workgroup, CrossWorkgroup, Private, and Function
%in_var_MY_BOOL = OpVariable %_ptr_Input__arr__arr_bool_uint_2_uint_3 Input
note: please file a bug report on https://github.com/Microsoft/DirectXShaderCompiler/issues with source code if possible
Vectors of books also generate errors.
Used DXC release v1.6.2104 (e09a454)
The text was updated successfully, but these errors were encountered:
Inputs and outputs that are boolean in HLSL cannot be bools in SPIR-V
because it is not allowed by the spec. So they need to be treated as
ints in the interface.
This was not tested with Hull shaders, where these input and outputs
must also be turned into arrays. This commit adds the code that will
handle casting the arrays between int and bool.
Fixesmicrosoft#3744
Inputs and outputs that are boolean in HLSL cannot be bools in SPIR-V
because it is not allowed by the spec. So they need to be treated as
ints in the interface.
This was not tested with Hull shaders, where these input and outputs
must also be turned into arrays. This commit adds the code that will
handle casting the arrays between int and bool.
Fixes#3744
Title
[SPIR-V] Using bool types or their arrays in Hull and Domain stage IO fails compilation (works with DXIL backend)
Functional impact
Can't use bool types or their arrays in Hull stage input or output or domain input without the SPIR-V backend failing to compile. Using them only in Hull output fails validation and the error message asks to report a bug.
Minimal repro steps
dxc.exe -T hs_6_0 -E Hull -spirv repro_shader_0.txt
ordxc.exe -T ds_6_0 -E Domain -spirv repro_shader_0.txt
and observe the output:dxc.exe -T hs_6_0 -E Hull -spirv repro_shader_1.txt
and observe the output:Expected result
Compilation should succeed when bools, their vectors or arrays are used in Hull and Domain stage IO as they work for vertex output and also work with the DXIL backend.
Actual result
Compilation fails with the errors seen in the
Minimal repro steps
sectionFurther technical details
If the control point member's
b
type is changed frombool
to an array of bools e.g.bool[2]
the compiler will generate the following validation error:Vectors of books also generate errors.
Used DXC release v1.6.2104 (e09a454)
The text was updated successfully, but these errors were encountered: