Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…does not work

https://bugs.webkit.org/show_bug.cgi?id=264719
<radar://118315907>

Reviewed by Dan Glastonbury.

Timestamps query was added to computeBoids but we implemented the older version
in the specification.

The newer version is simpler, so support that one.

Pipeline statistics query feature was removed from WebGPU so remove it.

* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Modules/WebGPU/GPUComputePassTimestampLocation.h: Removed.
* Source/WebCore/Modules/WebGPU/GPUComputePassTimestampLocation.idl: Removed.
* Source/WebCore/Modules/WebGPU/GPUComputePassTimestampWrites.h:
* Source/WebCore/Modules/WebGPU/GPURenderPassTimestampLocation.h: Removed.
* Source/WebCore/Modules/WebGPU/GPURenderPassTimestampLocation.idl: Removed.
* Source/WebCore/Modules/WebGPU/GPURenderPassTimestampWrites.h:
* Source/WebCore/Modules/WebGPU/Implementation/WebGPUAdapterImpl.cpp:
(WebCore::WebGPU::supportedFeatures):
* Source/WebCore/Modules/WebGPU/Implementation/WebGPUCommandEncoderImpl.cpp:
(WebCore::WebGPU::CommandEncoderImpl::beginRenderPass):
(WebCore::WebGPU::CommandEncoderImpl::beginComputePass):
* Source/WebCore/Modules/WebGPU/Implementation/WebGPUConvertToBackingContext.cpp:
* Source/WebCore/Modules/WebGPU/Implementation/WebGPUConvertToBackingContext.h:
* Source/WebCore/Modules/WebGPU/Implementation/WebGPUDeviceImpl.cpp:
(WebCore::WebGPU::DeviceImpl::createQuerySet):
* Source/WebCore/Modules/WebGPU/InternalAPI/WebGPU.serialization.in:
* Source/WebCore/Modules/WebGPU/InternalAPI/WebGPUComputePassTimestampLocation.h: Removed.
* Source/WebCore/Modules/WebGPU/InternalAPI/WebGPUComputePassTimestampWrites.h:
* Source/WebCore/Modules/WebGPU/InternalAPI/WebGPURenderPassTimestampLocation.h: Removed.
* Source/WebCore/Modules/WebGPU/InternalAPI/WebGPURenderPassTimestampWrites.h:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebGPU/WebGPU/CommandEncoder.mm:
(WebGPU::CommandEncoder::validateComputePassDescriptor const):
(WebGPU::CommandEncoder::beginComputePass):
(WebGPU::CommandEncoder::validateRenderPassDescriptor const):
(WebGPU::CommandEncoder::beginRenderPass):
(WebGPU::CommandEncoder::resolveQuerySet):
* Source/WebGPU/WebGPU/ComputePassEncoder.h:
* Source/WebGPU/WebGPU/ComputePassEncoder.mm:
(WebGPU::ComputePassEncoder::ComputePassEncoder):
(WebGPU::ComputePassEncoder::beginPipelineStatisticsQuery): Deleted.
(WebGPU::ComputePassEncoder::endPipelineStatisticsQuery): Deleted.
(wgpuComputePassEncoderBeginPipelineStatisticsQuery): Deleted.
(wgpuComputePassEncoderEndPipelineStatisticsQuery): Deleted.
* Source/WebGPU/WebGPU/HardwareCapabilities.mm:
(WebGPU::baseFeatures):
* Source/WebGPU/WebGPU/QuerySet.h:
* Source/WebGPU/WebGPU/QuerySet.mm:
(WebGPU::Device::createQuerySet):
(WebGPU::QuerySet::setOverrideLocation):
(WebGPU::QuerySet::encodeResolveCommands const):
* Source/WebGPU/WebGPU/RenderPassEncoder.h:
* Source/WebGPU/WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::RenderPassEncoder):
(WebGPU::RenderPassEncoder::beginPipelineStatisticsQuery): Deleted.
(WebGPU::RenderPassEncoder::endPipelineStatisticsQuery): Deleted.
(wgpuRenderPassEncoderBeginPipelineStatisticsQuery): Deleted.
(wgpuRenderPassEncoderEndPipelineStatisticsQuery): Deleted.
* Source/WebGPU/WebGPU/WebGPU.h:
* Source/WebKit/Scripts/webkit/messages.py:
(headers_for_type):
* Source/WebKit/Shared/WebGPU/WebGPUComputePassTimestampWrites.h:
* Source/WebKit/Shared/WebGPU/WebGPURenderPassTimestampWrites.h:

Canonical link: https://commits.webkit.org/270694@main
  • Loading branch information
mwyrzykowski committed Nov 14, 2023
1 parent 7c5f5e8 commit 36b04e3
Show file tree
Hide file tree
Showing 33 changed files with 159 additions and 644 deletions.
2 changes: 0 additions & 2 deletions Source/WebCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,6 @@ list(APPEND WebCore_NON_SVG_IDL_FILES
Modules/WebGPU/GPUCompilationMessageType.idl
Modules/WebGPU/GPUComputePassDescriptor.idl
Modules/WebGPU/GPUComputePassEncoder.idl
Modules/WebGPU/GPUComputePassTimestampLocation.idl
Modules/WebGPU/GPUComputePassTimestampWrites.idl
Modules/WebGPU/GPUComputePipeline.idl
Modules/WebGPU/GPUComputePipelineDescriptor.idl
Expand Down Expand Up @@ -1806,7 +1805,6 @@ list(APPEND WebCore_NON_SVG_IDL_FILES
Modules/WebGPU/GPURenderPassDescriptor.idl
Modules/WebGPU/GPURenderPassEncoder.idl
Modules/WebGPU/GPURenderPassLayout.idl
Modules/WebGPU/GPURenderPassTimestampLocation.idl
Modules/WebGPU/GPURenderPassTimestampWrites.idl
Modules/WebGPU/GPURenderPipeline.idl
Modules/WebGPU/GPURenderPipelineDescriptor.idl
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/DerivedSources.make
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ JS_BINDING_IDLS := \
$(WebCore)/Modules/WebGPU/GPUCompilationMessageType.idl \
$(WebCore)/Modules/WebGPU/GPUComputePassDescriptor.idl \
$(WebCore)/Modules/WebGPU/GPUComputePassEncoder.idl \
$(WebCore)/Modules/WebGPU/GPUComputePassTimestampLocation.idl \
$(WebCore)/Modules/WebGPU/GPUComputePassTimestampWrites.idl \
$(WebCore)/Modules/WebGPU/GPUComputePipeline.idl \
$(WebCore)/Modules/WebGPU/GPUComputePipelineDescriptor.idl \
Expand Down Expand Up @@ -160,7 +159,6 @@ JS_BINDING_IDLS := \
$(WebCore)/Modules/WebGPU/GPURenderPassDescriptor.idl \
$(WebCore)/Modules/WebGPU/GPURenderPassEncoder.idl \
$(WebCore)/Modules/WebGPU/GPURenderPassLayout.idl \
$(WebCore)/Modules/WebGPU/GPURenderPassTimestampLocation.idl \
$(WebCore)/Modules/WebGPU/GPURenderPassTimestampWrites.idl \
$(WebCore)/Modules/WebGPU/GPURenderPipeline.idl \
$(WebCore)/Modules/WebGPU/GPURenderPipelineDescriptor.idl \
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/Headers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
Modules/WebGPU/GPUCompilationMessageType.h
Modules/WebGPU/GPUComputePassDescriptor.h
Modules/WebGPU/GPUComputePassEncoder.h
Modules/WebGPU/GPUComputePassTimestampLocation.h
Modules/WebGPU/GPUComputePassTimestampWrites.h
Modules/WebGPU/GPUComputePipeline.h
Modules/WebGPU/GPUComputePipelineDescriptor.h
Expand Down Expand Up @@ -106,7 +105,6 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
Modules/WebGPU/GPURenderPassDescriptor.h
Modules/WebGPU/GPURenderPassEncoder.h
Modules/WebGPU/GPURenderPassLayout.h
Modules/WebGPU/GPURenderPassTimestampLocation.h
Modules/WebGPU/GPURenderPassTimestampWrites.h
Modules/WebGPU/GPURenderPipeline.h
Modules/WebGPU/GPURenderPipelineDescriptor.h
Expand Down Expand Up @@ -209,7 +207,6 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
Modules/WebGPU/InternalAPI/WebGPUCompositorIntegration.h
Modules/WebGPU/InternalAPI/WebGPUComputePassDescriptor.h
Modules/WebGPU/InternalAPI/WebGPUComputePassEncoder.h
Modules/WebGPU/InternalAPI/WebGPUComputePassTimestampLocation.h
Modules/WebGPU/InternalAPI/WebGPUComputePassTimestampWrites.h
Modules/WebGPU/InternalAPI/WebGPUComputePipeline.h
Modules/WebGPU/InternalAPI/WebGPUComputePipelineDescriptor.h
Expand Down Expand Up @@ -267,7 +264,6 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
Modules/WebGPU/InternalAPI/WebGPURenderPassDescriptor.h
Modules/WebGPU/InternalAPI/WebGPURenderPassEncoder.h
Modules/WebGPU/InternalAPI/WebGPURenderPassLayout.h
Modules/WebGPU/InternalAPI/WebGPURenderPassTimestampLocation.h
Modules/WebGPU/InternalAPI/WebGPURenderPassTimestampWrites.h
Modules/WebGPU/InternalAPI/WebGPURenderPipeline.h
Modules/WebGPU/InternalAPI/WebGPURenderPipelineDescriptor.h
Expand Down
49 changes: 0 additions & 49 deletions Source/WebCore/Modules/WebGPU/GPUComputePassTimestampLocation.h

This file was deleted.

34 changes: 0 additions & 34 deletions Source/WebCore/Modules/WebGPU/GPUComputePassTimestampLocation.idl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#pragma once

#include "GPUComputePassTimestampLocation.h"
#include "GPUIntegralTypes.h"
#include "GPUQuerySet.h"
#include "WebGPUComputePassTimestampWrites.h"
Expand Down
49 changes: 0 additions & 49 deletions Source/WebCore/Modules/WebGPU/GPURenderPassTimestampLocation.h

This file was deleted.

34 changes: 0 additions & 34 deletions Source/WebCore/Modules/WebGPU/GPURenderPassTimestampLocation.idl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include "GPUIntegralTypes.h"
#include "GPUQuerySet.h"
#include "GPURenderPassTimestampLocation.h"
#include "WebGPURenderPassTimestampWrites.h"
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ static Ref<SupportedFeatures> supportedFeatures(const Vector<WGPUFeatureName>& f
case WGPUFeatureName_TimestampQuery:
result.append("timestamp-query"_s);
break;
case WGPUFeatureName_PipelineStatisticsQuery:
result.append("pipeline-statistics-query"_s);
break;
case WGPUFeatureName_TextureCompressionBC:
result.append("texture-compression-bc"_s);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,20 @@ Ref<RenderPassEncoder> CommandEncoderImpl::beginRenderPass(const RenderPassDescr
};
}

Vector<WGPURenderPassTimestampWrite> timestampWrites;
if (descriptor.timestampWrites && descriptor.timestampWrites->querySet) {
timestampWrites.append(WGPURenderPassTimestampWrite {
m_convertToBackingContext->convertToBacking(*descriptor.timestampWrites->querySet),
descriptor.timestampWrites->beginningOfPassWriteIndex,
static_cast<WGPURenderPassTimestampLocation>(descriptor.timestampWrites->endOfPassWriteIndex)
});
}
WGPURenderPassTimestampWrites timestampWrites {
.querySet = descriptor.timestampWrites ? m_convertToBackingContext->convertToBacking(*descriptor.timestampWrites->querySet) : nullptr,
.beginningOfPassWriteIndex = descriptor.timestampWrites ? descriptor.timestampWrites->beginningOfPassWriteIndex : 0,
.endOfPassWriteIndex = descriptor.timestampWrites ? descriptor.timestampWrites->endOfPassWriteIndex : 0
};

WGPURenderPassDescriptor backingDescriptor {
nullptr,
label.data(),
static_cast<uint32_t>(colorAttachments.size()),
colorAttachments.data(),
depthStencilAttachment ? &depthStencilAttachment.value() : nullptr,
descriptor.occlusionQuerySet ? m_convertToBackingContext->convertToBacking(*descriptor.occlusionQuerySet) : nullptr,
static_cast<uint32_t>(timestampWrites.size()),
timestampWrites.data(),
.nextInChain = nullptr,
.label = label.data(),
.colorAttachmentCount = static_cast<uint32_t>(colorAttachments.size()),
.colorAttachments = colorAttachments.data(),
.depthStencilAttachment = depthStencilAttachment ? &depthStencilAttachment.value() : nullptr,
.occlusionQuerySet = descriptor.occlusionQuerySet ? m_convertToBackingContext->convertToBacking(*descriptor.occlusionQuerySet) : nullptr,
.timestampWrites = timestampWrites.querySet ? &timestampWrites : nullptr
};

return RenderPassEncoderImpl::create(adoptWebGPU(wgpuCommandEncoderBeginRenderPass(m_backing.get(), &backingDescriptor)), m_convertToBackingContext);
Expand All @@ -116,20 +112,16 @@ Ref<ComputePassEncoder> CommandEncoderImpl::beginComputePass(const std::optional
{
CString label = descriptor ? descriptor->label.utf8() : CString("");

Vector<WGPUComputePassTimestampWrite> timestampWrites;
if (descriptor && descriptor->timestampWrites && descriptor->timestampWrites->querySet) {
timestampWrites.append(WGPUComputePassTimestampWrite {
m_convertToBackingContext->convertToBacking(*descriptor->timestampWrites->querySet),
descriptor->timestampWrites->beginningOfPassWriteIndex,
static_cast<WGPUComputePassTimestampLocation>(descriptor->timestampWrites->endOfPassWriteIndex)
});
}
WGPUComputePassTimestampWrites timestampWrites {
.querySet = (descriptor && descriptor->timestampWrites) ? m_convertToBackingContext->convertToBacking(*descriptor->timestampWrites->querySet) : nullptr,
.beginningOfPassWriteIndex = (descriptor && descriptor->timestampWrites) ? descriptor->timestampWrites->beginningOfPassWriteIndex : 0,
.endOfPassWriteIndex = (descriptor && descriptor->timestampWrites) ? descriptor->timestampWrites->endOfPassWriteIndex : 0
};

WGPUComputePassDescriptor backingDescriptor {
nullptr,
label.data(),
static_cast<uint32_t>(timestampWrites.size()),
timestampWrites.data(),
.nextInChain = nullptr,
.label = label.data(),
.timestampWrites = timestampWrites.querySet ? &timestampWrites : nullptr
};

return ComputePassEncoderImpl::create(adoptWebGPU(wgpuCommandEncoderBeginComputePass(m_backing.get(), &backingDescriptor)), m_convertToBackingContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "WebGPUBufferBindingType.h"
#include "WebGPUCompareFunction.h"
#include "WebGPUCompilationMessageType.h"
#include "WebGPUComputePassTimestampLocation.h"
#include "WebGPUCullMode.h"
#include "WebGPUErrorFilter.h"
#include "WebGPUFeatureName.h"
Expand All @@ -45,7 +44,6 @@
#include "WebGPUPowerPreference.h"
#include "WebGPUPrimitiveTopology.h"
#include "WebGPUQueryType.h"
#include "WebGPURenderPassTimestampLocation.h"
#include "WebGPUSamplerBindingType.h"
#include "WebGPUStencilOperation.h"
#include "WebGPUStorageTextureAccess.h"
Expand Down Expand Up @@ -167,16 +165,6 @@ WGPUCompilationMessageType ConvertToBackingContext::convertToBacking(Compilation
}
}

WGPUComputePassTimestampLocation ConvertToBackingContext::convertToBacking(ComputePassTimestampLocation computePassTimestampLocation)
{
switch (computePassTimestampLocation) {
case ComputePassTimestampLocation::Beginning:
return WGPUComputePassTimestampLocation_Beginning;
case ComputePassTimestampLocation::End:
return WGPUComputePassTimestampLocation_End;
}
}

WGPUCullMode ConvertToBackingContext::convertToBacking(CullMode cullMode)
{
switch (cullMode) {
Expand Down Expand Up @@ -313,16 +301,6 @@ WGPUQueryType ConvertToBackingContext::convertToBacking(QueryType queryType)
}
}

WGPURenderPassTimestampLocation ConvertToBackingContext::convertToBacking(RenderPassTimestampLocation renderPassTimestampLocation)
{
switch (renderPassTimestampLocation) {
case RenderPassTimestampLocation::Beginning:
return WGPURenderPassTimestampLocation_Beginning;
case RenderPassTimestampLocation::End:
return WGPURenderPassTimestampLocation_End;
}
}

WGPUSamplerBindingType ConvertToBackingContext::convertToBacking(SamplerBindingType samplerBindingType)
{
switch (samplerBindingType) {
Expand Down
Loading

0 comments on commit 36b04e3

Please sign in to comment.