Bug 256724 - [WebGPU][WGSL] sampling a texture_external should expand to two samples
Summary: [WebGPU][WGSL] sampling a texture_external should expand to two samples
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tadeu Zagallo
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-05-12 11:27 PDT by Mike Wyrzykowski
Modified: 2023-05-17 02:52 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Wyrzykowski 2023-05-12 11:27:07 PDT
In WGSL if we have:

  texture_external t;
  vec4<f32> result = textureSampleBaseClampToEdge(t, sampler, normalizedCoordinates);

or:

  texture_external t;
  vec4<f32> result = textureLoad(t, pixelCoordinates, levelOfDetail);


we should expand this to:

    auto coords = t_UVRemapMatrix * normalizedCoordinates;
    auto y = t_FirstPlane.sample(sampler, coords).r;
    auto cbcr = t_SecondPlane.sample(sampler, coords).rg;
    auto ycbcr = float3(y, cbcr);
    float4 result = float4(t_ColorSpaceConversionMatrix * float4(ycbcr, 1), 1);
    

or:
   
    auto coords = t_UVRemapMatrix * pixelCoordinates;
    auto y = t_FirstPlane.read(coords, levelOfDetail).r;
    auto cbcr = t_SecondPlane.read(sampler, levelOfDetail).rg;
    auto ycbcr = float3(y, cbcr);
    float4 result = float4(t_ColorSpaceConversionMatrix * float4(ycbcr, 1), 1);
Comment 1 Radar WebKit Bug Importer 2023-05-12 11:27:32 PDT
<rdar://problem/109273173>
Comment 2 Tadeu Zagallo 2023-05-16 05:49:50 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13916
Comment 3 EWS 2023-05-17 02:52:00 PDT
Committed 264141@main (6c82c6b0b152): <https://commits.webkit.org/264141@main>

Reviewed commits have been landed. Closing PR #13916 and removing active labels.