Skip to content

Implement support for groupshared arguments in 202x #7969

@spall

Description

@spall

Implement support for groupshared arguments in 202x based on this proposal: https://github.com/microsoft/hlsl-specs/blob/main/proposals/0043-groupshared-arguments.md

Errors:

  • Error if a function annotated with 'export' or '[noinline]' annotates a parameter with groupshared.
  • Error if the argument to a groupshared parameter is not a groupshared variable.
  • Error if the argument to a groupshared parameter is not exactly the same type as the parameter. No implicit or explicit conversion are allowed.
  • the following overload calls are errors.
    Given this set of overloads
void fn(groupshared uint shared);
void fn(inout uint u);

This call site is ambiguous and results in an error:

groupshared uint Shared;
void caller() {
  fn(Shared);
}

This call site is not ambiguous however:

void caller() {
  uint Local;
  fn(Local);
}

Given this set of overloads

void fn(groupshared uint shared);
void fn(uint u);

This call site is ambiguous and results in an error:

groupshared uint Shared;
void caller() {
  fn(Shared);
}

These call sites are not ambiguous however:

void caller() {
  uint Local;
  fn(Local);
  fn(5);
}

Warnings:

  • Warn if language mode is earlier than 202x and groupshared annotation is used on a parameter
  • Warn when language mode is 202x or later and a groupshared variable is passed to a function annotated with inout.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions