Skip to content

[glsl-in] Atomics support #4372

@fintelia

Description

@fintelia

Naga's GLSL frontend does not currently handle atomic operations. For example, this shader:

#version 460 core

layout(std430, binding = 0) buffer Buffer {
    uint x;
} buf;

void main() {
    atomicAdd(buf.x, 1);
}

Produces this error:

error: Unknown function 'atomicAdd'
  ┌─ shader.comp:8:5
  │
8 │     atomicAdd(buf.x, 1);
  │     ^^^^^^^^^^^^^^^^^^^

(I couldn't find an existing tracking issue for this, though gfx-rs/naga#1154 and gfx-rs/naga#929 are related.)

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