这是indexloc提供的服务,不要输入任何密码
Skip to content

Uniformity Analysis - Account for break if expression uniformity #5277

@JamesLee-Jones

Description

@JamesLee-Jones

The rule for analysing the uniformity of break if statements (here) currently throws away the value node V representing the uniformity of the expression. This leads the following shader to be incorrectly accepted as uniform under the analysis in the language spec, making it unsound:

@compute @workgroup_size(16)
fn main(@builtin(local_invocation_index) lid: u32) {
  loop {
      workgroupBarrier();
      continuing {
        break if lid < 0;
      }
    }

}

It seems that the rule for break if statements should add an edge from CF' to V to signify that the uniformity going forward depends on the uniformity of V. This appears to be the approach that tint takes which leads it to correctly identify this example as non-uniform.

Metadata

Metadata

Assignees

Labels

wgslWebGPU Shading Language Issueswgsl resolvedResolved - waiting for a change to the WGSL specification

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions