Skip to content

[DirectX] compute shader errors when indexing cbuffer matrix with non constant index. #8131

@farzonl

Description

@farzonl

Description

Repro: https://hlsl.godbolt.org/z/bMx7vaE4j

A cbuffer matrix (float4x2) indexed via a dynamic index derived from SV_GroupIndex and writes to an RWStructuredBuffer causes The following error:

error: validation errors
<source>:9:15: error: Access to out-of-bounds memory is disallowed.
note: at '%12 = getelementptr inbounds [2 x float], [2 x float]* %3, i32 0, i32 2' in block '#0' of function 'main'.
Validation failed.

We do not see this error when targeting SPIR-V. Similarly Clang does not error on this same case
https://hlsl.godbolt.org/z/4W17rPrzv

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crash

    Type

    No type

    Projects

    Status

    Triaged

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions