[dawn][webgpu.h] Remove deprecated const char* entrypoints
Bug: 42241188
Change-Id: I4a4545f170330868b5b757ecc3005c6d0bb46dbd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/209497
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
diff --git a/src/dawn/dawn.json b/src/dawn/dawn.json
index 346941a..2b2cb28 100644
--- a/src/dawn/dawn.json
+++ b/src/dawn/dawn.json
@@ -338,13 +338,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -379,13 +372,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -669,13 +655,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
},
@@ -849,13 +828,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -939,25 +911,12 @@
"name": "inject validation error",
"tags": ["dawn"],
"args": [
- {"name": "message", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "inject validation error 2",
- "tags": ["dawn"],
- "args": [
{"name": "message", "type": "string view"}
]
},
{
"name": "insert debug marker",
"args": [
- {"name": "marker label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "insert debug marker 2",
- "args": [
{"name": "marker label", "type": "string view"}
]
},
@@ -968,12 +927,6 @@
{
"name": "push debug group",
"args": [
- {"name": "group label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "push debug group 2",
- "args": [
{"name": "group label", "type": "string view"}
]
},
@@ -1008,13 +961,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -1130,12 +1076,6 @@
{
"name": "insert debug marker",
"args": [
- {"name": "marker label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "insert debug marker 2",
- "args": [
{"name": "marker label", "type": "string view"}
]
},
@@ -1146,12 +1086,6 @@
{
"name": "push debug group",
"args": [
- {"name": "group label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "push debug group 2",
- "args": [
{"name": "group label", "type": "string view"}
]
},
@@ -1200,13 +1134,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -1244,13 +1171,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -1565,15 +1485,6 @@
"tags": ["dawn"],
"args": [
{"name": "descriptor", "type": "shader module descriptor", "annotation": "const*"},
- {"name": "error message", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "create error shader module 2",
- "returns": "shader module",
- "tags": ["dawn"],
- "args": [
- {"name": "descriptor", "type": "shader module descriptor", "annotation": "const*"},
{"name": "error message", "type": "string view"}
]
},
@@ -1662,14 +1573,6 @@
"name": "inject error",
"args": [
{"name": "type", "type": "error type"},
- {"name": "message", "type": "char", "annotation": "const*", "length": "strlen"}
- ],
- "tags": ["dawn"]
- },
- {
- "name": "inject error 2",
- "args": [
- {"name": "type", "type": "error type"},
{"name": "message", "type": "string view"}
],
"tags": ["dawn"]
@@ -1678,14 +1581,6 @@
"name": "force loss",
"args": [
{"name": "type", "type": "device lost reason"},
- {"name": "message", "type": "char", "annotation": "const*", "length": "strlen"}
- ],
- "tags": ["dawn"]
- },
- {
- "name": "force loss 2",
- "args": [
- {"name": "type", "type": "device lost reason"},
{"name": "message", "type": "string view"}
],
"tags": ["dawn"]
@@ -1757,13 +1652,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
},
@@ -2037,13 +1925,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
},
@@ -2111,13 +1992,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
},
@@ -2183,13 +2057,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
},
@@ -2936,13 +2803,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -3024,13 +2884,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
},
@@ -3144,13 +2997,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -3211,13 +3057,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -3279,12 +3118,6 @@
{
"name": "insert debug marker",
"args": [
- {"name": "marker label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "insert debug marker 2",
- "args": [
{"name": "marker label", "type": "string view"}
]
},
@@ -3295,12 +3128,6 @@
{
"name": "push debug group",
"args": [
- {"name": "group label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "push debug group 2",
- "args": [
{"name": "group label", "type": "string view"}
]
},
@@ -3333,13 +3160,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -3546,12 +3366,6 @@
{
"name": "insert debug marker",
"args": [
- {"name": "marker label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "insert debug marker 2",
- "args": [
{"name": "marker label", "type": "string view"}
]
},
@@ -3562,12 +3376,6 @@
{
"name": "push debug group",
"args": [
- {"name": "group label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "push debug group 2",
- "args": [
{"name": "group label", "type": "string view"}
]
},
@@ -3649,13 +3457,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -3683,13 +3484,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -3855,13 +3649,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -3916,13 +3703,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -4051,13 +3831,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
@@ -4302,13 +4075,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
},
@@ -4575,13 +4341,6 @@
"name": "set label",
"returns": "void",
"args": [
- {"name": "label", "type": "char", "annotation": "const*", "length": "strlen"}
- ]
- },
- {
- "name": "set label 2",
- "returns": "void",
- "args": [
{"name": "label", "type": "string view"}
]
}
diff --git a/src/dawn/native/CommandEncoder.cpp b/src/dawn/native/CommandEncoder.cpp
index 9cfc694..a456c99 100644
--- a/src/dawn/native/CommandEncoder.cpp
+++ b/src/dawn/native/CommandEncoder.cpp
@@ -1902,7 +1902,7 @@
"encoding %s.ClearBuffer(%s, %u, %u).", this, buffer, offset, size);
}
-void CommandEncoder::APIInjectValidationError2(StringView messageIn) {
+void CommandEncoder::APIInjectValidationError(StringView messageIn) {
std::string_view message = utils::NormalizeMessageString(messageIn);
mEncodingContext.TryEncode(
this,
@@ -1912,7 +1912,7 @@
"injecting validation error: %s.", message);
}
-void CommandEncoder::APIInsertDebugMarker2(StringView markerIn) {
+void CommandEncoder::APIInsertDebugMarker(StringView markerIn) {
std::string_view marker = utils::NormalizeMessageString(markerIn);
mEncodingContext.TryEncode(
this,
@@ -1942,7 +1942,7 @@
"encoding %s.PopDebugGroup().", this);
}
-void CommandEncoder::APIPushDebugGroup2(StringView groupLabelIn) {
+void CommandEncoder::APIPushDebugGroup(StringView groupLabelIn) {
std::string_view groupLabel = utils::NormalizeMessageString(groupLabelIn);
mEncodingContext.TryEncode(
this,
diff --git a/src/dawn/native/CommandEncoder.h b/src/dawn/native/CommandEncoder.h
index 12c3e2d..a94457d 100644
--- a/src/dawn/native/CommandEncoder.h
+++ b/src/dawn/native/CommandEncoder.h
@@ -91,14 +91,10 @@
const Extent3D* copySize);
void APIClearBuffer(BufferBase* destination, uint64_t destinationOffset, uint64_t size);
- // TODO(crbug.com/42241188): Remove const char* version of the methods.
- void APIInjectValidationError(const char* message) { APIInjectValidationError2(message); }
- void APIInjectValidationError2(StringView message);
- void APIInsertDebugMarker(const char* groupLabel) { APIInsertDebugMarker2(groupLabel); }
- void APIInsertDebugMarker2(StringView groupLabel);
+ void APIInjectValidationError(StringView message);
+ void APIInsertDebugMarker(StringView groupLabel);
void APIPopDebugGroup();
- void APIPushDebugGroup(const char* groupLabel) { APIPushDebugGroup2(groupLabel); }
- void APIPushDebugGroup2(StringView groupLabel);
+ void APIPushDebugGroup(StringView groupLabel);
void APIResolveQuerySet(QuerySetBase* querySet,
uint32_t firstQuery,
diff --git a/src/dawn/native/Device.cpp b/src/dawn/native/Device.cpp
index c41eb0e..fd8f037 100644
--- a/src/dawn/native/Device.cpp
+++ b/src/dawn/native/Device.cpp
@@ -982,7 +982,7 @@
return {};
}
-void DeviceBase::APIForceLoss2(wgpu::DeviceLostReason reason, StringView messageIn) {
+void DeviceBase::APIForceLoss(wgpu::DeviceLostReason reason, StringView messageIn) {
std::string_view message = utils::NormalizeMessageString(messageIn);
if (mState != State::Alive) {
return;
@@ -1608,8 +1608,8 @@
return ReturnToAPI(std::move(result));
}
-ShaderModuleBase* DeviceBase::APICreateErrorShaderModule2(const ShaderModuleDescriptor* descriptor,
- StringView errorMessage) {
+ShaderModuleBase* DeviceBase::APICreateErrorShaderModule(const ShaderModuleDescriptor* descriptor,
+ StringView errorMessage) {
Ref<ShaderModuleBase> result =
ShaderModuleBase::MakeError(this, descriptor ? descriptor->label : nullptr);
std::unique_ptr<OwnedCompilationMessages> compilationMessages(
@@ -2009,7 +2009,7 @@
return mEnabledFeatures.EnumerateFeatures(features);
}
-void DeviceBase::APIInjectError2(wgpu::ErrorType type, StringView message) {
+void DeviceBase::APIInjectError(wgpu::ErrorType type, StringView message) {
if (ConsumedError(ValidateErrorType(type))) {
return;
}
@@ -2438,12 +2438,7 @@
return mLabel;
}
-void DeviceBase::APISetLabel(const char* label) {
- mLabel = label ? label : "";
- SetLabelImpl();
-}
-
-void DeviceBase::APISetLabel2(StringView label) {
+void DeviceBase::APISetLabel(StringView label) {
mLabel = utils::NormalizeMessageString(label);
SetLabelImpl();
}
diff --git a/src/dawn/native/Device.h b/src/dawn/native/Device.h
index dd88465..7979f28 100644
--- a/src/dawn/native/Device.h
+++ b/src/dawn/native/Device.h
@@ -271,10 +271,6 @@
SamplerBase* APICreateSampler(const SamplerDescriptor* descriptor);
ShaderModuleBase* APICreateShaderModule(const ShaderModuleDescriptor* descriptor);
ShaderModuleBase* APICreateErrorShaderModule(const ShaderModuleDescriptor* descriptor,
- const char* errorMessage) {
- return APICreateErrorShaderModule2(descriptor, errorMessage);
- }
- ShaderModuleBase* APICreateErrorShaderModule2(const ShaderModuleDescriptor* descriptor,
StringView errorMessage);
TextureBase* APICreateTexture(const TextureDescriptor* descriptor);
@@ -293,11 +289,7 @@
wgpu::Status APIGetLimits(SupportedLimits* limits) const;
bool APIHasFeature(wgpu::FeatureName feature) const;
size_t APIEnumerateFeatures(wgpu::FeatureName* features) const;
- void APIInjectError(wgpu::ErrorType type, const char* message) {
- // TODO(crbug.com/42241188): Remove const char* version of the method.
- APIInjectError2(type, message);
- }
- void APIInjectError2(wgpu::ErrorType type, StringView message);
+ void APIInjectError(wgpu::ErrorType type, StringView message);
bool APITick();
void APIValidateTextureDescriptor(const TextureDescriptor* desc);
@@ -367,11 +359,7 @@
void EmitLog(std::string_view message);
void EmitLog(WGPULoggingType loggingType, std::string_view message);
void EmitCompilationLog(const ShaderModuleBase* module);
- void APIForceLoss(wgpu::DeviceLostReason reason, const char* message) {
- // TODO(crbug.com/42241188): Remove const char* version of the method.
- return APIForceLoss2(reason, message);
- }
- void APIForceLoss2(wgpu::DeviceLostReason reason, StringView message);
+ void APIForceLoss(wgpu::DeviceLostReason reason, StringView message);
QueueBase* GetQueue() const;
friend class IgnoreLazyClearCountScope;
@@ -421,9 +409,7 @@
const CacheKey& GetCacheKey() const;
const std::string& GetLabel() const;
- // TODO(crbug.com/42241188): Remove const char* version of the method.
- void APISetLabel(const char* label);
- void APISetLabel2(StringView label);
+ void APISetLabel(StringView label);
void APIDestroy();
virtual void AppendDebugLayerMessages(ErrorData* error) {}
diff --git a/src/dawn/native/ObjectBase.cpp b/src/dawn/native/ObjectBase.cpp
index aaf4102..a08b136 100644
--- a/src/dawn/native/ObjectBase.cpp
+++ b/src/dawn/native/ObjectBase.cpp
@@ -101,11 +101,7 @@
DAWN_ASSERT(!IsAlive());
}
-void ApiObjectBase::APISetLabel(const char* label) {
- SetLabel(std::string(label ? label : ""));
-}
-
-void ApiObjectBase::APISetLabel2(StringView label) {
+void ApiObjectBase::APISetLabel(StringView label) {
SetLabel(std::string(utils::NormalizeMessageString(label)));
}
diff --git a/src/dawn/native/ObjectBase.h b/src/dawn/native/ObjectBase.h
index c69d660..16fc9e7 100644
--- a/src/dawn/native/ObjectBase.h
+++ b/src/dawn/native/ObjectBase.h
@@ -141,9 +141,7 @@
void Destroy();
// Dawn API
- // TODO(crbug.com/42241188): Remove const char* version of the method.
- void APISetLabel(const char* label);
- void APISetLabel2(StringView label);
+ void APISetLabel(StringView label);
protected:
// Overriding of the RefCounted's DeleteThis function ensures that instances of objects
diff --git a/src/dawn/native/ProgrammableEncoder.cpp b/src/dawn/native/ProgrammableEncoder.cpp
index e7ad6ee..cd77359 100644
--- a/src/dawn/native/ProgrammableEncoder.cpp
+++ b/src/dawn/native/ProgrammableEncoder.cpp
@@ -68,7 +68,7 @@
return {};
}
-void ProgrammableEncoder::APIInsertDebugMarker2(StringView markerIn) {
+void ProgrammableEncoder::APIInsertDebugMarker(StringView markerIn) {
std::string_view marker = utils::NormalizeMessageString(markerIn);
mEncodingContext->TryEncode(
this,
@@ -99,7 +99,7 @@
"encoding %s.PopDebugGroup().", this);
}
-void ProgrammableEncoder::APIPushDebugGroup2(StringView groupLabelIn) {
+void ProgrammableEncoder::APIPushDebugGroup(StringView groupLabelIn) {
std::string_view groupLabel = utils::NormalizeMessageString(groupLabelIn);
mEncodingContext->TryEncode(
this,
diff --git a/src/dawn/native/ProgrammableEncoder.h b/src/dawn/native/ProgrammableEncoder.h
index d843e09..600ac0e 100644
--- a/src/dawn/native/ProgrammableEncoder.h
+++ b/src/dawn/native/ProgrammableEncoder.h
@@ -48,12 +48,9 @@
public:
ProgrammableEncoder(DeviceBase* device, StringView label, EncodingContext* encodingContext);
- // TODO(crbug.com/42241188): Remove const char* version of the methods.
- void APIInsertDebugMarker(const char* groupLabel) { APIInsertDebugMarker2(groupLabel); }
- void APIInsertDebugMarker2(StringView groupLabel);
+ void APIInsertDebugMarker(StringView groupLabel);
void APIPopDebugGroup();
- void APIPushDebugGroup(const char* groupLabel) { APIPushDebugGroup2(groupLabel); }
- void APIPushDebugGroup2(StringView groupLabel);
+ void APIPushDebugGroup(StringView groupLabel);
protected:
bool IsValidationEnabled() const;
diff --git a/src/dawn/native/Surface.cpp b/src/dawn/native/Surface.cpp
index 8f4e823..03548c6 100644
--- a/src/dawn/native/Surface.cpp
+++ b/src/dawn/native/Surface.cpp
@@ -600,11 +600,7 @@
}
}
-void Surface::APISetLabel(const char* label) {
- mLabel = label ? label : "";
-}
-
-void Surface::APISetLabel2(StringView label) {
+void Surface::APISetLabel(StringView label) {
mLabel = utils::NormalizeMessageString(label);
}
diff --git a/src/dawn/native/Surface.h b/src/dawn/native/Surface.h
index 401e3d0..eaabd5a 100644
--- a/src/dawn/native/Surface.h
+++ b/src/dawn/native/Surface.h
@@ -122,9 +122,7 @@
void APIGetCurrentTexture(SurfaceTexture* surfaceTexture) const;
void APIPresent();
void APIUnconfigure();
- // TODO(crbug.com/42241188): Remove const char* version of the method.
- void APISetLabel(const char* label);
- void APISetLabel2(StringView label);
+ void APISetLabel(StringView label);
private:
Surface(InstanceBase* instance, ErrorMonad::ErrorTag tag);
diff --git a/src/dawn/tests/unittests/wire/WireArgumentTests.cpp b/src/dawn/tests/unittests/wire/WireArgumentTests.cpp
index 20da662..5203e927 100644
--- a/src/dawn/tests/unittests/wire/WireArgumentTests.cpp
+++ b/src/dawn/tests/unittests/wire/WireArgumentTests.cpp
@@ -183,44 +183,44 @@
const char* label = "null-terminated label\0more string";
vsModule.SetLabel(std::string_view(label));
- EXPECT_CALL(api, ShaderModuleSetLabel2(apiVsModule,
- AllOf(Field(&WGPUStringView::data, EqBytes(label, 21u)),
- Field(&WGPUStringView::length, Eq(21u)))));
+ EXPECT_CALL(api, ShaderModuleSetLabel(apiVsModule,
+ AllOf(Field(&WGPUStringView::data, EqBytes(label, 21u)),
+ Field(&WGPUStringView::length, Eq(21u)))));
FlushClient();
// Give it a longer, explicit length that contains the null-terminator.
vsModule.SetLabel(std::string_view(label, 34));
- EXPECT_CALL(api, ShaderModuleSetLabel2(apiVsModule,
- AllOf(Field(&WGPUStringView::data, EqBytes(label, 34u)),
- Field(&WGPUStringView::length, Eq(34u)))));
+ EXPECT_CALL(api, ShaderModuleSetLabel(apiVsModule,
+ AllOf(Field(&WGPUStringView::data, EqBytes(label, 34u)),
+ Field(&WGPUStringView::length, Eq(34u)))));
FlushClient();
// Give it a shorder, explicit length.
vsModule.SetLabel(std::string_view(label, 2));
- EXPECT_CALL(api, ShaderModuleSetLabel2(apiVsModule,
- AllOf(Field(&WGPUStringView::data, EqBytes(label, 2u)),
- Field(&WGPUStringView::length, Eq(2u)))));
+ EXPECT_CALL(api, ShaderModuleSetLabel(apiVsModule,
+ AllOf(Field(&WGPUStringView::data, EqBytes(label, 2u)),
+ Field(&WGPUStringView::length, Eq(2u)))));
FlushClient();
// Give it a zero length.
vsModule.SetLabel(std::string_view(label, 0));
EXPECT_CALL(
- api, ShaderModuleSetLabel2(apiVsModule, AllOf(Field(&WGPUStringView::data, EqBytes("", 1u)),
- Field(&WGPUStringView::length, Eq(0u)))));
+ api, ShaderModuleSetLabel(apiVsModule, AllOf(Field(&WGPUStringView::data, EqBytes("", 1u)),
+ Field(&WGPUStringView::length, Eq(0u)))));
FlushClient();
// Give it zero length and data.
vsModule.SetLabel(std::string_view(nullptr, 0));
EXPECT_CALL(api,
- ShaderModuleSetLabel2(apiVsModule, AllOf(Field(&WGPUStringView::data, nullptr),
- Field(&WGPUStringView::length, Eq(0u)))));
+ ShaderModuleSetLabel(apiVsModule, AllOf(Field(&WGPUStringView::data, nullptr),
+ Field(&WGPUStringView::length, Eq(0u)))));
FlushClient();
// Give it the nil string with nullopt.
vsModule.SetLabel(std::nullopt);
- EXPECT_CALL(api, ShaderModuleSetLabel2(apiVsModule,
- AllOf(Field(&WGPUStringView::data, nullptr),
- Field(&WGPUStringView::length, Eq(WGPU_STRLEN)))));
+ EXPECT_CALL(api, ShaderModuleSetLabel(apiVsModule,
+ AllOf(Field(&WGPUStringView::data, nullptr),
+ Field(&WGPUStringView::length, Eq(WGPU_STRLEN)))));
FlushClient();
}
diff --git a/src/dawn/wire/client/Device.cpp b/src/dawn/wire/client/Device.cpp
index 851f16c..8923e75 100644
--- a/src/dawn/wire/client/Device.cpp
+++ b/src/dawn/wire/client/Device.cpp
@@ -461,7 +461,7 @@
.SetFutureReady<PopErrorScopeEvent>(future.id, errorType, message);
}
-void Device::InjectError(WGPUErrorType type, const char* message) {
+void Device::InjectError(WGPUErrorType type, WGPUStringView message) {
DeviceInjectErrorCmd cmd;
cmd.self = ToAPI(this);
cmd.type = type;
diff --git a/src/dawn/wire/client/Device.h b/src/dawn/wire/client/Device.h
index 333c372..c7503e2 100644
--- a/src/dawn/wire/client/Device.h
+++ b/src/dawn/wire/client/Device.h
@@ -69,7 +69,7 @@
void SetUncapturedErrorCallback(WGPUErrorCallback errorCallback, void* errorUserdata);
void SetLoggingCallback(WGPULoggingCallback errorCallback, void* errorUserdata);
void SetDeviceLostCallback(WGPUDeviceLostCallback errorCallback, void* errorUserdata);
- void InjectError(WGPUErrorType type, const char* message);
+ void InjectError(WGPUErrorType type, WGPUStringView message);
void PopErrorScope(WGPUErrorCallback callback, void* userdata);
WGPUFuture PopErrorScopeF(const WGPUPopErrorScopeCallbackInfo& callbackInfo);
WGPUFuture PopErrorScope2(const WGPUPopErrorScopeCallbackInfo2& callbackInfo);