wgpu 0.19.0__py3-none-win_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. wgpu/__init__.py +19 -0
  2. wgpu/__pyinstaller/__init__.py +12 -0
  3. wgpu/__pyinstaller/conftest.py +1 -0
  4. wgpu/__pyinstaller/hook-wgpu.py +30 -0
  5. wgpu/__pyinstaller/test_wgpu.py +30 -0
  6. wgpu/_classes.py +2628 -0
  7. wgpu/_coreutils.py +226 -0
  8. wgpu/_diagnostics.py +524 -0
  9. wgpu/_version.py +113 -0
  10. wgpu/backends/__init__.py +37 -0
  11. wgpu/backends/auto.py +27 -0
  12. wgpu/backends/js_webgpu/__init__.py +31 -0
  13. wgpu/backends/wgpu_native/__init__.py +23 -0
  14. wgpu/backends/wgpu_native/_api.py +3646 -0
  15. wgpu/backends/wgpu_native/_ffi.py +208 -0
  16. wgpu/backends/wgpu_native/_helpers.py +513 -0
  17. wgpu/backends/wgpu_native/_mappings.py +491 -0
  18. wgpu/backends/wgpu_native/extras.py +121 -0
  19. wgpu/classes.py +8 -0
  20. wgpu/enums.py +411 -0
  21. wgpu/flags.py +70 -0
  22. wgpu/gui/__init__.py +12 -0
  23. wgpu/gui/_gui_utils.py +160 -0
  24. wgpu/gui/auto.py +191 -0
  25. wgpu/gui/base.py +389 -0
  26. wgpu/gui/glfw.py +628 -0
  27. wgpu/gui/jupyter.py +126 -0
  28. wgpu/gui/offscreen.py +99 -0
  29. wgpu/gui/qt.py +546 -0
  30. wgpu/gui/wx.py +519 -0
  31. wgpu/resources/__init__.py +1 -0
  32. wgpu/resources/codegen_report.md +40 -0
  33. wgpu/resources/webgpu.h +2091 -0
  34. wgpu/resources/webgpu.idl +1331 -0
  35. wgpu/resources/wgpu.h +301 -0
  36. wgpu/resources/wgpu_native-release.dll +0 -0
  37. wgpu/structs.py +757 -0
  38. wgpu/utils/__init__.py +21 -0
  39. wgpu/utils/compute.py +200 -0
  40. wgpu/utils/device.py +17 -0
  41. wgpu/utils/imgui/__init__.py +2 -0
  42. wgpu/utils/imgui/imgui_backend.py +501 -0
  43. wgpu/utils/imgui/imgui_renderer.py +205 -0
  44. wgpu-0.19.0.dist-info/METADATA +260 -0
  45. wgpu-0.19.0.dist-info/RECORD +48 -0
  46. wgpu-0.19.0.dist-info/WHEEL +4 -0
  47. wgpu-0.19.0.dist-info/entry_points.txt +3 -0
  48. wgpu-0.19.0.dist-info/licenses/LICENSE +25 -0
wgpu/__init__.py ADDED
@@ -0,0 +1,19 @@
1
+ """
2
+ WebGPU for Python.
3
+ """
4
+
5
+ # ruff: noqa: F401, F403
6
+
7
+ from ._coreutils import logger
8
+ from ._version import __version__, version_info
9
+ from ._diagnostics import diagnostics, DiagnosticsBase
10
+ from .flags import *
11
+ from .enums import *
12
+ from .classes import *
13
+ from .gui import WgpuCanvasInterface
14
+ from . import utils
15
+ from . import backends
16
+ from . import resources
17
+
18
+ # The API entrypoint, from wgpu.classes - gets replaced when a backend loads.
19
+ gpu = GPU() # noqa: F405
@@ -0,0 +1,12 @@
1
+ from os.path import dirname
2
+
3
+
4
+ HERE = dirname(__file__)
5
+
6
+
7
+ def get_hook_dirs():
8
+ return [HERE]
9
+
10
+
11
+ def get_test_dirs():
12
+ return [HERE]
@@ -0,0 +1 @@
1
+ from PyInstaller.utils.conftest import * # noqa: F403
@@ -0,0 +1,30 @@
1
+ # ruff: noqa: N999
2
+
3
+ from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs
4
+
5
+ # Init variables that PyInstaller will pick up.
6
+ hiddenimports = []
7
+ datas = []
8
+ binaries = []
9
+
10
+ # Include our resource data and binaries.
11
+ datas += collect_data_files("wgpu", subdir="resources")
12
+ binaries += collect_dynamic_libs("wgpu")
13
+
14
+ # Always include the wgpu-native backend. Since an import is not needed to
15
+ # load this (default) backend, PyInstaller does not see it by itself.
16
+ hiddenimports += ["wgpu.backends.auto", "wgpu.backends.wgpu_native"]
17
+
18
+ # For the GUI backends, there always is an import. The auto backend is
19
+ # problematic because PyInstaller cannot follow it to a specific
20
+ # backend. Also, glfw does not have a hook like this, so it does not
21
+ # include the binary when freezing. We can solve both problems with the
22
+ # code below. Makes the binary a bit larger, but only marginally (less
23
+ # than 300kb).
24
+ try:
25
+ import glfw # noqa: F401
26
+ except ImportError:
27
+ pass
28
+ else:
29
+ hiddenimports += ["wgpu.gui.glfw"]
30
+ binaries += collect_dynamic_libs("glfw")
@@ -0,0 +1,30 @@
1
+ script = """
2
+ # The script part
3
+ import sys
4
+ import wgpu
5
+ import importlib
6
+
7
+ # The test part
8
+ if "is_test" in sys.argv:
9
+ included_modules = [
10
+ "wgpu.backends.auto",
11
+ "wgpu.backends.wgpu_native",
12
+ "wgpu.gui.glfw",
13
+ ]
14
+ excluded_modules = [
15
+ "PySide6",
16
+ "PyQt6",
17
+ ]
18
+ for module_name in included_modules:
19
+ importlib.import_module(module_name)
20
+ for module_name in excluded_modules:
21
+ try:
22
+ importlib.import_module(module_name)
23
+ except ModuleNotFoundError:
24
+ continue
25
+ raise RuntimeError(module_name + " is not supposed to be importable.")
26
+ """
27
+
28
+
29
+ def test_pyi_wgpu(pyi_builder):
30
+ pyi_builder.test_source(script, app_args=["is_test"])