Skip to content

[HLSL] Make global resources (including arrays) read-only #154390

@hekota

Description

@hekota

Global resources are read-only. The compiler needs to report an error when somebody attempts to assign a value to a global resource, a global resource array element or the whole array.

RWBuffer<float> A[10];
RWBuffer<float> B;
RWBuffer<float> C[10];

[numthreads(4,1,1)]
void main() {
  A[1] = B; // error
  A = C; // error
  B = C[0]; // error
}

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language Supportclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions