Skip to content

DXC does not correctly handle local editable resource arrays #7678

Open

Description

@hekota

Description
DXC does not handle local resource arrays correctly.

Steps to Reproduce

RWBuffer<int> X : register(u0);
RWBuffer<int> Y : register(u1);

void SomeFn(RWBuffer<int> Arr[2], uint Idx, int Val0) {
  Arr[0] = Y;
  Arr[0][Idx] = Val0;
}

[numthreads(4,1,1)]
void main(uint GI : SV_GroupIndex) {
  RWBuffer<int> Arr[2] = {X, Y};
  SomeFn(Arr, GI, 1);
  Arr[0][GI] = 2;
}

Expected Behavior

X: [ 2, 2, 2, 2 ]
Y: [ 1, 1, 1, 1 ]

Actual Behavior

X: [ 0, 0, 0, 0 ]
Y: [ 2, 2, 2, 2 ]

Environment

  • DXC main 8/1/2025
  • Windows/DirectX

Activity

  1. added
    bug
    needs-triage
    on Aug 1, 2025
  2. changed the title [-]DXC does not handle local resource arrays correctly[/-] [+]DXC does not correctly handle local editable resource arrays[/+] on Aug 1, 2025
  3. damyanp commented on Oct 28, 2025

    @damyanp
    Member

    We may want to fix this or generate a diagnostic for this case in HLSL 202x since we'll most likely not be replicating this bug in clang.

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

    bug

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions