Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose SUBGROUP, SUBGROUP_VERTEX, SUBGROUP_BARRIER native features #438

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

zackgomez
Copy link
Contributor

Simply pass these constants thru

Test Plan

use the following shader

@compute
@workgroup_size(32)
fn main(
    @builtin(global_invocation_id) global_id: vec3<u32>,
    @builtin(subgroup_size) subgroup_size: u32,
    @builtin(subgroup_invocation_id) subgroup_invocation_id: u32,
    ) {
    let x = subgroup_size;
    let id = subgroup_invocation_id;

    // requires SUBGROUP
    subgroupAny(true);
    subgroupBallot(true);
    subgroupMax(5);
    
    // requires SUBGROUP_BARRIER
    subgroupBarrier();
}


@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
    // requires SUBGROUP_VERTEX
    subgroupAny(true);
    
    // Not allowed even with SubgroupBarrier & SubgroupVertex
    // subgroupBarrier();
    
    return vec4<f32>(0.0, 0.0, 0.0, 0.0);
}

use a main.c that compiles requires all the SUBGROUP features and loads this shader. Verify that removing various features causes expected shader complication errors

@zackgomez zackgomez changed the title implement SUBGROUP, SUBGROUP_VERTEX, SUBGROUP_BARRIER features expose SUBGROUP, SUBGROUP_VERTEX, SUBGROUP_BARRIER native features Oct 10, 2024
@almarklein almarklein merged commit e3bbc26 into gfx-rs:trunk Oct 11, 2024
16 checks passed
@zackgomez zackgomez deleted the feature_subgroup branch October 12, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants