Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 92a2450e0f85e0f21d9250b55754271206805ad7
https://github.com/WebKit/WebKit/commit/92a2450e0f85e0f21d9250b55754271206805ad7
Author: Mike Wyrzykowski <[email protected]>
Date: 2022-12-09 (Fri, 09 Dec 2022)
Changed paths:
M Source/WebCore/Modules/WebGPU/GPUQueue.cpp
M Source/WebGPU/WebGPU/BindGroup.h
M Source/WebGPU/WebGPU/BindGroup.mm
M Source/WebGPU/WebGPU/BindGroupLayout.h
M Source/WebGPU/WebGPU/BindGroupLayout.mm
M Source/WebGPU/WebGPU/RenderPassEncoder.mm
M Source/WebGPU/WebGPU/Sampler.mm
M Source/WebGPU/WebGPU/Texture.mm
M Source/WebKit/Shared/WebGPU/WebGPUBindGroupEntry.cpp
M Source/WebKit/Shared/WebGPU/WebGPUBufferBinding.h
A Websites/webkit.org/demos/webgpu/scripts/textured-cube.js
M Websites/webkit.org/demos/webgpu/textured-cube.html
Log Message:
-----------
[WebGPU] Texture and sampler support
https://bugs.webkit.org/show_bug.cgi?id=248933
<radar://101568406>
Reviewed by Dean Jackson.
Rotating textured cube.
Support textures, samplers, and arbitrary number of buffers
in the bind group subject to Metal limits.
Also implement GPUQueue.copyExternalImageToTexture(...) to
populate the texture data.
* Source/WebCore/Modules/WebGPU/GPUQueue.cpp:
(WebCore::imageBufferForSource):
(WebCore::GPUQueue::copyExternalImageToTexture):
Implement copyExternalImageToTexture via writeTexture.
There may be more efficient implementations but this is a
simple one for now which supports loading images into textures
in a simple way.
* Source/WebGPU/WebGPU/BindGroup.h:
(WebGPU::BindGroup::create):
(WebGPU::BindGroup::resources const):
Add tracking information for resources so they can
be used during rendering.
* Source/WebGPU/WebGPU/BindGroup.mm:
(WebGPU::Device::createBindGroup):
(WebGPU::BindGroup::BindGroup):
Use the MTLBuffers directly from the bind group layout
instead of creating new ones.
* Source/WebGPU/WebGPU/BindGroupLayout.h:
(WebGPU::BindGroupLayout::create):
(WebGPU::BindGroupLayout::vertexArgumentBuffer const):
(WebGPU::BindGroupLayout::fragmentArgumentBuffer const):
(WebGPU::BindGroupLayout::computeArgumentBuffer const):
* Source/WebGPU/WebGPU/BindGroupLayout.mm:
(WebGPU::Device::createBindGroupLayout):
(WebGPU::BindGroupLayout::BindGroupLayout):
(WebGPU::BindGroupLayout::~BindGroupLayout):
Can't use default destructor due to union.
(WebGPU::BindGroupLayout::stageForBinding const):
* Source/WebGPU/WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::setBindGroup):
* Source/WebGPU/WebGPU/Sampler.mm:
(WebGPU::Device::createSampler):
Enable being added to argument buffers.
* Source/WebGPU/WebGPU/Texture.mm:
(WebGPU::Texture::refersToSingleAspect):
(WebGPU::Texture::isValidImageCopyDestination):
Support writing to non-depth textures, not sure why this
was a restriction before.
* Source/WebKit/Shared/WebGPU/WebGPUBindGroupEntry.cpp:
(WebKit::WebGPU::ConvertToBackingContext::convertToBacking):
We can not pass empty WebGPUIdentifiers as the encode/decode
functions will assert.
* Source/WebKit/Shared/WebGPU/WebGPUBufferBinding.h:
* Websites/webkit.org/demos/webgpu/scripts/textured-cube.js: Added.
(async helloCube.frameUpdate):
(async helloCube):
* Websites/webkit.org/demos/webgpu/textured-cube.html:
Add rotating textured cube sample.
Canonical link: https://commits.webkit.org/257641@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes