<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>263393</bug_id>
          
          <creation_ts>2023-10-19 13:04:14 -0700</creation_ts>
          <short_desc>[WGSL] frag_depth on return value does not generate depth(any) attribution</short_desc>
          <delta_ts>2023-10-30 09:42:21 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebGPU</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mike Wyrzykowski">mwyrzykowski</reporter>
          <assigned_to name="Tadeu Zagallo">tzagallo</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1986222</commentid>
    <comment_count>0</comment_count>
    <who name="Mike Wyrzykowski">mwyrzykowski</who>
    <bug_when>2023-10-19 13:04:14 -0700</bug_when>
    <thetext>Given the following shader:

            @group(0) @binding(0) var inputTexture: texture_2d&lt;f32&gt;;
            @fragment fn main(@builtin(position) fragcoord : vec4&lt;f32&gt;) -&gt;
              @builtin(frag_depth) f32 {
              var depthValue : vec4&lt;f32&gt; = textureLoad(inputTexture, vec2&lt;i32&gt;(fragcoord.xy), 0);
              return depthValue.x;
            }

@builtin(frag_depth) appears to be ignored when the metal code is generated:


[[fragment]] float function0(vec&lt;float, 4&gt; parameter0 [[position]], constant __ArgumentBufferT_0&amp; __ArgumentBuffer_0 [[buffer(0)]])
{
    texture2d&lt;float, access::sample&gt; global0 = __ArgumentBuffer_0.global0;
    vec&lt;float, 4&gt; local0 = global0.read(uint2(vec&lt;int, 2&gt;(parameter0.xy)), 0);
    return local0.x;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1986223</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-19 13:04:37 -0700</bug_when>
    <thetext>&lt;rdar://problem/117221582&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987971</commentid>
    <comment_count>2</comment_count>
    <who name="Tadeu Zagallo">tzagallo</who>
    <bug_when>2023-10-27 06:05:20 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/19635</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1988535</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-10-30 09:42:20 -0700</bug_when>
    <thetext>Committed 269950@main (fbd53e5fa81a): &lt;https://commits.webkit.org/269950@main&gt;

Reviewed commits have been landed. Closing PR #19635 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>