Changeset 238629 in webkit


Ignore:
Timestamp:
Nov 28, 2018 12:53:17 PM (5 years ago)
Author:
Justin Fan
Message:

[WebGPU] Begin implementation of WebGPURenderPassEncoder and barebones WebGPURenderPassDescriptor
https://bugs.webkit.org/show_bug.cgi?id=191990

Reviewed by Dean Jackson.

Source/WebCore:

Begin implementation of WebGPURenderPassEncoder and its parent interface, WebGPUProgrammablePassEncoder.
Also add code to allow creation of a primitive WebGPURenderPassDescriptor with the sole purpose of providing
a WebGPUTextureView reference to the render pass creation function, WebGPUCommandBuffer::beginRenderPass().

Test: webgpu/render-passes.html

  • CMakeLists.txt:
  • DerivedSources.make:
  • Modules/webgpu/WebGPUCommandBuffer.cpp:

(WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
(WebCore::WebGPUCommandBuffer::beginRenderPass): Added. Returns a WebGPURenderPassEncoder upon success.

  • Modules/webgpu/WebGPUCommandBuffer.h:
  • Modules/webgpu/WebGPUCommandBuffer.idl:
  • Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Added.
  • Modules/webgpu/WebGPUProgrammablePassEncoder.h: Added.
  • Modules/webgpu/WebGPUProgrammablePassEncoder.idl: Added. Empty (for now) interface parenting WebGPURenderPassEncoder.
  • Modules/webgpu/WebGPURenderPassDescriptor.h:
  • Modules/webgpu/WebGPURenderPassDescriptor.idl: Added. Directly handles a WebGPUTextureView attachment; all other color attachment properties set by implementation for now.
  • Modules/webgpu/WebGPURenderPassEncoder.cpp: Added.

(WebCore::WebGPURenderPassEncoder::create):
(WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
(WebCore::WebGPURenderPassEncoder::passEncoder const):

  • Modules/webgpu/WebGPURenderPassEncoder.h: Added. Interface to GPURenderPassEncoder.
  • Modules/webgpu/WebGPURenderPassEncoder.idl: Added. Allows WebGPU developer to encode commands for the WebGPUCommandBuffer.
  • Modules/webgpu/WebGPUTextureView.cpp:

(WebCore::WebGPUTextureView::WebGPUTextureView):

  • Modules/webgpu/WebGPUTextureView.h:

(WebCore::WebGPUTextureView::texture):

  • Sources.txt:
  • SourcesCocoa.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/WebCoreBuiltinNames.h:
  • platform/graphics/gpu/GPUCommandBuffer.h:

(WebCore::GPUCommandBuffer::platformCommandBuffer const):

  • platform/graphics/gpu/GPUProgrammablePassEncoder.h: Added. Base class for GPURenderPassEncoder.
  • platform/graphics/gpu/GPURenderPassDescriptor.h: Added.
  • platform/graphics/gpu/GPURenderPassEncoder.h: Added. Wrapper class for MTLRenderCommandEncoder.
  • platform/graphics/gpu/GPUTexture.h:

(WebCore::GPUTexture::platformTexture const):

  • platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Added.
  • platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Added.

(WebCore::GPURenderPassEncoder::create): Creates the backing MTLRenderCommandEncoder; returns null if this fails.
(WebCore::GPURenderPassEncoder::GPURenderPassEncoder):
(WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): End encoding before destroying the MTLCommandEncoder to prevent an exception.
(WebCore::GPURenderPassEncoder::platformPassEncoder const):

LayoutTests:

Add tests to ensure proper WebGPURenderPassEncoder creation. To be updated as WebGPURenderPassDescriptor is updated.

  • webgpu/js/basic-webgpu-functions.js:

(render):

  • webgpu/render-passes-expected.txt: Added.
  • webgpu/render-passes.html: Added.
Location:
trunk
Files:
3 added
16 edited
12 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r238628 r238629  
     12018-11-28  Justin Fan  <justin_fan@apple.com>
     2
     3        [WebGPU] Begin implementation of WebGPURenderPassEncoder and barebones WebGPURenderPassDescriptor
     4        https://bugs.webkit.org/show_bug.cgi?id=191990
     5
     6        Reviewed by Dean Jackson.
     7
     8        Add tests to ensure proper WebGPURenderPassEncoder creation. To be updated as WebGPURenderPassDescriptor is updated.
     9
     10        * webgpu/js/basic-webgpu-functions.js:
     11        (render):
     12        * webgpu/render-passes-expected.txt: Added.
     13        * webgpu/render-passes.html: Added.
     14
    1152018-11-28  Rob Buis  <rbuis@igalia.com>
    216
  • trunk/LayoutTests/webgpu/js/basic-webgpu-functions.js

    r238382 r238629  
    138138    }
    139139
     140    // FIXME: Flesh out the rest of WebGPURenderPassDescriptor.
     141    // Default a loadOp, storeOp, and clearColor in the implementation for now.
     142    let renderPassDescriptor = {
     143        attachment : textureView
     144    }
     145
     146    let renderPassEncoder = commandBuffer.beginRenderPass(renderPassDescriptor);
     147    if (!renderPassEncoder) {
     148        testFailed("Could not create WebGPURenderPassEncoder!");
     149        return;
     150    }
     151
    140152    // FIXME: Rest of rendering commands to follow.
    141153}
  • trunk/Source/WebCore/CMakeLists.txt

    r238451 r238629  
    463463    Modules/webgpu/WebGPUPipelineDescriptorBase.idl
    464464    Modules/webgpu/WebGPUPipelineStageDescriptor.idl
     465    Modules/webgpu/WebGPUProgrammablePassEncoder.idl
    465466    Modules/webgpu/WebGPUQueue.idl
     467    Modules/webgpu/WebGPURenderPassDescriptor.idl
     468    Modules/webgpu/WebGPURenderPassEncoder.idl
    466469    Modules/webgpu/WebGPURenderPipeline.idl
    467470    Modules/webgpu/WebGPURenderPipelineDescriptor.idl
  • trunk/Source/WebCore/ChangeLog

    r238628 r238629  
     12018-11-28  Justin Fan  <justin_fan@apple.com>
     2
     3        [WebGPU] Begin implementation of WebGPURenderPassEncoder and barebones WebGPURenderPassDescriptor
     4        https://bugs.webkit.org/show_bug.cgi?id=191990
     5
     6        Reviewed by Dean Jackson.
     7
     8        Begin implementation of WebGPURenderPassEncoder and its parent interface, WebGPUProgrammablePassEncoder.
     9        Also add code to allow creation of a primitive WebGPURenderPassDescriptor with the sole purpose of providing
     10        a WebGPUTextureView reference to the render pass creation function, WebGPUCommandBuffer::beginRenderPass().
     11
     12        Test: webgpu/render-passes.html
     13
     14        * CMakeLists.txt:
     15        * DerivedSources.make:
     16        * Modules/webgpu/WebGPUCommandBuffer.cpp:
     17        (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
     18        (WebCore::WebGPUCommandBuffer::beginRenderPass): Added. Returns a WebGPURenderPassEncoder upon success.
     19        * Modules/webgpu/WebGPUCommandBuffer.h:
     20        * Modules/webgpu/WebGPUCommandBuffer.idl:
     21        * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Added.
     22        * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Added.
     23        * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: Added. Empty (for now) interface parenting WebGPURenderPassEncoder.
     24        * Modules/webgpu/WebGPURenderPassDescriptor.h:
     25        * Modules/webgpu/WebGPURenderPassDescriptor.idl: Added. Directly handles a WebGPUTextureView attachment; all other color attachment properties set by implementation for now.
     26        * Modules/webgpu/WebGPURenderPassEncoder.cpp: Added.
     27        (WebCore::WebGPURenderPassEncoder::create):
     28        (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
     29        (WebCore::WebGPURenderPassEncoder::passEncoder const):
     30        * Modules/webgpu/WebGPURenderPassEncoder.h: Added. Interface to GPURenderPassEncoder.
     31        * Modules/webgpu/WebGPURenderPassEncoder.idl: Added. Allows WebGPU developer to encode commands for the WebGPUCommandBuffer.
     32        * Modules/webgpu/WebGPUTextureView.cpp:
     33        (WebCore::WebGPUTextureView::WebGPUTextureView):
     34        * Modules/webgpu/WebGPUTextureView.h:
     35        (WebCore::WebGPUTextureView::texture):
     36        * Sources.txt:
     37        * SourcesCocoa.txt:
     38        * WebCore.xcodeproj/project.pbxproj:
     39        * bindings/js/WebCoreBuiltinNames.h:
     40        * platform/graphics/gpu/GPUCommandBuffer.h:
     41        (WebCore::GPUCommandBuffer::platformCommandBuffer const):
     42        * platform/graphics/gpu/GPUProgrammablePassEncoder.h: Added. Base class for GPURenderPassEncoder.
     43        * platform/graphics/gpu/GPURenderPassDescriptor.h: Added.
     44        * platform/graphics/gpu/GPURenderPassEncoder.h: Added. Wrapper class for MTLRenderCommandEncoder.
     45        * platform/graphics/gpu/GPUTexture.h:
     46        (WebCore::GPUTexture::platformTexture const):
     47        * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Added.
     48        * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Added.
     49        (WebCore::GPURenderPassEncoder::create): Creates the backing MTLRenderCommandEncoder; returns null if this fails.
     50        (WebCore::GPURenderPassEncoder::GPURenderPassEncoder):
     51        (WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): End encoding before destroying the MTLCommandEncoder to prevent an exception.
     52        (WebCore::GPURenderPassEncoder::platformPassEncoder const):
     53
    1542018-11-28  Rob Buis  <rbuis@igalia.com>
    255
  • trunk/Source/WebCore/DerivedSources.make

    r238451 r238629  
    381381    $(WebCore)/Modules/webgpu/WebGPUPipelineDescriptorBase.idl \
    382382    $(WebCore)/Modules/webgpu/WebGPUPipelineStageDescriptor.idl \
     383    $(WebCore)/Modules/webgpu/WebGPUProgrammablePassEncoder.idl \
     384    $(WebCore)/Modules/webgpu/WebGPURenderPassDescriptor.idl \
     385    $(WebCore)/Modules/webgpu/WebGPURenderPassEncoder.idl \
    383386    $(WebCore)/Modules/webgpu/WebGPURenderPipeline.idl \
    384387    $(WebCore)/Modules/webgpu/WebGPURenderPipelineDescriptor.idl \
  • trunk/Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp

    r238245 r238629  
    3030
    3131#include "GPUCommandBuffer.h"
     32#include "GPURenderPassDescriptor.h"
     33#include "GPURenderPassEncoder.h"
     34#include "Logging.h"
     35#include "WebGPURenderPassDescriptor.h"
     36#include "WebGPURenderPassEncoder.h"
    3237
    3338namespace WebCore {
     
    4449    : m_commandBuffer(WTFMove(buffer))
    4550{
    46     UNUSED_PARAM(m_commandBuffer);
    4751}
     52
     53RefPtr<WebGPURenderPassEncoder> WebGPUCommandBuffer::beginRenderPass(WebGPURenderPassDescriptor&& descriptor)
     54{
     55    // FIXME: Improve error checking as WebGPURenderPassDescriptor is implemented.
     56    if (!descriptor.attachment) {
     57        LOG(WebGPU, "WebGPUCommandBuffer::create(): No attachment specified for WebGPURenderPassDescriptor!");
     58        return nullptr;
     59    }
     60   
     61    auto encoder = GPURenderPassEncoder::create(m_commandBuffer.get(), GPURenderPassDescriptor { descriptor.attachment->texture() });
     62
     63    if (!encoder)
     64        return nullptr;
     65
     66    return WebGPURenderPassEncoder::create(encoder.releaseNonNull());
     67}
     68
    4869} // namespace WebCore
    4970
  • trunk/Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h

    r238451 r238629  
    3535
    3636class GPUCommandBuffer;
     37class WebGPURenderPassEncoder;
     38
     39struct WebGPURenderPassDescriptor;
    3740
    3841class WebGPUCommandBuffer : public RefCounted<WebGPUCommandBuffer> {
     
    4144
    4245    const GPUCommandBuffer& commandBuffer() const { return m_commandBuffer.get(); }
     46    RefPtr<WebGPURenderPassEncoder> beginRenderPass(WebGPURenderPassDescriptor&&);
    4347
    4448private:
  • trunk/Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl

    r238245 r238629  
    3030    ImplementationLacksVTable
    3131] interface WebGPUCommandBuffer {
     32    WebGPURenderPassEncoder beginRenderPass(WebGPURenderPassDescriptor descriptor);
     33
    3234/* Not Yet Implemented
    33     WebGPURenderPassEncoder beginRenderPass(WebGPURenderPassDescriptor descriptor);
    3435    WebGPUComputePassEncoder beginComputePass();
    3536
  • trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.cpp

    r238628 r238629  
    2525
    2626#include "config.h"
    27 #include "WebGPUTextureView.h"
     27#include "WebGPUProgrammablePassEncoder.h"
    2828
    2929#if ENABLE(WEBGPU)
     
    3131namespace WebCore {
    3232
    33 Ref<WebGPUTextureView> WebGPUTextureView::create(Ref<GPUTexture>&& view)
    34 {
    35     return adoptRef(*new WebGPUTextureView(WTFMove(view)));
    36 }
    37 
    38 WebGPUTextureView::WebGPUTextureView(Ref<GPUTexture>&& view)
    39     : m_textureView(WTFMove(view))
    40 {
    41     UNUSED_PARAM(m_textureView);
    42 }
    43 
    4433} // namespace WebCore
    4534
    4635#endif // ENABLE(WEBGPU)
    47 
  • trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.h

    r238628 r238629  
    2828#if ENABLE(WEBGPU)
    2929
    30 #include "GPUTexture.h"
    31 
    3230#include <wtf/RefCounted.h>
    3331
    3432namespace WebCore {
    3533
    36 class WebGPUTextureView : public RefCounted<WebGPUTextureView> {
     34class GPUProgrammablePassEncoder;
     35
     36class WebGPUProgrammablePassEncoder : public RefCounted<WebGPUProgrammablePassEncoder> {
    3737public:
    38     static Ref<WebGPUTextureView> create(Ref<GPUTexture>&&);
     38    virtual ~WebGPUProgrammablePassEncoder() = default;
    3939
    40 private:
    41     explicit WebGPUTextureView(Ref<GPUTexture>&&);
    42    
    43     Ref<GPUTexture> m_textureView;
     40protected:
     41    virtual GPUProgrammablePassEncoder& passEncoder() const = 0;
    4442};
    4543
  • trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.idl

    r238628 r238629  
    2323 * THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
     25// https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
    2526
    26 #pragma once
    27 
    28 #if ENABLE(WEBGPU)
    29 
    30 #include "GPUTexture.h"
    31 
    32 #include <wtf/RefCounted.h>
    33 
    34 namespace WebCore {
    35 
    36 class WebGPUTextureView : public RefCounted<WebGPUTextureView> {
    37 public:
    38     static Ref<WebGPUTextureView> create(Ref<GPUTexture>&&);
    39 
    40 private:
    41     explicit WebGPUTextureView(Ref<GPUTexture>&&);
    42    
    43     Ref<GPUTexture> m_textureView;
     27[
     28    Conditional=WEBGPU,
     29    EnabledAtRuntime=WebGPU,
     30    SkipVTableValidation
     31] interface WebGPUProgrammablePassEncoder {
     32/* Not Yet Implemented
     33    WebGPUCommandBuffer endPass();
     34    // Allowed in both compute and render passes
     35    // TODO: setPushConstants() ?
     36    void setBindGroup(u32 index, WebGPUBindGroup bindGroup);
     37    void setPipeline((WebGPUComputePipeline or WebGPURenderPipeline) pipeline);
     38*/
    4439};
    45 
    46 } // namespace WebCore
    47 
    48 #endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassDescriptor.h

    r238628 r238629  
    2828#if ENABLE(WEBGPU)
    2929
    30 #include "GPUTexture.h"
    31 
    32 #include <wtf/RefCounted.h>
     30#include "WebGPUTextureView.h"
    3331
    3432namespace WebCore {
    3533
    36 class WebGPUTextureView : public RefCounted<WebGPUTextureView> {
    37 public:
    38     static Ref<WebGPUTextureView> create(Ref<GPUTexture>&&);
    39 
    40 private:
    41     explicit WebGPUTextureView(Ref<GPUTexture>&&);
    42    
    43     Ref<GPUTexture> m_textureView;
     34struct WebGPURenderPassDescriptor {
     35    // FIXME: Temporary shortcut implementation for prototyping.
     36    RefPtr<WebGPUTextureView> attachment;
    4437};
    4538
  • trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassDescriptor.idl

    r238628 r238629  
    2323 * THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
     25// https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
    2526
    26 #pragma once
     27[
     28    Conditional=WEBGPU,
     29    EnabledAtRuntime=WebGPU
     30] dictionary WebGPURenderPassDescriptor {
     31    // FIXME: Temporary shortcut implementation for prototyping.
     32    WebGPUTextureView attachment;
    2733
    28 #if ENABLE(WEBGPU)
    29 
    30 #include "GPUTexture.h"
    31 
    32 #include <wtf/RefCounted.h>
    33 
    34 namespace WebCore {
    35 
    36 class WebGPUTextureView : public RefCounted<WebGPUTextureView> {
    37 public:
    38     static Ref<WebGPUTextureView> create(Ref<GPUTexture>&&);
    39 
    40 private:
    41     explicit WebGPUTextureView(Ref<GPUTexture>&&);
    42    
    43     Ref<GPUTexture> m_textureView;
     34/* Not Yet Implemented:
     35    sequence<WebGPURenderPassColorAttachmentDescriptor> colorAttachments;
     36    WebGPURenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
     37*/
    4438};
    45 
    46 } // namespace WebCore
    47 
    48 #endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.cpp

    r238628 r238629  
    2525
    2626#include "config.h"
    27 #include "WebGPUCommandBuffer.h"
     27#include "WebGPURenderPassEncoder.h"
    2828
    2929#if ENABLE(WEBGPU)
    3030
    31 #include "GPUCommandBuffer.h"
     31#include "GPUProgrammablePassEncoder.h"
    3232
    3333namespace WebCore {
    3434
    35 RefPtr<WebGPUCommandBuffer> WebGPUCommandBuffer::create(RefPtr<GPUCommandBuffer>&& buffer)
     35Ref<WebGPURenderPassEncoder> WebGPURenderPassEncoder::create(Ref<GPURenderPassEncoder>&& encoder)
    3636{
    37     if (!buffer)
    38         return nullptr;
    39 
    40     return adoptRef(new WebGPUCommandBuffer(buffer.releaseNonNull()));
     37    return adoptRef(*new WebGPURenderPassEncoder(WTFMove(encoder)));
    4138}
    4239
    43 WebGPUCommandBuffer::WebGPUCommandBuffer(Ref<GPUCommandBuffer>&& buffer)
    44     : m_commandBuffer(WTFMove(buffer))
     40WebGPURenderPassEncoder::WebGPURenderPassEncoder(Ref<GPURenderPassEncoder>&& encoder)
     41    : m_passEncoder(WTFMove(encoder))
    4542{
    46     UNUSED_PARAM(m_commandBuffer);
    4743}
     44
     45GPUProgrammablePassEncoder& WebGPURenderPassEncoder::passEncoder() const
     46{
     47    return m_passEncoder.get();
     48}
     49
    4850} // namespace WebCore
    4951
  • trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.h

    r238628 r238629  
    2828#if ENABLE(WEBGPU)
    2929
    30 #include <wtf/Ref.h>
    31 #include <wtf/RefCounted.h>
     30#include "GPURenderPassEncoder.h"
     31#include "WebGPUProgrammablePassEncoder.h"
     32
    3233#include <wtf/RefPtr.h>
    3334
    3435namespace WebCore {
    3536
    36 class GPUCommandBuffer;
     37class GPUProgrammablePassEncoder;
    3738
    38 class WebGPUCommandBuffer : public RefCounted<WebGPUCommandBuffer> {
     39class WebGPURenderPassEncoder final : public WebGPUProgrammablePassEncoder {
    3940public:
    40     static RefPtr<WebGPUCommandBuffer> create(RefPtr<GPUCommandBuffer>&&);
    41 
    42     const GPUCommandBuffer& commandBuffer() const { return m_commandBuffer.get(); }
     41    static Ref<WebGPURenderPassEncoder> create(Ref<GPURenderPassEncoder>&&);
    4342
    4443private:
    45     WebGPUCommandBuffer(Ref<GPUCommandBuffer>&&);
     44    WebGPURenderPassEncoder(Ref<GPURenderPassEncoder>&&);
    4645
    47     Ref<GPUCommandBuffer> m_commandBuffer;
     46    GPUProgrammablePassEncoder& passEncoder() const final;
     47
     48    Ref<GPURenderPassEncoder> m_passEncoder;
    4849};
    4950
  • trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.idl

    r238628 r238629  
    2323 * THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
     25// https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
    2526
    26 #pragma once
     27[
     28    Conditional=WEBGPU,
     29    EnabledAtRuntime=WebGPU
     30] interface WebGPURenderPassEncoder : WebGPUProgrammablePassEncoder {
     31/* Not Yet Implemented
     32    void setBlendColor(float r, float g, float b, float a);
     33    void setIndexBuffer(WebGPUBuffer buffer, u32 offset);
     34    void setVertexBuffers(u32 startSlot, sequence<WebGPUBuffer> buffers, sequence<u32> offsets);
    2735
    28 #if ENABLE(WEBGPU)
     36    void draw(u32 vertexCount, u32 instanceCount, u32 firstVertex, u32 firstInstance);
     37    void drawIndexed(u32 indexCount, u32 instanceCount, u32 firstIndex, i32 baseVertex, u32 firstInstance);
    2938
    30 #include "GPUTexture.h"
    31 
    32 #include <wtf/RefCounted.h>
    33 
    34 namespace WebCore {
    35 
    36 class WebGPUTextureView : public RefCounted<WebGPUTextureView> {
    37 public:
    38     static Ref<WebGPUTextureView> create(Ref<GPUTexture>&&);
    39 
    40 private:
    41     explicit WebGPUTextureView(Ref<GPUTexture>&&);
    42    
    43     Ref<GPUTexture> m_textureView;
     39    // TODO add missing commands
     40*/
    4441};
    45 
    46 } // namespace WebCore
    47 
    48 #endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/Modules/webgpu/WebGPUTextureView.cpp

    r238382 r238629  
    3737
    3838WebGPUTextureView::WebGPUTextureView(Ref<GPUTexture>&& view)
    39     : m_textureView(WTFMove(view))
     39    : m_texture(WTFMove(view))
    4040{
    41     UNUSED_PARAM(m_textureView);
    4241}
    4342
  • trunk/Source/WebCore/Modules/webgpu/WebGPUTextureView.h

    r238382 r238629  
    3838    static Ref<WebGPUTextureView> create(Ref<GPUTexture>&&);
    3939
     40    Ref<GPUTexture> texture() { return m_texture.copyRef(); }
    4041private:
    4142    explicit WebGPUTextureView(Ref<GPUTexture>&&);
    4243   
    43     Ref<GPUTexture> m_textureView;
     44    Ref<GPUTexture> m_texture;
    4445};
    4546
  • trunk/Source/WebCore/Sources.txt

    r238538 r238629  
    307307Modules/webgpu/WebGPUDevice.cpp
    308308Modules/webgpu/WebGPUQueue.cpp
     309Modules/webgpu/WebGPUProgrammablePassEncoder.cpp
    309310Modules/webgpu/WebGPURenderingContext.cpp
     311Modules/webgpu/WebGPURenderPassEncoder.cpp
    310312Modules/webgpu/WebGPURenderPipeline.cpp
    311313Modules/webgpu/WebGPUShaderModule.cpp
     
    32223224JSWebGPUPipelineDescriptorBase.cpp
    32233225JSWebGPUPipelineStageDescriptor.cpp
     3226JSWebGPUProgrammablePassEncoder.cpp
    32243227JSWebGPURenderingContext.cpp
     3228JSWebGPURenderPassDescriptor.cpp
     3229JSWebGPURenderPassEncoder.cpp
    32253230JSWebGPURenderPipeline.cpp
    32263231JSWebGPURenderPipelineDescriptor.cpp
  • trunk/Source/WebCore/SourcesCocoa.txt

    r238434 r238629  
    321321platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm
    322322platform/graphics/gpu/cocoa/GPUDeviceMetal.mm
     323platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm
    323324platform/graphics/gpu/cocoa/GPUQueueMetal.mm
     325platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm
    324326platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm
    325327platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r238538 r238629  
    68756875                312FF8C421A4C2F400EB199D /* GPUPipelineDescriptorBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUPipelineDescriptorBase.h; sourceTree = "<group>"; };
    68766876                312FF8C521A4C2F400EB199D /* GPUTexture.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUTexture.h; sourceTree = "<group>"; };
    6877                 312FF8C721A4C32500EB199D /* GPUQueueMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = GPUQueueMetal.mm; path = platform/graphics/gpu/cocoa/GPUQueueMetal.mm; sourceTree = SOURCE_ROOT; };
    6878                 312FF8C821A4C32500EB199D /* GPUTextureMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = GPUTextureMetal.mm; path = platform/graphics/gpu/cocoa/GPUTextureMetal.mm; sourceTree = SOURCE_ROOT; };
    6879                 312FF8C921A4C32600EB199D /* GPUDeviceMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = GPUDeviceMetal.mm; path = platform/graphics/gpu/cocoa/GPUDeviceMetal.mm; sourceTree = SOURCE_ROOT; };
    6880                 312FF8CA21A4C32600EB199D /* GPUShaderModuleMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = GPUShaderModuleMetal.mm; path = platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm; sourceTree = SOURCE_ROOT; };
    6881                 312FF8CB21A4C32700EB199D /* GPUSwapChainMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = GPUSwapChainMetal.mm; path = platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm; sourceTree = SOURCE_ROOT; };
    6882                 312FF8CC21A4C32700EB199D /* GPUCommandBufferMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = GPUCommandBufferMetal.mm; path = platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm; sourceTree = SOURCE_ROOT; };
    6883                 312FF8CD21A4C32800EB199D /* GPURenderPipelineMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = GPURenderPipelineMetal.mm; path = platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm; sourceTree = SOURCE_ROOT; };
    68846877                312FF8CF21A4C33F00EB199D /* GPULegacyTextureDescriptor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPULegacyTextureDescriptor.cpp; sourceTree = "<group>"; };
    68856878                312FF8D021A4C33F00EB199D /* GPULegacyRenderPipelineDescriptor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPULegacyRenderPipelineDescriptor.cpp; sourceTree = "<group>"; };
     
    69506943                312FF93B21A61CA000EB199D /* WebGPUQueue.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGPUQueue.idl; sourceTree = "<group>"; };
    69516944                312FF93C21A61CA100EB199D /* WebGPUQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUQueue.cpp; sourceTree = "<group>"; };
    6952                 312FF93D21A61F0700EB199D /* JSWebGPUQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebGPUQueue.h; path = JSWebGPUQueue.h; sourceTree = "<group>"; };
    6953                 312FF93E21A61F0700EB199D /* JSWebGPUQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebGPUQueue.cpp; path = JSWebGPUQueue.cpp; sourceTree = "<group>"; };
     6945                312FF93D21A61F0700EB199D /* JSWebGPUQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGPUQueue.h; sourceTree = "<group>"; };
     6946                312FF93E21A61F0700EB199D /* JSWebGPUQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPUQueue.cpp; sourceTree = "<group>"; };
    69546947                313171541FB079D1008D91FC /* CanvasBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasBase.h; sourceTree = "<group>"; };
    69556948                313171571FB0969E008D91FC /* CanvasBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasBase.cpp; sourceTree = "<group>"; };
     
    69886981                314BE3A51B3103FB00141982 /* NamedImageGeneratedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NamedImageGeneratedImage.h; sourceTree = "<group>"; };
    69896982                315574CC218F66D000D88F66 /* PointerEventIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PointerEventIOS.cpp; sourceTree = "<group>"; };
    6990                 316BDB881E6E141C00DE0D5A /* GPULegacyDeviceMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyDeviceMetal.mm; sourceTree = "<group>"; };
    69916983                316BDB8A1E6E153000DE0D5A /* WebMetalLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMetalLayer.h; sourceTree = "<group>"; };
    6992                 316BDB961E70CA2400DE0D5A /* GPULegacyFunctionMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyFunctionMetal.mm; sourceTree = "<group>"; };
    6993                 316BDB9C1E70CD9000DE0D5A /* GPULegacyLibraryMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyLibraryMetal.mm; sourceTree = "<group>"; };
    6994                 316BDBA51E71FA6F00DE0D5A /* GPULegacyBufferMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyBufferMetal.mm; sourceTree = "<group>"; };
    6995                 316BDBB31E7357B000DE0D5A /* GPULegacyTextureDescriptorMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyTextureDescriptorMetal.mm; sourceTree = "<group>"; };
    6996                 316BDBBD1E73881300DE0D5A /* GPULegacyCommandQueueMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyCommandQueueMetal.mm; sourceTree = "<group>"; };
    6997                 316BDBC61E75EE3D00DE0D5A /* GPULegacyCommandBufferMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyCommandBufferMetal.mm; sourceTree = "<group>"; };
    6998                 316BDBC91E75F16200DE0D5A /* GPULegacyDrawableMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyDrawableMetal.mm; sourceTree = "<group>"; };
    6999                 316BDBD41E75F7CA00DE0D5A /* GPULegacyRenderPassDescriptorMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyRenderPassDescriptorMetal.mm; sourceTree = "<group>"; };
    7000                 316BDBD61E7612C400DE0D5A /* GPULegacyRenderPassColorAttachmentDescriptorMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyRenderPassColorAttachmentDescriptorMetal.mm; sourceTree = "<group>"; };
    7001                 316BDBE01E761CB500DE0D5A /* GPULegacyRenderPassAttachmentDescriptorMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyRenderPassAttachmentDescriptorMetal.mm; sourceTree = "<group>"; };
    7002                 316BDBE61E761F2700DE0D5A /* GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm; sourceTree = "<group>"; };
    7003                 316BDBEC1E76246B00DE0D5A /* GPULegacyRenderCommandEncoderMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyRenderCommandEncoderMetal.mm; sourceTree = "<group>"; };
    7004                 316BDBF21E76293700DE0D5A /* GPULegacyDepthStencilStateMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyDepthStencilStateMetal.mm; sourceTree = "<group>"; };
    7005                 316BDBF81E762BEF00DE0D5A /* GPULegacyDepthStencilDescriptorMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyDepthStencilDescriptorMetal.mm; sourceTree = "<group>"; };
    7006                 316BDC041E762F7E00DE0D5A /* GPULegacyRenderPipelineDescriptorMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyRenderPipelineDescriptorMetal.mm; sourceTree = "<group>"; };
    7007                 316BDC051E762F7E00DE0D5A /* GPULegacyRenderPipelineStateMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyRenderPipelineStateMetal.mm; sourceTree = "<group>"; };
    7008                 316BDC0A1E76343600DE0D5A /* GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm; sourceTree = "<group>"; };
    70096984                316DCB121E78BE43001B5F87 /* RTCOfferAnswerOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCOfferAnswerOptions.idl; sourceTree = "<group>"; };
    70106985                316DCB171E78C330001B5F87 /* RTCRtpTransceiverDirection.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RTCRtpTransceiverDirection.idl; sourceTree = "<group>"; };
     
    72887263                381E35E71E8E1E0A0043E850 /* WebGPUComputeCommandEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGPUComputeCommandEncoder.h; sourceTree = "<group>"; };
    72897264                381E35E81E8E1E160043E850 /* WebGPUComputeCommandEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUComputeCommandEncoder.cpp; sourceTree = "<group>"; };
    7290                 381E35E91E8E20AC0043E850 /* GPULegacyComputeCommandEncoderMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyComputeCommandEncoderMetal.mm; sourceTree = "<group>"; };
    7291                 381E35EE1E8E24CB0043E850 /* GPULegacyComputePipelineStateMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyComputePipelineStateMetal.mm; sourceTree = "<group>"; };
    72927265                381E35EF1E8E3D7F0043E850 /* WebGPUSize.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGPUSize.idl; sourceTree = "<group>"; };
    72937266                381E35F51E8E4C420043E850 /* WebGPUSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGPUSize.h; sourceTree = "<group>"; };
     
    1387213845                D02F858721682AA70088EE74 /* WebMetalRenderingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebMetalRenderingContext.cpp; sourceTree = "<group>"; };
    1387313846                D02F858821682AA80088EE74 /* WebMetalFunction.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebMetalFunction.idl; sourceTree = "<group>"; };
     13847                D03211CE21AC954E00763CF2 /* GPURenderPassEncoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPURenderPassEncoder.h; sourceTree = "<group>"; };
     13848                D03211CF21AC954E00763CF2 /* GPUProgrammablePassEncoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUProgrammablePassEncoder.h; sourceTree = "<group>"; };
     13849                D03211D021AC954F00763CF2 /* GPURenderPassDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPURenderPassDescriptor.h; sourceTree = "<group>"; };
    1387413850                D036DD8D208FFC0C00F9F4B2 /* WebGLCompressedTextureASTC.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGLCompressedTextureASTC.idl; sourceTree = "<group>"; };
    1387513851                D045AD1D2168230B000A6E9B /* WebMetalLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebMetalLayer.mm; sourceTree = "<group>"; };
     
    1388013856                D045AD2221682474000A6E9B /* WebMetalCommandBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebMetalCommandBuffer.h; sourceTree = "<group>"; };
    1388113857                D045AD2321682475000A6E9B /* WebMetalCommandQueue.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebMetalCommandQueue.cpp; sourceTree = "<group>"; };
    13882                 D0573D42217EB81E00D1BE91 /* GPULegacyTextureMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPULegacyTextureMetal.mm; sourceTree = "<group>"; };
    1388313858                D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FormatBlockCommand.cpp; sourceTree = "<group>"; };
    1388413859                D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FormatBlockCommand.h; sourceTree = "<group>"; };
     
    1389613871                D086FE9609D53AAB005BC74D /* UnlinkCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnlinkCommand.h; sourceTree = "<group>"; };
    1389713872                D086FE9709D53AAB005BC74D /* UnlinkCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnlinkCommand.cpp; sourceTree = "<group>"; };
     13873                D087CE3821ACA94200BDE174 /* GPUCommandBufferMetal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUCommandBufferMetal.mm; sourceTree = "<group>"; };
     13874                D087CE3921ACA94200BDE174 /* GPUQueueMetal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUQueueMetal.mm; sourceTree = "<group>"; };
     13875                D087CE3A21ACA94200BDE174 /* GPURenderPassEncoderMetal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPURenderPassEncoderMetal.mm; sourceTree = "<group>"; };
     13876                D087CE3B21ACA94200BDE174 /* GPUProgrammablePassEncoderMetal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUProgrammablePassEncoderMetal.mm; sourceTree = "<group>"; };
     13877                D087CE3C21ACA94200BDE174 /* GPUDeviceMetal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUDeviceMetal.mm; sourceTree = "<group>"; };
     13878                D087CE3D21ACA94200BDE174 /* GPURenderPipelineMetal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPURenderPipelineMetal.mm; sourceTree = "<group>"; };
     13879                D087CE3E21ACA94200BDE174 /* GPUSwapChainMetal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUSwapChainMetal.mm; sourceTree = "<group>"; };
     13880                D087CE3F21ACA94200BDE174 /* GPUTextureMetal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUTextureMetal.mm; sourceTree = "<group>"; };
     13881                D087CE4021ACA94200BDE174 /* GPUShaderModuleMetal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUShaderModuleMetal.mm; sourceTree = "<group>"; };
    1389813882                D093D225217951D400329217 /* WebGPURenderingContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPURenderingContext.h; sourceTree = "<group>"; };
    1389913883                D093D227217951D400329217 /* WebGPURenderingContext.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPURenderingContext.idl; sourceTree = "<group>"; };
     
    1393613920                D0EACF882193EE4E000FA75C /* WebGPUTextureView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUTextureView.cpp; sourceTree = "<group>"; };
    1393713921                D0EACF892193EE4E000FA75C /* WebGPUTextureView.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUTextureView.idl; sourceTree = "<group>"; };
     13922                D0EACF8C219403C9000FA75C /* WebGPURenderPassDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPURenderPassDescriptor.h; sourceTree = "<group>"; };
     13923                D0EACF8D219403C9000FA75C /* WebGPURenderPassDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPURenderPassDescriptor.idl; sourceTree = "<group>"; };
     13924                D0EACF8E21940A22000FA75C /* WebGPURenderPassEncoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPURenderPassEncoder.h; sourceTree = "<group>"; };
     13925                D0EACF8F21940A22000FA75C /* WebGPURenderPassEncoder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPURenderPassEncoder.cpp; sourceTree = "<group>"; };
     13926                D0EACF9021940A22000FA75C /* WebGPURenderPassEncoder.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPURenderPassEncoder.idl; sourceTree = "<group>"; };
     13927                D0EACF9121940A5B000FA75C /* WebGPUProgrammablePassEncoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUProgrammablePassEncoder.h; sourceTree = "<group>"; };
     13928                D0EACF9221940A5B000FA75C /* WebGPUProgrammablePassEncoder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUProgrammablePassEncoder.cpp; sourceTree = "<group>"; };
     13929                D0EACF9321940A5B000FA75C /* WebGPUProgrammablePassEncoder.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUProgrammablePassEncoder.idl; sourceTree = "<group>"; };
    1393813930                D0EACFAD219E30FD000FA75C /* WebGPUTextureFormatEnum.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUTextureFormatEnum.h; sourceTree = "<group>"; };
    1393913931                D0EACFAE219E30FD000FA75C /* WebGPUTextureFormatEnum.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUTextureFormatEnum.idl; sourceTree = "<group>"; };
     
    1719717189                        sourceTree = "<group>";
    1719817190                };
    17199                 312FF8C621A4C30200EB199D /* cocoa */ = {
    17200                         isa = PBXGroup;
    17201                         children = (
    17202                                 312FF8CC21A4C32700EB199D /* GPUCommandBufferMetal.mm */,
    17203                                 312FF8C921A4C32600EB199D /* GPUDeviceMetal.mm */,
    17204                                 312FF8C721A4C32500EB199D /* GPUQueueMetal.mm */,
    17205                                 312FF8CD21A4C32800EB199D /* GPURenderPipelineMetal.mm */,
    17206                                 312FF8CA21A4C32600EB199D /* GPUShaderModuleMetal.mm */,
    17207                                 312FF8CB21A4C32700EB199D /* GPUSwapChainMetal.mm */,
    17208                                 312FF8C821A4C32500EB199D /* GPUTextureMetal.mm */,
    17209                         );
    17210                         name = cocoa;
    17211                         path = "New Group";
    17212                         sourceTree = "<group>";
    17213                 };
    1721417191                312FF8CE21A4C33F00EB199D /* legacy */ = {
    1721517192                        isa = PBXGroup;
     
    1816718144                        isa = PBXGroup;
    1816818145                        children = (
    18169                                 312FF8C621A4C30200EB199D /* cocoa */,
     18146                                D087CE3721ACA94200BDE174 /* cocoa */,
    1817018147                                312FF8CE21A4C33F00EB199D /* legacy */,
    1817118148                                312FF8BD21A4C2F100EB199D /* GPUCommandBuffer.h */,
     
    1817418151                                312FF8C421A4C2F400EB199D /* GPUPipelineDescriptorBase.h */,
    1817518152                                312FF8C221A4C2F300EB199D /* GPUPipelineStageDescriptor.h */,
     18153                                D03211CF21AC954E00763CF2 /* GPUProgrammablePassEncoder.h */,
    1817618154                                312FF8C121A4C2F200EB199D /* GPUQueue.h */,
     18155                                D03211D021AC954F00763CF2 /* GPURenderPassDescriptor.h */,
     18156                                D03211CE21AC954E00763CF2 /* GPURenderPassEncoder.h */,
    1817718157                                312FF8B921A4C2EF00EB199D /* GPURenderPipeline.h */,
    1817818158                                312FF8BC21A4C2F000EB199D /* GPURenderPipelineDescriptor.h */,
     
    2098620966                        sourceTree = "<group>";
    2098720967                };
    20988                 9368C49120F9B57200434D61 /* metal */ = {
    20989                         isa = PBXGroup;
    20990                         children = (
    20991                                 316BDBA51E71FA6F00DE0D5A /* GPULegacyBufferMetal.mm */,
    20992                                 316BDBC61E75EE3D00DE0D5A /* GPULegacyCommandBufferMetal.mm */,
    20993                                 316BDBBD1E73881300DE0D5A /* GPULegacyCommandQueueMetal.mm */,
    20994                                 381E35E91E8E20AC0043E850 /* GPULegacyComputeCommandEncoderMetal.mm */,
    20995                                 381E35EE1E8E24CB0043E850 /* GPULegacyComputePipelineStateMetal.mm */,
    20996                                 316BDBF81E762BEF00DE0D5A /* GPULegacyDepthStencilDescriptorMetal.mm */,
    20997                                 316BDBF21E76293700DE0D5A /* GPULegacyDepthStencilStateMetal.mm */,
    20998                                 316BDB881E6E141C00DE0D5A /* GPULegacyDeviceMetal.mm */,
    20999                                 316BDBC91E75F16200DE0D5A /* GPULegacyDrawableMetal.mm */,
    21000                                 316BDB961E70CA2400DE0D5A /* GPULegacyFunctionMetal.mm */,
    21001                                 316BDB9C1E70CD9000DE0D5A /* GPULegacyLibraryMetal.mm */,
    21002                                 316BDBEC1E76246B00DE0D5A /* GPULegacyRenderCommandEncoderMetal.mm */,
    21003                                 316BDBE01E761CB500DE0D5A /* GPULegacyRenderPassAttachmentDescriptorMetal.mm */,
    21004                                 316BDBD61E7612C400DE0D5A /* GPULegacyRenderPassColorAttachmentDescriptorMetal.mm */,
    21005                                 316BDBE61E761F2700DE0D5A /* GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm */,
    21006                                 316BDBD41E75F7CA00DE0D5A /* GPULegacyRenderPassDescriptorMetal.mm */,
    21007                                 316BDC0A1E76343600DE0D5A /* GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm */,
    21008                                 316BDC041E762F7E00DE0D5A /* GPULegacyRenderPipelineDescriptorMetal.mm */,
    21009                                 316BDC051E762F7E00DE0D5A /* GPULegacyRenderPipelineStateMetal.mm */,
    21010                                 316BDBB31E7357B000DE0D5A /* GPULegacyTextureDescriptorMetal.mm */,
    21011                                 D0573D42217EB81E00D1BE91 /* GPULegacyTextureMetal.mm */,
    21012                         );
    21013                         path = metal;
    21014                         sourceTree = "<group>";
    21015                 };
    2101620968                93A1EAA20A5634D8006960A0 /* mac */ = {
    2101720969                        isa = PBXGroup;
     
    2425824210                                CD892F5A1FB52ACF009333D2 /* iso */,
    2425924211                                B27535490B053814002CE64F /* mac */,
    24260                                 9368C49120F9B57200434D61 /* metal */,
    2426124212                                FBC220DD1237FBEB00BCF788 /* opengl */,
    2426224213                                3721493318F0B6D600156EDC /* opentype */,
     
    2569025641                                D0C419EB2183CFA2009EC1DE /* WebGPUPipelineStageDescriptor.h */,
    2569125642                                D0C419EC2183CFA2009EC1DE /* WebGPUPipelineStageDescriptor.idl */,
     25643                                D0EACF9221940A5B000FA75C /* WebGPUProgrammablePassEncoder.cpp */,
     25644                                D0EACF9121940A5B000FA75C /* WebGPUProgrammablePassEncoder.h */,
     25645                                D0EACF9321940A5B000FA75C /* WebGPUProgrammablePassEncoder.idl */,
    2569225646                                312FF93C21A61CA100EB199D /* WebGPUQueue.cpp */,
    2569325647                                312FF93921A61C9F00EB199D /* WebGPUQueue.h */,
     
    2569625650                                D093D225217951D400329217 /* WebGPURenderingContext.h */,
    2569725651                                D093D227217951D400329217 /* WebGPURenderingContext.idl */,
     25652                                D0EACF8C219403C9000FA75C /* WebGPURenderPassDescriptor.h */,
     25653                                D0EACF8D219403C9000FA75C /* WebGPURenderPassDescriptor.idl */,
     25654                                D0EACF8F21940A22000FA75C /* WebGPURenderPassEncoder.cpp */,
     25655                                D0EACF8E21940A22000FA75C /* WebGPURenderPassEncoder.h */,
     25656                                D0EACF9021940A22000FA75C /* WebGPURenderPassEncoder.idl */,
    2569825657                                D0C419F8218404DA009EC1DE /* WebGPURenderPipeline.cpp */,
    2569925658                                D0C419F7218404DA009EC1DE /* WebGPURenderPipeline.h */,
     
    2572125680                        );
    2572225681                        path = webgpu;
     25682                        sourceTree = "<group>";
     25683                };
     25684                D087CE3721ACA94200BDE174 /* cocoa */ = {
     25685                        isa = PBXGroup;
     25686                        children = (
     25687                                D087CE3821ACA94200BDE174 /* GPUCommandBufferMetal.mm */,
     25688                                D087CE3C21ACA94200BDE174 /* GPUDeviceMetal.mm */,
     25689                                D087CE3B21ACA94200BDE174 /* GPUProgrammablePassEncoderMetal.mm */,
     25690                                D087CE3921ACA94200BDE174 /* GPUQueueMetal.mm */,
     25691                                D087CE3A21ACA94200BDE174 /* GPURenderPassEncoderMetal.mm */,
     25692                                D087CE3D21ACA94200BDE174 /* GPURenderPipelineMetal.mm */,
     25693                                D087CE4021ACA94200BDE174 /* GPUShaderModuleMetal.mm */,
     25694                                D087CE3E21ACA94200BDE174 /* GPUSwapChainMetal.mm */,
     25695                                D087CE3F21ACA94200BDE174 /* GPUTextureMetal.mm */,
     25696                        );
     25697                        path = cocoa;
    2572325698                        sourceTree = "<group>";
    2572425699                };
  • trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h

    r238451 r238629  
    183183    macro(WebGPUCommandBuffer) \
    184184    macro(WebGPUQueue) \
     185    macro(WebGPUProgrammablePassEncoder) \
    185186    macro(WebGPURenderingContext) \
     187    macro(WebGPURenderPassEncoder) \
    186188    macro(WebGPURenderPipeline) \
    187189    macro(WebGPUShaderStage) \
  • trunk/Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h

    r238419 r238629  
    4545    static RefPtr<GPUCommandBuffer> create(GPUDevice&);
    4646
     47    PlatformCommandBuffer* platformCommandBuffer() const { return m_platformCommandBuffer.get(); }
     48
    4749private:
    4850    GPUCommandBuffer(PlatformCommandBufferSmartPtr&&);
  • trunk/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h

    r238628 r238629  
    2828#if ENABLE(WEBGPU)
    2929
    30 #include "GPUTexture.h"
     30#include <wtf/RefCounted.h>
    3131
    32 #include <wtf/RefCounted.h>
     32OBJC_PROTOCOL(MTLCommandEncoder);
    3333
    3434namespace WebCore {
    3535
    36 class WebGPUTextureView : public RefCounted<WebGPUTextureView> {
     36using PlatformProgrammablePassEncoder = MTLCommandEncoder;
     37
     38class GPUProgrammablePassEncoder : public RefCounted<GPUProgrammablePassEncoder> {
    3739public:
    38     static Ref<WebGPUTextureView> create(Ref<GPUTexture>&&);
     40    virtual ~GPUProgrammablePassEncoder() = default;
    3941
    40 private:
    41     explicit WebGPUTextureView(Ref<GPUTexture>&&);
    42    
    43     Ref<GPUTexture> m_textureView;
     42protected:
     43    virtual PlatformProgrammablePassEncoder* platformPassEncoder() const = 0;
    4444};
    4545
  • trunk/Source/WebCore/platform/graphics/gpu/GPURenderPassDescriptor.h

    r238628 r238629  
    3030#include "GPUTexture.h"
    3131
    32 #include <wtf/RefCounted.h>
    33 
    3432namespace WebCore {
    3533
    36 class WebGPUTextureView : public RefCounted<WebGPUTextureView> {
    37 public:
    38     static Ref<WebGPUTextureView> create(Ref<GPUTexture>&&);
    39 
    40 private:
    41     explicit WebGPUTextureView(Ref<GPUTexture>&&);
    42    
    43     Ref<GPUTexture> m_textureView;
     34struct GPURenderPassDescriptor {
     35    Ref<GPUTexture> attachment;
    4436};
    4537
  • trunk/Source/WebCore/platform/graphics/gpu/GPURenderPassEncoder.h

    r238628 r238629  
    2828#if ENABLE(WEBGPU)
    2929
     30#include "GPUProgrammablePassEncoder.h"
     31
    3032#include <wtf/RefCounted.h>
    3133#include <wtf/RefPtr.h>
    3234#include <wtf/RetainPtr.h>
    3335
    34 OBJC_PROTOCOL(MTLCommandBuffer);
     36OBJC_PROTOCOL(MTLRenderCommandEncoder);
    3537
    3638namespace WebCore {
    3739
    38 class GPUDevice;
     40class GPUCommandBuffer;
    3941
    40 using PlatformCommandBuffer = MTLCommandBuffer;
    41 using PlatformCommandBufferSmartPtr = RetainPtr<MTLCommandBuffer>;
     42struct GPURenderPassDescriptor;
    4243
    43 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
     44using PlatformRenderPassEncoder = MTLRenderCommandEncoder;
     45using PlatformRenderPassEncoderSmartPtr = RetainPtr<MTLRenderCommandEncoder>;
     46
     47class GPURenderPassEncoder : public GPUProgrammablePassEncoder {
    4448public:
    45     static RefPtr<GPUCommandBuffer> create(GPUDevice&);
     49    static RefPtr<GPURenderPassEncoder> create(const GPUCommandBuffer&, GPURenderPassDescriptor&&);
    4650
    4751private:
    48     GPUCommandBuffer(PlatformCommandBufferSmartPtr&&);
     52    GPURenderPassEncoder(PlatformRenderPassEncoderSmartPtr&&);
     53    ~GPURenderPassEncoder();
    4954
    50     PlatformCommandBufferSmartPtr m_platformCommandBuffer;
     55    PlatformProgrammablePassEncoder *platformPassEncoder() const final;
     56
     57    PlatformRenderPassEncoderSmartPtr m_platformRenderPassEncoder;
    5158};
    5259
  • trunk/Source/WebCore/platform/graphics/gpu/GPUTexture.h

    r238419 r238629  
    4343    static Ref<GPUTexture> create(PlatformTextureSmartPtr&&);
    4444
     45    PlatformTexture *platformTexture() const { return m_platformTexture.get(); }
     46
    4547    RefPtr<GPUTexture> createDefaultTextureView();
    4648
  • trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm

    r238628 r238629  
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "GPUProgrammablePassEncoder.h"
    2728
    2829#if ENABLE(WEBGPU)
    2930
    30 #include "GPUTexture.h"
    31 
    32 #include <wtf/RefCounted.h>
    33 
    3431namespace WebCore {
    35 
    36 class WebGPUTextureView : public RefCounted<WebGPUTextureView> {
    37 public:
    38     static Ref<WebGPUTextureView> create(Ref<GPUTexture>&&);
    39 
    40 private:
    41     explicit WebGPUTextureView(Ref<GPUTexture>&&);
    42    
    43     Ref<GPUTexture> m_textureView;
    44 };
    4532
    4633} // namespace WebCore
Note: See TracChangeset for help on using the changeset viewer.