[Webkit-unassigned] [Bug 278946] New: [WGSL] [[position]] should be initialized to (0, 0, 0, 1) instead of (0, 0, 0, 0)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 30 13:59:48 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=278946

            Bug ID: 278946
           Summary: [WGSL] [[position]] should be initialized to (0,0,0,1)
                    instead of (0,0,0,0)
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebGPU
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mwyrzykowski at apple.com
                CC: mwyrzykowski at apple.com, tzagallo at apple.com

Since position performs an effective division https://www.w3.org/TR/WGSL/#position-builtin-value

its default initializer should be 0,0,0,1 instead of 0,0,0,0. Otherwise this result is undefined, as v.position is not written to. Specifically, on Apple Silicon it renders the pixel but on AMD / Intel, the render is skipped because (x,y,z)/w = (0,0,0)/0 = inf:

struct VertexOutput {
  @builtin(position) position : vec4f,
  @location(0) @interpolate(flat) something: u32,
}

@vertex
fn v(@location(0) fromVertexBuffer: u32) -> VertexOutput {
  var v = VertexOutput();
  v.something = fromVertexBuffer;
  return v;
}

@fragment
fn f(@location(0) @interpolate(flat) something: u32) -> @location(0) u32 {
  return something;
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240830/7780262d/attachment.htm>


More information about the webkit-unassigned mailing list