⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268869 in webkit


Ignore:
Timestamp:
Oct 22, 2020, 9:47:20 AM (6 years ago)
Author:
don.olmstead@sony.com
Message:

[WebGPU] Add Dawn implementation skeleton
https://bugs.webkit.org/show_bug.cgi?id=217982

Reviewed by Myles C. Maxfield.

Add an empty implementation of the WebGPU types. This gets WebGPU built and linking
using Dawn.

  • PlatformWinCairo.cmake:
  • platform/Dawn.cmake: Added.
  • platform/graphics/gpu/GPUPlatformTypes.h:
  • platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUBindGroupAllocator::create):
(WebCore::GPUBindGroupAllocator::GPUBindGroupAllocator):
(WebCore::GPUBindGroupAllocator::reallocate):
(WebCore::GPUBindGroupAllocator::tryReset):

  • platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUBindGroup::tryCreate):
(WebCore::GPUBindGroup::GPUBindGroup):
(WebCore::GPUBindGroup::~GPUBindGroup):

  • platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUBindGroupLayout::tryCreate):

  • platform/graphics/gpu/dawn/GPUBufferDawn.cpp: Added.

(WebCore::GPUBuffer::tryCreate):
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::~GPUBuffer):
(WebCore::GPUBuffer::isReadOnly const):
(WebCore::GPUBuffer::state const):
(WebCore::GPUBuffer::mapOnCreation):
(WebCore::GPUBuffer::registerMappingCallback):
(WebCore::GPUBuffer::runMappingCallback):
(WebCore::GPUBuffer::stagingBufferForRead):
(WebCore::GPUBuffer::stagingBufferForWrite):
(WebCore::GPUBuffer::copyStagingBufferToGPU):
(WebCore::GPUBuffer::unmap):
(WebCore::GPUBuffer::destroy):

  • platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUCommandBuffer::tryCreate):
(WebCore::GPUCommandBuffer::GPUCommandBuffer):
(WebCore::GPUCommandBuffer::copyBufferToBuffer):
(WebCore::GPUCommandBuffer::copyBufferToTexture):
(WebCore::GPUCommandBuffer::copyTextureToBuffer):
(WebCore::GPUCommandBuffer::copyTextureToTexture):

  • platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUComputePassEncoder::tryCreate):
(WebCore::GPUComputePassEncoder::GPUComputePassEncoder):
(WebCore::GPUComputePassEncoder::setPipeline):
(WebCore::GPUComputePassEncoder::dispatch):
(WebCore::GPUComputePassEncoder::platformPassEncoder const):

  • platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUComputePipeline::tryCreate):
(WebCore::GPUComputePipeline::recompile):

  • platform/graphics/gpu/dawn/GPUDeviceDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUDevice::tryCreate):
(WebCore::GPUDevice::GPUDevice):

  • platform/graphics/gpu/dawn/GPUPlatformTypesDawn.h: Added.

(WebCore::HandleDeleter<PlatformBuffer>::operator()):
(WebCore::HandleDeleter<PlatformCommandBuffer>::operator()):
(WebCore::HandleDeleter<PlatformComputePassEncoder>::operator()):
(WebCore::HandleDeleter<PlatformComputePipeline>::operator()):
(WebCore::HandleDeleter<PlatformDevice>::operator()):
(WebCore::HandleDeleter<PlatformDrawable>::operator()):
(WebCore::HandleDeleter<PlatformProgrammablePassEncoder>::operator()):
(WebCore::HandleDeleter<PlatformQueue>::operator()):
(WebCore::HandleDeleter<PlatformRenderPassEncoder>::operator()):
(WebCore::HandleDeleter<PlatformRenderPipeline>::operator()):
(WebCore::HandleDeleter<PlatformSampler>::operator()):
(WebCore::HandleDeleter<PlatformShaderModule>::operator()):
(WebCore::HandleDeleter<PlatformSwapLayer>::operator()):
(WebCore::HandleDeleter<PlatformTexture>::operator()):

  • platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUProgrammablePassEncoder::endPass):
(WebCore::GPUProgrammablePassEncoder::setBindGroup):

  • platform/graphics/gpu/dawn/GPUQueueDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUQueue::tryCreate):
(WebCore::GPUQueue::GPUQueue):
(WebCore::GPUQueue::submit):
(WebCore::GPUQueue::label const):
(WebCore::GPUQueue::setLabel const):

  • platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp: Added.

(WebCore::GPURenderPassEncoder::tryCreate):
(WebCore::GPURenderPassEncoder::GPURenderPassEncoder):
(WebCore::GPURenderPassEncoder::platformPassEncoder const):
(WebCore::GPURenderPassEncoder::setPipeline):
(WebCore::GPURenderPassEncoder::setBlendColor):
(WebCore::GPURenderPassEncoder::setViewport):
(WebCore::GPURenderPassEncoder::setScissorRect):
(WebCore::GPURenderPassEncoder::setIndexBuffer):
(WebCore::GPURenderPassEncoder::setVertexBuffers):
(WebCore::GPURenderPassEncoder::draw):
(WebCore::GPURenderPassEncoder::drawIndexed):

  • platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::recompile):

  • platform/graphics/gpu/dawn/GPUSamplerDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUSampler::tryCreate):
(WebCore::GPUSampler::GPUSampler):

  • platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUShaderModule::tryCreate):
(WebCore::GPUShaderModule::GPUShaderModule):

  • platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUSwapChain::tryCreate):
(WebCore::GPUSwapChain::GPUSwapChain):
(WebCore::GPUSwapChain::tryGetCurrentTexture):
(WebCore::GPUSwapChain::present):
(WebCore::GPUSwapChain::reshape):
(WebCore::GPUSwapChain::platformLayer const):

  • platform/graphics/gpu/dawn/GPUTextureDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.

(WebCore::GPUTexture::tryCreate):
(WebCore::GPUTexture::create):
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::tryCreateDefaultTextureView):

Location:
trunk/Source/WebCore
Files:
5 added
3 edited
14 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r268868 r268869  
     12020-10-22  Don Olmstead  <don.olmstead@sony.com>
     2
     3        [WebGPU] Add Dawn implementation skeleton
     4        https://bugs.webkit.org/show_bug.cgi?id=217982
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        Add an empty implementation of the WebGPU types. This gets WebGPU built and linking
     9        using Dawn.
     10
     11        * PlatformWinCairo.cmake:
     12        * platform/Dawn.cmake: Added.
     13        * platform/graphics/gpu/GPUPlatformTypes.h:
     14        * platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     15        (WebCore::GPUBindGroupAllocator::create):
     16        (WebCore::GPUBindGroupAllocator::GPUBindGroupAllocator):
     17        (WebCore::GPUBindGroupAllocator::reallocate):
     18        (WebCore::GPUBindGroupAllocator::tryReset):
     19        * platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     20        (WebCore::GPUBindGroup::tryCreate):
     21        (WebCore::GPUBindGroup::GPUBindGroup):
     22        (WebCore::GPUBindGroup::~GPUBindGroup):
     23        * platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     24        (WebCore::GPUBindGroupLayout::tryCreate):
     25        * platform/graphics/gpu/dawn/GPUBufferDawn.cpp: Added.
     26        (WebCore::GPUBuffer::tryCreate):
     27        (WebCore::GPUBuffer::GPUBuffer):
     28        (WebCore::GPUBuffer::~GPUBuffer):
     29        (WebCore::GPUBuffer::isReadOnly const):
     30        (WebCore::GPUBuffer::state const):
     31        (WebCore::GPUBuffer::mapOnCreation):
     32        (WebCore::GPUBuffer::registerMappingCallback):
     33        (WebCore::GPUBuffer::runMappingCallback):
     34        (WebCore::GPUBuffer::stagingBufferForRead):
     35        (WebCore::GPUBuffer::stagingBufferForWrite):
     36        (WebCore::GPUBuffer::copyStagingBufferToGPU):
     37        (WebCore::GPUBuffer::unmap):
     38        (WebCore::GPUBuffer::destroy):
     39        * platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     40        (WebCore::GPUCommandBuffer::tryCreate):
     41        (WebCore::GPUCommandBuffer::GPUCommandBuffer):
     42        (WebCore::GPUCommandBuffer::copyBufferToBuffer):
     43        (WebCore::GPUCommandBuffer::copyBufferToTexture):
     44        (WebCore::GPUCommandBuffer::copyTextureToBuffer):
     45        (WebCore::GPUCommandBuffer::copyTextureToTexture):
     46        * platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     47        (WebCore::GPUComputePassEncoder::tryCreate):
     48        (WebCore::GPUComputePassEncoder::GPUComputePassEncoder):
     49        (WebCore::GPUComputePassEncoder::setPipeline):
     50        (WebCore::GPUComputePassEncoder::dispatch):
     51        (WebCore::GPUComputePassEncoder::platformPassEncoder const):
     52        * platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     53        (WebCore::GPUComputePipeline::tryCreate):
     54        (WebCore::GPUComputePipeline::recompile):
     55        * platform/graphics/gpu/dawn/GPUDeviceDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     56        (WebCore::GPUDevice::tryCreate):
     57        (WebCore::GPUDevice::GPUDevice):
     58        * platform/graphics/gpu/dawn/GPUPlatformTypesDawn.h: Added.
     59        (WebCore::HandleDeleter<PlatformBuffer>::operator()):
     60        (WebCore::HandleDeleter<PlatformCommandBuffer>::operator()):
     61        (WebCore::HandleDeleter<PlatformComputePassEncoder>::operator()):
     62        (WebCore::HandleDeleter<PlatformComputePipeline>::operator()):
     63        (WebCore::HandleDeleter<PlatformDevice>::operator()):
     64        (WebCore::HandleDeleter<PlatformDrawable>::operator()):
     65        (WebCore::HandleDeleter<PlatformProgrammablePassEncoder>::operator()):
     66        (WebCore::HandleDeleter<PlatformQueue>::operator()):
     67        (WebCore::HandleDeleter<PlatformRenderPassEncoder>::operator()):
     68        (WebCore::HandleDeleter<PlatformRenderPipeline>::operator()):
     69        (WebCore::HandleDeleter<PlatformSampler>::operator()):
     70        (WebCore::HandleDeleter<PlatformShaderModule>::operator()):
     71        (WebCore::HandleDeleter<PlatformSwapLayer>::operator()):
     72        (WebCore::HandleDeleter<PlatformTexture>::operator()):
     73        * platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     74        (WebCore::GPUProgrammablePassEncoder::endPass):
     75        (WebCore::GPUProgrammablePassEncoder::setBindGroup):
     76        * platform/graphics/gpu/dawn/GPUQueueDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     77        (WebCore::GPUQueue::tryCreate):
     78        (WebCore::GPUQueue::GPUQueue):
     79        (WebCore::GPUQueue::submit):
     80        (WebCore::GPUQueue::label const):
     81        (WebCore::GPUQueue::setLabel const):
     82        * platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp: Added.
     83        (WebCore::GPURenderPassEncoder::tryCreate):
     84        (WebCore::GPURenderPassEncoder::GPURenderPassEncoder):
     85        (WebCore::GPURenderPassEncoder::platformPassEncoder const):
     86        (WebCore::GPURenderPassEncoder::setPipeline):
     87        (WebCore::GPURenderPassEncoder::setBlendColor):
     88        (WebCore::GPURenderPassEncoder::setViewport):
     89        (WebCore::GPURenderPassEncoder::setScissorRect):
     90        (WebCore::GPURenderPassEncoder::setIndexBuffer):
     91        (WebCore::GPURenderPassEncoder::setVertexBuffers):
     92        (WebCore::GPURenderPassEncoder::draw):
     93        (WebCore::GPURenderPassEncoder::drawIndexed):
     94        * platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     95        (WebCore::GPURenderPipeline::tryCreate):
     96        (WebCore::GPURenderPipeline::recompile):
     97        * platform/graphics/gpu/dawn/GPUSamplerDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     98        (WebCore::GPUSampler::tryCreate):
     99        (WebCore::GPUSampler::GPUSampler):
     100        * platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     101        (WebCore::GPUShaderModule::tryCreate):
     102        (WebCore::GPUShaderModule::GPUShaderModule):
     103        * platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     104        (WebCore::GPUSwapChain::tryCreate):
     105        (WebCore::GPUSwapChain::GPUSwapChain):
     106        (WebCore::GPUSwapChain::tryGetCurrentTexture):
     107        (WebCore::GPUSwapChain::present):
     108        (WebCore::GPUSwapChain::reshape):
     109        (WebCore::GPUSwapChain::platformLayer const):
     110        * platform/graphics/gpu/dawn/GPUTextureDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h.
     111        (WebCore::GPUTexture::tryCreate):
     112        (WebCore::GPUTexture::create):
     113        (WebCore::GPUTexture::GPUTexture):
     114        (WebCore::GPUTexture::tryCreateDefaultTextureView):
     115
    11162020-10-22  Chris Dumez  <cdumez@apple.com>
    2117
  • trunk/Source/WebCore/PlatformWinCairo.cmake

    r267034 r268869  
    44include(platform/OpenSSL.cmake)
    55include(platform/TextureMapper.cmake)
     6
     7if (USE_DAWN)
     8    include(platform/Dawn.cmake)
     9endif ()
    610
    711list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES
  • trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h

    r268603 r268869  
    2828#if USE(METAL)
    2929#include "GPUPlatformTypesMetal.h"
     30#elif USE(DAWN)
     31#include "GPUPlatformTypesDawn.h"
    3032#else
    3133#error "Unsupported platform for WebGPU"
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUBindGroupAllocator.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31#include "GPUErrorScopes.h"
     32
     33namespace WebCore {
     34
     35Ref<GPUBindGroupAllocator> GPUBindGroupAllocator::create(GPUErrorScopes& errors)
     36{
     37    return adoptRef(*new GPUBindGroupAllocator(errors));
     38}
     39
     40GPUBindGroupAllocator::GPUBindGroupAllocator(GPUErrorScopes& errors)
     41    : m_errorScopes(makeRef(errors))
     42{
     43}
     44
     45bool GPUBindGroupAllocator::reallocate(PlatformGPUBufferOffset newOffset)
     46{
     47    return false;
     48}
     49
     50void GPUBindGroupAllocator::tryReset()
     51{
     52}
     53
     54} // namespace WebCore
     55
     56#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp

    r268868 r268869  
    11/*
    2  * Copyright (C) 2020 Sony Interactive Entertainment Inc.
     2 * Copyright (C) 2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUBindGroup.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31#include "GPUBindGroupAllocator.h"
     32#include "GPUErrorScopes.h"
     33#include <webgpu/webgpu.h>
     34
     35namespace WebCore {
     36
     37RefPtr<GPUBindGroup> GPUBindGroup::tryCreate(const GPUBindGroupDescriptor& descriptor, GPUBindGroupAllocator& allocator)
     38{
     39    return nullptr;
     40}
     41
     42GPUBindGroup::GPUBindGroup(GPUBindGroupAllocator::ArgumentBufferOffsets&& offsets, GPUBindGroupAllocator& allocator, HashSet<Ref<GPUBuffer>>&& buffers, HashSet<Ref<GPUTexture>>&& textures)
     43    : m_argumentBufferOffsets(WTFMove(offsets))
     44    , m_allocator(makeRef(allocator))
     45    , m_boundBuffers(WTFMove(buffers))
     46    , m_boundTextures(WTFMove(textures))
     47{
     48}
     49
     50GPUBindGroup::~GPUBindGroup()
     51{
     52}
     53
     54} // namespace WebCore
     55
     56#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp

    r268868 r268869  
    11/*
    2  * Copyright (C) 2020 Sony Interactive Entertainment Inc.
     2 * Copyright (C) 2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUBindGroupLayout.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31#include "GPUDevice.h"
     32#include <webgpu/webgpu.h>
     33
     34namespace WebCore {
     35
     36RefPtr<GPUBindGroupLayout> GPUBindGroupLayout::tryCreate(const GPUDevice& device, const GPUBindGroupLayoutDescriptor& descriptor)
     37{
     38    return nullptr;
     39}
     40
     41} // namespace WebCore
     42
     43#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUCommandBuffer.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31namespace WebCore {
     32
     33RefPtr<GPUCommandBuffer> GPUCommandBuffer::tryCreate(const GPUDevice& device)
     34{
     35    return nullptr;
     36}
     37
     38GPUCommandBuffer::GPUCommandBuffer(PlatformCommandBufferSmartPtr&& buffer)
     39    : m_platformCommandBuffer(WTFMove(buffer))
     40{
     41}
     42
     43void GPUCommandBuffer::copyBufferToBuffer(Ref<GPUBuffer>&& src, uint64_t srcOffset, Ref<GPUBuffer>&& dst, uint64_t dstOffset, uint64_t size)
     44{
     45}
     46
     47void GPUCommandBuffer::copyBufferToTexture(GPUBufferCopyView&& srcBuffer, GPUTextureCopyView&& dstTexture, const GPUExtent3D& size)
     48{
     49}
     50
     51void GPUCommandBuffer::copyTextureToBuffer(GPUTextureCopyView&& srcTexture, GPUBufferCopyView&& dstBuffer, const GPUExtent3D& size)
     52{
     53}
     54
     55void GPUCommandBuffer::copyTextureToTexture(GPUTextureCopyView&& src, GPUTextureCopyView&& dst, const GPUExtent3D& size)
     56{
     57}
     58
     59} // namespace WebCore
     60
     61#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUComputePassEncoder.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31namespace WebCore {
     32
     33RefPtr<GPUComputePassEncoder> GPUComputePassEncoder::tryCreate(Ref<GPUCommandBuffer>&& buffer)
     34{
     35    return nullptr;
     36}
     37
     38GPUComputePassEncoder::GPUComputePassEncoder(Ref<GPUCommandBuffer>&& buffer, PlatformComputePassEncoderSmartPtr&& encoder)
     39    : GPUProgrammablePassEncoder(WTFMove(buffer))
     40    , m_platformComputePassEncoder(WTFMove(encoder))
     41{
     42}
     43
     44void GPUComputePassEncoder::setPipeline(Ref<const GPUComputePipeline>&& pipeline)
     45{
     46}
     47
     48void GPUComputePassEncoder::dispatch(unsigned x, unsigned y, unsigned z)
     49{
     50}
     51
     52const PlatformProgrammablePassEncoder* GPUComputePassEncoder::platformPassEncoder() const
     53{
     54    return nullptr;
     55}
     56
     57} // namespace WebCore
     58
     59#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUComputePipeline.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31#include "GPUPipelineLayout.h"
     32
     33namespace WebCore {
     34
     35RefPtr<GPUComputePipeline> GPUComputePipeline::tryCreate(const GPUDevice& device, const GPUComputePipelineDescriptor& descriptor, GPUErrorScopes& errorScopes)
     36{
     37    return nullptr;
     38}
     39
     40GPUComputePipeline::~GPUComputePipeline() = default;
     41
     42bool GPUComputePipeline::recompile(const GPUDevice& device, GPUProgrammableStageDescriptor&& computeStage)
     43{
     44    return false;
     45}
     46
     47} // namespace WebCore
     48
     49#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUDeviceDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUDevice.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31namespace WebCore {
     32
     33RefPtr<GPUDevice> GPUDevice::tryCreate(const Optional<GPURequestAdapterOptions>& options)
     34{
     35    return nullptr;
     36}
     37
     38GPUDevice::GPUDevice(PlatformDeviceSmartPtr&& device)
     39    : m_platformDevice(WTFMove(device))
     40{
     41}
     42
     43} // namespace WebCore
     44
     45#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUProgrammablePassEncoder.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31namespace WebCore {
     32
     33void GPUProgrammablePassEncoder::endPass()
     34{
     35}
     36
     37void GPUProgrammablePassEncoder::setBindGroup(unsigned index, GPUBindGroup& bindGroup)
     38{
     39}
     40
     41} // namespace WebCore
     42
     43#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUQueueDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUQueue.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31#include "GPUDevice.h"
     32#include <wtf/text/WTFString.h>
     33
     34namespace WebCore {
     35
     36RefPtr<GPUQueue> GPUQueue::tryCreate(const GPUDevice& device)
     37{
     38    return nullptr;
     39}
     40
     41GPUQueue::GPUQueue(PlatformQueueSmartPtr&& queue, const GPUDevice& device)
     42    : m_platformQueue(WTFMove(queue))
     43    , m_device(makeWeakPtr(device))
     44{
     45}
     46
     47void GPUQueue::submit(Vector<Ref<GPUCommandBuffer>>&& commandBuffers)
     48{
     49}
     50
     51String GPUQueue::label() const
     52{
     53    return emptyString();
     54}
     55
     56void GPUQueue::setLabel(const String& label) const
     57{
     58}
     59
     60} // namespace WebCore
     61
     62#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPURenderPipeline.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31namespace WebCore {
     32
     33RefPtr<GPURenderPipeline> GPURenderPipeline::tryCreate(const GPUDevice& device, const GPURenderPipelineDescriptor& descriptor, GPUErrorScopes& errorScopes)
     34{
     35    return nullptr;
     36}
     37
     38GPURenderPipeline::~GPURenderPipeline() = default;
     39
     40bool GPURenderPipeline::recompile(const GPUDevice& device, GPUProgrammableStageDescriptor&& vertexStage, Optional<GPUProgrammableStageDescriptor>&& fragmentStage)
     41{
     42    return false;
     43}
     44
     45} // namespace WebCore
     46
     47#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUSamplerDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUSampler.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31namespace WebCore {
     32
     33RefPtr<GPUSampler> GPUSampler::tryCreate(const GPUDevice& device, const GPUSamplerDescriptor& descriptor)
     34{
     35    return nullptr;
     36}
     37
     38GPUSampler::GPUSampler(PlatformSamplerSmartPtr&& sampler)
     39    : m_platformSampler(WTFMove(sampler))
     40{
     41}
     42
     43} // namespace WebCore
     44
     45#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUShaderModule.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31namespace WebCore {
     32
     33RefPtr<GPUShaderModule> GPUShaderModule::tryCreate(const GPUDevice& device, const GPUShaderModuleDescriptor& descriptor)
     34{
     35    return nullptr;
     36}
     37
     38GPUShaderModule::GPUShaderModule(PlatformShaderModuleSmartPtr&& module)
     39    : m_platformShaderModule(WTFMove(module))
     40{
     41}
     42
     43} // namespace WebCore
     44
     45#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUSwapChain.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31namespace WebCore {
     32
     33RefPtr<GPUSwapChain> GPUSwapChain::tryCreate(const GPUSwapChainDescriptor& descriptor, int width, int height)
     34{
     35    return nullptr;
     36}
     37
     38GPUSwapChain::GPUSwapChain(PlatformSwapLayerSmartPtr&& platformLayer, OptionSet<GPUTextureUsage::Flags> usageOptions)
     39    : m_platformSwapLayer(WTFMove(platformLayer))
     40    , m_usage(usageOptions)
     41{
     42}
     43
     44RefPtr<GPUTexture> GPUSwapChain::tryGetCurrentTexture()
     45{
     46    return nullptr;
     47}
     48
     49void GPUSwapChain::present()
     50{
     51    if (!m_currentDrawable)
     52        return;
     53}
     54
     55void GPUSwapChain::reshape(int width, int height)
     56{
     57
     58}
     59
     60PlatformLayer* GPUSwapChain::platformLayer() const
     61{
     62    return nullptr;
     63}
     64
     65} // namespace WebCore
     66
     67#endif // ENABLE(WEBGPU)
  • trunk/Source/WebCore/platform/graphics/gpu/dawn/GPUTextureDawn.cpp

    r268868 r268869  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUTexture.h"
    2728
    28 #if USE(METAL)
    29 #include "GPUPlatformTypesMetal.h"
    30 #else
    31 #error "Unsupported platform for WebGPU"
    32 #endif
     29#if ENABLE(WEBGPU)
     30
     31namespace WebCore {
     32
     33RefPtr<GPUTexture> GPUTexture::tryCreate(const GPUDevice& device, const GPUTextureDescriptor& descriptor, GPUErrorScopes& errorScopes)
     34{
     35    return nullptr;
     36}
     37
     38Ref<GPUTexture> GPUTexture::create(PlatformTextureSmartPtr&& texture, OptionSet<GPUTextureUsage::Flags> usage)
     39{
     40    return adoptRef(*new GPUTexture(WTFMove(texture), usage));
     41}
     42
     43GPUTexture::GPUTexture(PlatformTextureSmartPtr&& texture, OptionSet<GPUTextureUsage::Flags> usage)
     44    : m_platformTexture(WTFMove(texture))
     45    , m_usage(usage)
     46{
     47}
     48
     49RefPtr<GPUTexture> GPUTexture::tryCreateDefaultTextureView()
     50{
     51    return nullptr;
     52}
     53
     54} // namespace WebCore
     55
     56#endif // ENABLE(WEBGPU)
Note: See TracChangeset for help on using the changeset viewer.