summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/SupportedLimits.h
blob: 3c38ae63431516ff86afda145d1ee944c1f8e720 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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_