Skip to content

[glsl-in] Subgroup support #7571

@PhenaOfMari

Description

@PhenaOfMari

GLSL ingest in Naga currently does not support subgroup functions.

Here is an example shader taken from Khronos' subgroup tutorial article:

#version 450

#extension GL_KHR_shader_subgroup_arithmetic: enable

layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;

layout(std430, set=0, binding=0) buffer layout_foo {
  uint foo[];
};

layout(std430, set=0, binding=1) buffer layout_bar {
  uint bar;
};

void main() {
  uint value = subgroupMax(foo[gl_GlobalInvocationID.x]);

  // A single invocation in the subgroup will do the atomic operation
  if (subgroupElect()) {
    atomicMax(bar, value);
  }
}

This produces a couple of unknown function errors for subgroupMax and subgroupElect (and atomicMax, but that is a different issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions