[node] Remove unnecessary "or undefined"
These never actually return undefined, so they don't need it in the
type, unless we want to be able to enable/disable Compat in dawn.node,
which we don't have right now. (They were there originally just because
they matched min/maxSubgroupSize but those don't exist anymore.)
Bug: none
Change-Id: I1f28e1c9c17a61a4457050594d6f20f57d489273
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/244555
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Gregg Tavares <gman@chromium.org>
diff --git a/src/dawn/node/binding/GPUSupportedLimits.cpp b/src/dawn/node/binding/GPUSupportedLimits.cpp
index 3ca271f..29109aa 100644
--- a/src/dawn/node/binding/GPUSupportedLimits.cpp
+++ b/src/dawn/node/binding/GPUSupportedLimits.cpp
@@ -164,25 +164,20 @@
return limits_.maxComputeWorkgroupsPerDimension;
}
-std::variant<uint32_t, interop::UndefinedType>
-GPUSupportedLimits::getMaxStorageBuffersInFragmentStage(Napi::Env) {
- return std::variant<uint32_t, interop::UndefinedType>(limits_.maxStorageBuffersInFragmentStage);
+uint32_t GPUSupportedLimits::getMaxStorageBuffersInFragmentStage(Napi::Env) {
+ return limits_.maxStorageBuffersInFragmentStage;
}
-std::variant<uint32_t, interop::UndefinedType>
-GPUSupportedLimits::getMaxStorageTexturesInFragmentStage(Napi::Env) {
- return std::variant<uint32_t, interop::UndefinedType>(
- limits_.maxStorageTexturesInFragmentStage);
+uint32_t GPUSupportedLimits::getMaxStorageTexturesInFragmentStage(Napi::Env) {
+ return limits_.maxStorageTexturesInFragmentStage;
}
-std::variant<uint32_t, interop::UndefinedType>
-GPUSupportedLimits::getMaxStorageBuffersInVertexStage(Napi::Env) {
- return std::variant<uint32_t, interop::UndefinedType>(limits_.maxStorageBuffersInVertexStage);
+uint32_t GPUSupportedLimits::getMaxStorageBuffersInVertexStage(Napi::Env) {
+ return limits_.maxStorageBuffersInVertexStage;
}
-std::variant<uint32_t, interop::UndefinedType>
-GPUSupportedLimits::getMaxStorageTexturesInVertexStage(Napi::Env) {
- return std::variant<uint32_t, interop::UndefinedType>(limits_.maxStorageTexturesInVertexStage);
+uint32_t GPUSupportedLimits::getMaxStorageTexturesInVertexStage(Napi::Env) {
+ return limits_.maxStorageTexturesInVertexStage;
}
} // namespace wgpu::binding
diff --git a/src/dawn/node/binding/GPUSupportedLimits.h b/src/dawn/node/binding/GPUSupportedLimits.h
index 66d85cc..939aa6e 100644
--- a/src/dawn/node/binding/GPUSupportedLimits.h
+++ b/src/dawn/node/binding/GPUSupportedLimits.h
@@ -73,14 +73,10 @@
uint32_t getMaxComputeWorkgroupSizeY(Napi::Env) override;
uint32_t getMaxComputeWorkgroupSizeZ(Napi::Env) override;
uint32_t getMaxComputeWorkgroupsPerDimension(Napi::Env) override;
- std::variant<uint32_t, interop::UndefinedType> getMaxStorageBuffersInFragmentStage(
- Napi::Env) override;
- std::variant<uint32_t, interop::UndefinedType> getMaxStorageTexturesInFragmentStage(
- Napi::Env) override;
- std::variant<uint32_t, interop::UndefinedType> getMaxStorageBuffersInVertexStage(
- Napi::Env) override;
- std::variant<uint32_t, interop::UndefinedType> getMaxStorageTexturesInVertexStage(
- Napi::Env) override;
+ uint32_t getMaxStorageBuffersInFragmentStage(Napi::Env) override;
+ uint32_t getMaxStorageTexturesInFragmentStage(Napi::Env) override;
+ uint32_t getMaxStorageBuffersInVertexStage(Napi::Env) override;
+ uint32_t getMaxStorageTexturesInVertexStage(Napi::Env) override;
private:
wgpu::Limits limits_;
diff --git a/src/dawn/node/interop/DawnExtensions.idl b/src/dawn/node/interop/DawnExtensions.idl
index f2c318f..abe188a 100644
--- a/src/dawn/node/interop/DawnExtensions.idl
+++ b/src/dawn/node/interop/DawnExtensions.idl
@@ -81,8 +81,8 @@
// TODO(crbug.com/354751907) Move to GPUAdapterInfo
interface GPUSupportedLimits {
- readonly attribute (unsigned long or undefined) maxStorageBuffersInFragmentStage;
- readonly attribute (unsigned long or undefined) maxStorageTexturesInFragmentStage;
- readonly attribute (unsigned long or undefined) maxStorageBuffersInVertexStage;
- readonly attribute (unsigned long or undefined) maxStorageTexturesInVertexStage;
+ readonly attribute unsigned long maxStorageBuffersInFragmentStage;
+ readonly attribute unsigned long maxStorageTexturesInFragmentStage;
+ readonly attribute unsigned long maxStorageBuffersInVertexStage;
+ readonly attribute unsigned long maxStorageTexturesInVertexStage;
};