Skip to content

[SPIR-V] sign() on uint matrices with at least two rows and two columns constructs an unsigned result array #8858

Description

@djb

Description

sign() called on a uint matrix with at least two rows and two columns generates invalid SPIR-V, as codegen attempts to construct an array of unsigned integer vectors from signed integer vectors.

Steps to Reproduce

Godbolt

Compile with dxc -T cs_6_0 -E main -Od -spirv source.hlsl:

[numthreads(1,1,1)]
void main() {
  uint2x2 u;
  int2x2 result = sign(u);
}

Actual Behavior

fatal error: generated SPIR-V is invalid: Expected Constituent type to be equal to the column type Result Type array
  %34 = OpCompositeConstruct %_arr_v2uint_uint_2 %30 %33

Disabling validation shows that we are trying to construct an array of unsigned integer vectors from signed integer vectors:

         %30 = OpSelect %v2int %29 %11 %10
         [...]
         %33 = OpSelect %v2int %32 %11 %10
         %34 = OpCompositeConstruct %_arr_v2uint_uint_2 %30 %33

Environment

  • DXC version: libdxcompiler.so: 1.10(5474-942eeceb)(1.9.0.15470)
  • Host Operating System: Fedora Linux 43 <!--- Host operating system and version --->

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashneeds-triageAwaiting triagespirvWork related to SPIR-V

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions