summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/SupportedLimits.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/webgpu/SupportedLimits.h')
-rw-r--r--dom/webgpu/SupportedLimits.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/dom/webgpu/SupportedLimits.h b/dom/webgpu/SupportedLimits.h
new file mode 100644
index 0000000000..3c38ae6343
--- /dev/null
+++ b/dom/webgpu/SupportedLimits.h
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef GPU_SupportedLimits_H_
+#define GPU_SupportedLimits_H_
+
+#include "nsWrapperCache.h"
+#include "ObjectModel.h"
+
+namespace mozilla::webgpu {
+namespace ffi {
+struct WGPULimits;
+}
+class Adapter;
+
+class SupportedLimits final : public nsWrapperCache, public ChildOf<Adapter> {
+ const UniquePtr<ffi::WGPULimits> mLimits;
+
+ public:
+ GPU_DECL_CYCLE_COLLECTION(SupportedLimits)
+ GPU_DECL_JS_WRAP(SupportedLimits)
+
+ uint32_t MaxTextureDimension1D() const;
+ uint32_t MaxTextureDimension2D() const;
+ uint32_t MaxTextureDimension3D() const;
+ uint32_t MaxTextureArrayLayers() const;
+ uint32_t MaxBindGroups() const;
+ uint32_t MaxDynamicUniformBuffersPerPipelineLayout() const;
+ uint32_t MaxDynamicStorageBuffersPerPipelineLayout() const;
+ uint32_t MaxSampledTexturesPerShaderStage() const;
+ uint32_t MaxSamplersPerShaderStage() const;
+ uint32_t MaxStorageBuffersPerShaderStage() const;
+ uint32_t MaxStorageTexturesPerShaderStage() const;
+ uint32_t MaxUniformBuffersPerShaderStage() const;
+ uint32_t MaxUniformBufferBindingSize() const;
+ uint32_t MaxStorageBufferBindingSize() const;
+ uint32_t MinUniformBufferOffsetAlignment() const;
+ uint32_t MinStorageBufferOffsetAlignment() const;
+ uint32_t MaxVertexBuffers() const;
+ uint32_t MaxVertexAttributes() const;
+ uint32_t MaxVertexBufferArrayStride() const;
+ uint32_t MaxInterStageShaderComponents() const;
+ uint32_t MaxComputeWorkgroupStorageSize() const;
+ uint32_t MaxComputeInvocationsPerWorkgroup() const;
+ uint32_t MaxComputeWorkgroupSizeX() const;
+ uint32_t MaxComputeWorkgroupSizeY() const;
+ uint32_t MaxComputeWorkgroupSizeZ() const;
+ uint32_t MaxComputeWorkgroupsPerDimension() const;
+
+ SupportedLimits(Adapter* const aParent, UniquePtr<ffi::WGPULimits>&& aLimits);
+
+ private:
+ ~SupportedLimits();
+ void Cleanup() {}
+};
+
+} // namespace mozilla::webgpu
+
+#endif // GPU_SupportedLimits_H_