Skip to content

[HLSL] Support space-only resource register annotations #133346

Closed
@hekota

Description

@hekota

Add support for register(spaceN) annotation on resources where a space is specified but no register. This annotation instructs the compiler to assign implicit binding for the annotated resource from the provided virtual register space.

RWBuffer<float> A : register(u1);        // defaults to space0
RWBuffer<float> B[];                     // gets u2 (unbounded range)
RWBuffer<float> C[3] : register(space1); // gets u0, space1 (range 3)
RWBuffer<float> D : register(space1);    // gets u3, space1

[numthreads(4,1,1)]
void main() {
  A[0] = C[2][0] + D[0] + B[10][0];
}

https://godbolt.org/z/rEh7e5a7r

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language Supportclang:codegenIR generation bugs: mangling, exceptions, etc.clang: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