Skip to content

[DirectX] frac constant folding produces wrong output for negative matrix arguments #8937

Description

@kmpeng

https://godbolt.org/z/a9KK44hn9

This constant folding test:

// RUN: %dxc -HV 202x -T cs_6_0 %s

RWStructuredBuffer<float4> Out : register(u1);

[numthreads(1,1,1)]
void main() {
  float2x2 R22Const = frac(float2x2(-1.75, -0.25, 0.75, 1.25));
  Out[0] = float4(R22Const[0], R22Const[1]);
}

produces 0.75, 0.25, 0.75, 0.25 as output when the expected result is 0.25, 0.75, 0.75, 0.25.

This error only happens on DirectX with negative matrix arguments. The same operation performed using buffer values gives the correct output.

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 triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions