KhronosGroup / KhronosGroup/GLSL

GL_EXT_subgroupuniform_qualifier and flow control rejoining

Open
#39 1 comment 0 reactions 0 assignees View on GitHub
Vulkan
Dominant language
JavaScript
Stars
458
Forks
114
Avg merge
4m
Merged PRs (30d)
1

Description

cc @sheredom

Consider this example:

```
subgroupuniformEXT int x;
if ((gl_InvocationID & 1) != 0) {
x = 0
} else {
x = 1
}
use x;
```

Both assignments can be correctly decorated as Uniform in the SPIR-V, but when the if and else blocks rejoin there would be an OpPhi in the SPIR-V that is not Uniform. It seems like the GLSL extension spec doesn't clarify what happens in this case. Is it an error? Undefined behavior? Does the frontend compiler stop propagating Uniform when flow control rejoins?

Contributor guide

Open the contributing guide

Research direction

Begin by reading the GL_EXT_subgroupuniform_qualifier extension specification and the SPIR-V rules for the shown if/else rejoin and OpPhi. Compare the example's Uniform decorations with the specification to determine whether the behavior is an error, undefined, or requires a defined propagation rule; done means the specification clearly answers this case.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.