Skip to content

Commit ab97aab

Browse files
committed
[WebGPU Swift] CommandEncoder does not support GPUTexture instances in beginRenderPass
https://bugs.webkit.org/show_bug.cgi?id=299456 rdar://161261339 Reviewed by Cameron McCormack. Factor out Texture variant into its own header file so Swift and Objective-C implementations can share the same logic. * Source/WebGPU/WebGPU.xcodeproj/project.pbxproj: * Source/WebGPU/WebGPU/CommandEncoder.mm: (WebGPU::CommandEncoder::beginRenderPass): (WebGPU::TextureOrTextureView::TextureOrTextureView): Deleted. (WebGPU::TextureOrTextureView::setCommandEncoder): Deleted. (WebGPU::isRenderableTextureView): Deleted. * Source/WebGPU/WebGPU/CommandEncoder.swift: (WebGPU.beginRenderPass(_:)): (WebGPU.isRenderableTextureView(_:)): Deleted. * Source/WebGPU/WebGPU/Internal/WebGPUSwiftInternal.h: (WebGPU_Internal::isValidToUseWith): * Source/WebGPU/WebGPU/TextureOrTextureView.h: Added. (WebGPU::TextureOrTextureView::TextureOrTextureView): (WebGPU::TextureOrTextureView::setCommandEncoder): (WebGPU::TextureOrTextureView::rasterizationMapForSlice): (WebGPU::isRenderableTextureView): Canonical link: https://commits.webkit.org/300997@main
1 parent 281b5a9 commit ab97aab

File tree

6 files changed

+169
-95
lines changed

6 files changed

+169
-95
lines changed

Source/WebGPU/WebGPU.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
0D078E922E737C0500A9B266 /* DDMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D078E8F2E737C0500A9B266 /* DDMesh.h */; };
1111
0D078E932E737C0500A9B266 /* DDMesh.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0D078E902E737C0500A9B266 /* DDMesh.mm */; };
1212
0D078E942E737C0500A9B266 /* UsdModelRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D078E912E737C0500A9B266 /* UsdModelRenderer.swift */; };
13+
0D164A3A2E8EE14700864EA1 /* TextureOrTextureView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D164A392E8EE14700864EA1 /* TextureOrTextureView.h */; };
1314
0D212A652BC26336001160BF /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D212A642BC26336001160BF /* CoreGraphics.framework */; };
1415
0D30F93729F1F94A0055D9F1 /* ExternalTexture.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0D30F93629F1F94A0055D9F1 /* ExternalTexture.mm */; };
1516
0D30F93929F1FAC50055D9F1 /* ExternalTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D30F93829F1FAC50055D9F1 /* ExternalTexture.h */; };
@@ -298,6 +299,7 @@
298299
0D078E8F2E737C0500A9B266 /* DDMesh.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDMesh.h; sourceTree = "<group>"; };
299300
0D078E902E737C0500A9B266 /* DDMesh.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DDMesh.mm; sourceTree = "<group>"; };
300301
0D078E912E737C0500A9B266 /* UsdModelRenderer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UsdModelRenderer.swift; sourceTree = "<group>"; };
302+
0D164A392E8EE14700864EA1 /* TextureOrTextureView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextureOrTextureView.h; sourceTree = "<group>"; };
301303
0D212A642BC26336001160BF /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
302304
0D30F93629F1F94A0055D9F1 /* ExternalTexture.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ExternalTexture.mm; sourceTree = "<group>"; };
303305
0D30F93829F1FAC50055D9F1 /* ExternalTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExternalTexture.h; sourceTree = "<group>"; };
@@ -700,6 +702,7 @@
700702
0DE2BFAC2C150DF700D04AEB /* ShaderStage.h */,
701703
1C5ACA99273A426D0095F8D5 /* Texture.h */,
702704
1C5ACAB1273A426D0095F8D5 /* Texture.mm */,
705+
0D164A392E8EE14700864EA1 /* TextureOrTextureView.h */,
703706
1C5ACADD273A4F3D0095F8D5 /* TextureView.h */,
704707
1C5ACAEA273A560D0095F8D5 /* TextureView.mm */,
705708
0D078E912E737C0500A9B266 /* UsdModelRenderer.swift */,
@@ -987,6 +990,7 @@
987990
941C2CF32CBDB0E700B5DB48 /* QuerySet.h in Headers */,
988991
941C1EE62CA33255004D4220 /* Queue.h in Headers */,
989992
0DE2BFAD2C150DF700D04AEB /* ShaderStage.h in Headers */,
993+
0D164A3A2E8EE14700864EA1 /* TextureOrTextureView.h in Headers */,
990994
1C5ACAD3273A4C860095F8D5 /* WebGPUExt.h in Headers */,
991995
94CC0FE62CA203B300CB3264 /* WebGPUSwiftInternal.h in Headers */,
992996
0D943C0F2C6571BC00D33BA5 /* XRBinding.h in Headers */,

Source/WebGPU/WebGPU/CommandEncoder.mm

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#import "QuerySet.h"
3636
#import "RenderPassEncoder.h"
3737
#import "Texture.h"
38+
#import "TextureOrTextureView.h"
3839
#if ENABLE(WEBGPU_SWIFT)
3940
#import "WebGPUSwiftInternal.h"
4041
#endif
@@ -509,66 +510,6 @@ static bool isMultisampleTexture(id<MTLTexture> texture)
509510
return texture.textureType == MTLTextureType2DMultisample || texture.textureType == MTLTextureType2DMultisampleArray;
510511
}
511512

512-
class TextureOrTextureView {
513-
public:
514-
TextureOrTextureView(Texture& texture)
515-
: m_texture(&texture)
516-
{
517-
}
518-
TextureOrTextureView(TextureView& view)
519-
: m_view(&view)
520-
{
521-
}
522-
523-
#define TEXTURE_OR_VIEW_INVOKE(x) return m_view ? RefPtr { m_view }->x() : RefPtr { m_texture }->x()
524-
#define TEXTURE_OR_VIEW_HELPER(x) auto x() const { TEXTURE_OR_VIEW_INVOKE(x); }
525-
#define TEXTURE_OR_VIEW_HELPER_NONCONST(x) auto x() { TEXTURE_OR_VIEW_INVOKE(x); }
526-
#define TEXTURE_OR_VIEW_HELPER_REF(x) const auto& x() const { TEXTURE_OR_VIEW_INVOKE(x); }
527-
528-
TEXTURE_OR_VIEW_HELPER(width)
529-
TEXTURE_OR_VIEW_HELPER(height)
530-
TEXTURE_OR_VIEW_HELPER(is2DTexture)
531-
TEXTURE_OR_VIEW_HELPER(is2DArrayTexture)
532-
TEXTURE_OR_VIEW_HELPER(is3DTexture)
533-
TEXTURE_OR_VIEW_HELPER(sampleCount)
534-
TEXTURE_OR_VIEW_HELPER(format)
535-
TEXTURE_OR_VIEW_HELPER(isDestroyed)
536-
TEXTURE_OR_VIEW_HELPER(depthOrArrayLayers)
537-
TEXTURE_OR_VIEW_HELPER(baseArrayLayer)
538-
TEXTURE_OR_VIEW_HELPER(baseMipLevel)
539-
TEXTURE_OR_VIEW_HELPER(parentTexture)
540-
TEXTURE_OR_VIEW_HELPER(parentRelativeSlice)
541-
TEXTURE_OR_VIEW_HELPER(previouslyCleared)
542-
TEXTURE_OR_VIEW_HELPER_NONCONST(setPreviouslyCleared)
543-
TEXTURE_OR_VIEW_HELPER(texture)
544-
TEXTURE_OR_VIEW_HELPER(isValid)
545-
TEXTURE_OR_VIEW_HELPER(usage)
546-
TEXTURE_OR_VIEW_HELPER(mipLevelCount)
547-
TEXTURE_OR_VIEW_HELPER(arrayLayerCount)
548-
549-
TEXTURE_OR_VIEW_HELPER_REF(apiParentTexture)
550-
TEXTURE_OR_VIEW_HELPER_REF(device)
551-
552-
void setCommandEncoder(CommandEncoder& encoder)
553-
{
554-
m_view ? RefPtr { m_view }->setCommandEncoder(encoder) : RefPtr { m_texture }->setCommandEncoder(encoder);
555-
}
556-
557-
#undef TEXTURE_OR_VIEW_INVOKE
558-
#undef TEXTURE_OR_VIEW_HELPER
559-
#undef TEXTURE_OR_VIEW_HELPER_REF
560-
#undef TEXTURE_OR_VIEW_HELPER_NONCONST
561-
562-
private:
563-
RefPtr<Texture> m_texture;
564-
RefPtr<TextureView> m_view;
565-
};
566-
567-
static bool isRenderableTextureView(const auto& texture)
568-
{
569-
return (texture.usage() & WGPUTextureUsage_RenderAttachment) && (texture.is2DTexture() || texture.is2DArrayTexture() || texture.is3DTexture()) && texture.mipLevelCount() == 1 && texture.arrayLayerCount() <= 1;
570-
}
571-
572513
Ref<RenderPassEncoder> CommandEncoder::beginRenderPass(const WGPURenderPassDescriptor& descriptor)
573514
{
574515
#if ENABLE(WEBGPU_SWIFT)
@@ -738,6 +679,8 @@ static bool isRenderableTextureView(const auto& texture)
738679
texture.setPreviouslyCleared();
739680
if (attachment.resolveTarget)
740681
protectedFromAPI(attachment.resolveTarget)->setPreviouslyCleared();
682+
if (attachment.resolveTexture)
683+
protectedFromAPI(attachment.resolveTexture)->setPreviouslyCleared();
741684
}
742685
}
743686

Source/WebGPU/WebGPU/CommandEncoder.swift

Lines changed: 54 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -782,11 +782,6 @@ extension WebGPU.CommandEncoder {
782782
return nil
783783
}
784784

785-
private func isRenderableTextureView(texture: WebGPU.TextureView) -> Bool {
786-
let textureDimension = texture.dimension()
787-
788-
return (texture.usage() & WGPUTextureUsage_RenderAttachment.rawValue) != 0 && (textureDimension == WGPUTextureViewDimension_2D || textureDimension == WGPUTextureViewDimension_2DArray || textureDimension == WGPUTextureViewDimension_3D) && texture.mipLevelCount() == 1 && texture.arrayLayerCount() <= 1
789-
}
790785
private func loadAction(loadOp: WGPULoadOp) -> MTLLoadAction {
791786
switch (loadOp) {
792787
case WGPULoadOp_Load:
@@ -904,8 +899,11 @@ extension WebGPU.CommandEncoder {
904899
attachment.clearValue.b,
905900
attachment.clearValue.a)
906901

907-
let texture = WebGPU.fromAPI(attachment.view)
908-
if !WebGPU_Internal.isValidToUseWithTextureViewCommandEncoder(texture, self) {
902+
var texture =
903+
attachment.view != nil
904+
? WebGPU.TextureOrTextureView(WebGPU.fromAPI(attachment.view))
905+
: WebGPU.TextureOrTextureView(WebGPU.fromAPI(attachment.texture))
906+
if !WebGPU_Internal.isValidToUseWith(texture, self) {
909907
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "device mismatch")
910908
}
911909
if textureWidth != 0 &&
@@ -930,7 +928,7 @@ extension WebGPU.CommandEncoder {
930928
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "color attachment is not renderable")
931929
}
932930

933-
if !isRenderableTextureView(texture: texture) {
931+
if !WebGPU.isRenderableTextureView(texture) {
934932
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "texture view is not renderable")
935933
}
936934
}
@@ -947,17 +945,20 @@ extension WebGPU.CommandEncoder {
947945
mtlAttachment.level = 0
948946
mtlAttachment.slice = 0
949947
var depthSliceOrArrayLayer: UInt64 = 0
950-
let textureDimension = texture.dimension()
951948
if attachment.depthSlice.hasValue {
952-
if textureDimension != WGPUTextureViewDimension_3D {
949+
if !texture.is3DTexture() {
953950
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "depthSlice specified on 2D texture")
954951
}
955952
depthSliceOrArrayLayer = textureIsDestroyed ? 0 : UInt64(attachment.depthSlice.value!)
956953
if depthSliceOrArrayLayer >= texture.depthOrArrayLayers() {
957-
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "depthSlice is greater than texture's depth or array layers")
954+
return WebGPU.RenderPassEncoder.createInvalid(
955+
self,
956+
m_device.ptr(),
957+
"depthSlice is greater than texture's depth or array layers"
958+
)
958959
}
959960
} else {
960-
if textureDimension == WGPUTextureViewDimension_3D {
961+
if texture.is3DTexture() {
961962
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "textureDimension is 3D and no depth slice is specified")
962963
}
963964
depthSliceOrArrayLayer = UInt64(textureIsDestroyed ? 0 : texture.baseArrayLayer())
@@ -967,14 +968,18 @@ extension WebGPU.CommandEncoder {
967968
let depthAndMipLevel: UInt64 = depthSliceOrArrayLayer | (UInt64(baseMipLevel) << 32)
968969
if depthSlices[bridgedTexture] != nil {
969970
if depthSlices[bridgedTexture]!.contains(depthAndMipLevel) {
970-
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "attempting to render to overlapping color attachment")
971+
return WebGPU.RenderPassEncoder.createInvalid(
972+
self,
973+
m_device.ptr(),
974+
"attempting to render to overlapping color attachment"
975+
)
971976
}
972977
depthSlices[bridgedTexture]!.insert(depthAndMipLevel)
973978
} else {
974979
depthSlices[bridgedTexture] = [depthAndMipLevel]
975980
}
976981

977-
mtlAttachment.depthPlane = Int(textureDimension == WGPUTextureViewDimension_3D ? depthSliceOrArrayLayer : 0)
982+
mtlAttachment.depthPlane = texture.is3DTexture() ? Int(depthSliceOrArrayLayer) : 0
978983
mtlAttachment.slice = 0
979984
mtlAttachment.loadAction = loadAction(loadOp: attachment.loadOp)
980985
mtlAttachment.storeAction = storeAction(storeOp: attachment.storeOp, hasResolveTarget: attachment.resolveTarget != nil)
@@ -985,16 +990,15 @@ extension WebGPU.CommandEncoder {
985990
textureToClear = mtlAttachment.texture
986991
}
987992

988-
if let rateMap = texture.rasterizationMapForSlice(texture.parentRelativeSlice()) {
989-
mtlDescriptor.rasterizationRateMap = rateMap
990-
}
991-
992993
var compositorTexture = texture
993994
if attachment.resolveTarget != nil {
994-
let resolveTarget = WebGPU.fromAPI(attachment.resolveTarget)
995+
var resolveTarget =
996+
attachment.resolveTarget != nil
997+
? WebGPU.TextureOrTextureView(WebGPU.fromAPI(attachment.resolveTarget))
998+
: WebGPU.TextureOrTextureView(WebGPU.fromAPI(attachment.resolveTexture))
995999
compositorTexture = resolveTarget
9961000

997-
if !WebGPU_Internal.isValidToUseWithTextureViewCommandEncoder(resolveTarget, self) {
1001+
if !WebGPU_Internal.isValidToUseWith(resolveTarget, self) {
9981002
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "resolve target created from different device")
9991003
}
10001004
resolveTarget.setCommandEncoder(self)
@@ -1007,7 +1011,7 @@ extension WebGPU.CommandEncoder {
10071011
|| resolveTexture!.sampleCount != 1
10081012
|| isMultisampleTexture(texture: resolveTexture!)
10091013
|| !isMultisampleTexture(texture: mtlTexture!)
1010-
|| !isRenderableTextureView(texture: resolveTarget)
1014+
|| !WebGPU.isRenderableTextureView(resolveTarget)
10111015
|| mtlTexture!.pixelFormat != resolveTexture!.pixelFormat
10121016
|| !WebGPU.Texture.supportsResolve(resolveTarget.format(), m_device.ptr()) {
10131017
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "resolve target is invalid")
@@ -1031,24 +1035,30 @@ extension WebGPU.CommandEncoder {
10311035
let textureWithResolve = TextureAndClearColor(texture: textureToClear!)
10321036
attachmentsToClear[i as NSNumber] = textureWithResolve
10331037
if textureToClear != nil {
1034-
// FIXME: rdar://138042799 remove default argument.
1035-
texture.setPreviouslyCleared(0, 0)
1038+
texture.setPreviouslyCleared()
10361039
}
10371040
if attachment.resolveTarget != nil {
10381041
// FIXME: rdar://138042799 remove default argument.
10391042
WebGPU.fromAPI(attachment.resolveTarget).setPreviouslyCleared(0, 0)
10401043
}
1044+
if attachment.resolveTexture != nil {
1045+
WebGPU.fromAPI(attachment.resolveTexture).setPreviouslyCleared()
1046+
}
10411047
}
10421048
}
10431049
}
10441050

1045-
var depthReadOnly = false, stencilReadOnly = false
1051+
var depthReadOnly = false
1052+
var stencilReadOnly = false
10461053
var hasStencilComponent = false
10471054
var depthStencilAttachmentToClear: MTLTexture? = nil
10481055
var depthAttachmentToClear = false
1049-
if let attachment = wgpuGetRenderPassDescriptorDepthSencilAttachment(descriptorSpan)?[0] {
1050-
let textureView = WebGPU.fromAPI(attachment.view)
1051-
if !WebGPU_Internal.isValidToUseWithTextureViewCommandEncoder(textureView, self) {
1056+
if let attachment = wgpuGetRenderPassDescriptorDepthStencilAttachment(descriptorSpan)?[0] {
1057+
let textureView =
1058+
attachment.view != nil
1059+
? WebGPU.TextureOrTextureView(WebGPU.fromAPI(attachment.view))
1060+
: WebGPU.TextureOrTextureView(WebGPU.fromAPI(attachment.texture))
1061+
if !WebGPU_Internal.isValidToUseWith(textureView, self) {
10521062
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "depth stencil texture device mismatch")
10531063
}
10541064
let metalDepthStencilTexture = textureView.texture()
@@ -1061,10 +1071,17 @@ extension WebGPU.CommandEncoder {
10611071
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "depth stencil texture dimensions mismatch")
10621072
}
10631073
if textureView.arrayLayerCount() > 1 || textureView.mipLevelCount() > 1 {
1064-
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "depth stencil texture has more than one array layer or mip level")
1074+
return WebGPU.RenderPassEncoder.createInvalid(
1075+
self,
1076+
m_device.ptr(),
1077+
"depth stencil texture has more than one array layer or mip level"
1078+
)
10651079
}
10661080

1067-
if !WebGPU.Texture.isDepthStencilRenderableFormat(textureView.format(), m_device.ptr()) || !isRenderableTextureView(texture: textureView) {
1081+
if !WebGPU.Texture.isDepthStencilRenderableFormat(
1082+
textureView.format(),
1083+
m_device.ptr()
1084+
) || !WebGPU.isRenderableTextureView(textureView) {
10681085
return WebGPU.RenderPassEncoder.createInvalid(self, m_device.ptr(), "depth stencil texture is not renderable")
10691086
}
10701087
}
@@ -1118,10 +1135,13 @@ extension WebGPU.CommandEncoder {
11181135
}
11191136

11201137
var stencilAttachmentToClear = false
1121-
if let attachment = wgpuGetRenderPassDescriptorDepthSencilAttachment(descriptorSpan)?[0] {
1138+
if let attachment = wgpuGetRenderPassDescriptorDepthStencilAttachment(descriptorSpan)?[0] {
11221139
let mtlAttachment = mtlDescriptor.stencilAttachment
11231140
stencilReadOnly = attachment.stencilReadOnly != 0
1124-
let textureView = WebGPU.fromAPI(attachment.view)
1141+
var textureView =
1142+
attachment.view != nil
1143+
? WebGPU.TextureOrTextureView(WebGPU.fromAPI(attachment.view))
1144+
: WebGPU.TextureOrTextureView(WebGPU.fromAPI(attachment.texture))
11251145
if hasStencilComponent {
11261146
mtlAttachment!.texture = textureView.texture()
11271147
}
@@ -1165,7 +1185,7 @@ extension WebGPU.CommandEncoder {
11651185
}
11661186

11671187
if attachmentsToClear.count != 0 || depthStencilAttachmentToClear != nil {
1168-
let attachment = wgpuGetRenderPassDescriptorDepthSencilAttachment(descriptorSpan)?[0]
1188+
let attachment = wgpuGetRenderPassDescriptorDepthStencilAttachment(descriptorSpan)?[0]
11691189
if attachment != nil && depthStencilAttachmentToClear != nil {
11701190
// FIXME: rdar://138042799 remove default argument.
11711191
WebGPU.fromAPI(attachment!.view).setPreviouslyCleared(0, 0)
@@ -1514,13 +1534,13 @@ extension WebGPU.CommandEncoder {
15141534
return
15151535
}
15161536
let apiBuffer = WebGPU.fromAPI(source.buffer)
1517-
apiBuffer.setCommandEncoder(self, false)
1537+
apiBuffer.setCommandEncoder(self, false)
15181538
destinationTexture.setCommandEncoder(self)
15191539
guard copySize.width != 0 || copySize.height != 0 || copySize.depthOrArrayLayers != 0, !apiBuffer.isDestroyed(), !destinationTexture.isDestroyed() else {
15201540
return
15211541
}
15221542
guard let blitCommandEncoder = self.ensureBlitCommandEncoder() else {
1523-
return
1543+
return
15241544
}
15251545
var sourceBytesPerRow: UInt = UInt(source.layout.bytesPerRow)
15261546
guard let sourceBuffer = apiBuffer.buffer() else {

Source/WebGPU/WebGPU/Internal/WebGPUSwiftInternal.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "Queue.h"
4040
#include "RenderPassEncoder.h"
4141
#include "Texture.h"
42+
#include "TextureOrTextureView.h"
4243
#include "TextureView.h"
4344
#include "WebGPU.h"
4445
#include <algorithm>
@@ -111,6 +112,11 @@ inline bool isValidToUseWithTextureCommandEncoder(const WebGPU::Texture& texture
111112
return WebGPU::isValidToUseWith(texture, commandEncoder);
112113
}
113114

115+
inline bool isValidToUseWith(const WebGPU::TextureOrTextureView& texture, const WebGPU::CommandEncoder& commandEncoder)
116+
{
117+
return WebGPU::isValidToUseWith(texture, commandEncoder);
118+
}
119+
114120
inline double clampDouble(const double& v, const double& lo, const double& hi)
115121
{
116122
return std::clamp(v, lo, hi);

0 commit comments

Comments
 (0)