react-native-wgpu 0.2.10 → 0.3.0
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.
- package/README.md +155 -69
- package/android/CMakeLists.txt +4 -5
- package/android/build.gradle +7 -18
- package/android/src/main/java/com/webgpu/WebGPUViewPackage.java +34 -10
- package/apple/MetalView.mm +0 -19
- package/apple/WebGPUModule.h +1 -9
- package/apple/WebGPUModule.mm +0 -3
- package/apple/WebGPUView.h +0 -3
- package/apple/WebGPUView.mm +0 -2
- package/cpp/WGPULogger.h +10 -0
- package/cpp/dawn/dawn_proc_table.h +1 -1
- package/cpp/dawn/webgpu.h +4855 -0
- package/cpp/dawn/webgpu_cpp.h +10168 -0
- package/cpp/dawn/wire/client/webgpu.h +354 -0
- package/cpp/dawn/wire/client/webgpu_cpp.h +10343 -0
- package/cpp/dawn/wire/client/webgpu_cpp_print.h +2715 -0
- package/cpp/jsi/RNFJSIConverter.h +17 -59
- package/cpp/rnwgpu/RNWebGPUManager.cpp +1 -9
- package/cpp/rnwgpu/api/GPU.cpp +51 -26
- package/cpp/rnwgpu/api/GPU.h +5 -18
- package/cpp/rnwgpu/api/GPUAdapter.cpp +75 -54
- package/cpp/rnwgpu/api/GPUAdapter.h +6 -6
- package/cpp/rnwgpu/api/GPUAdapterInfo.h +0 -1
- package/cpp/rnwgpu/api/GPUBindGroup.h +1 -3
- package/cpp/rnwgpu/api/GPUBindGroupLayout.h +1 -3
- package/cpp/rnwgpu/api/GPUBuffer.cpp +35 -32
- package/cpp/rnwgpu/api/GPUBuffer.h +9 -7
- package/cpp/rnwgpu/api/GPUCanvasContext.cpp +5 -1
- package/cpp/rnwgpu/api/GPUCanvasContext.h +0 -2
- package/cpp/rnwgpu/api/GPUCommandBuffer.h +1 -3
- package/cpp/rnwgpu/api/GPUCommandEncoder.h +1 -3
- package/cpp/rnwgpu/api/GPUCompilationInfo.h +0 -2
- package/cpp/rnwgpu/api/GPUCompilationMessage.h +1 -3
- package/cpp/rnwgpu/api/GPUComputePassEncoder.h +1 -3
- package/cpp/rnwgpu/api/GPUComputePipeline.h +1 -3
- package/cpp/rnwgpu/api/GPUDevice.cpp +183 -128
- package/cpp/rnwgpu/api/GPUDevice.h +22 -21
- package/cpp/rnwgpu/api/GPUDeviceLostInfo.h +1 -3
- package/cpp/rnwgpu/api/GPUExternalTexture.h +1 -3
- package/cpp/rnwgpu/api/GPUPipelineLayout.h +1 -3
- package/cpp/rnwgpu/api/GPUQuerySet.h +1 -3
- package/cpp/rnwgpu/api/GPUQueue.cpp +19 -8
- package/cpp/rnwgpu/api/GPUQueue.h +7 -6
- package/cpp/rnwgpu/api/GPURenderBundle.h +1 -3
- package/cpp/rnwgpu/api/GPURenderBundleEncoder.h +1 -3
- package/cpp/rnwgpu/api/GPURenderPassEncoder.h +1 -3
- package/cpp/rnwgpu/api/GPURenderPipeline.h +1 -3
- package/cpp/rnwgpu/api/GPUSampler.h +1 -3
- package/cpp/rnwgpu/api/GPUShaderModule.cpp +42 -28
- package/cpp/rnwgpu/api/GPUShaderModule.h +6 -6
- package/cpp/rnwgpu/api/GPUSupportedLimits.h +1 -3
- package/cpp/rnwgpu/api/GPUTexture.h +1 -3
- package/cpp/rnwgpu/api/GPUTextureView.h +1 -3
- package/cpp/rnwgpu/api/RNWebGPU.h +1 -7
- package/cpp/rnwgpu/async/AsyncDispatcher.h +28 -0
- package/cpp/rnwgpu/async/AsyncRunner.cpp +215 -0
- package/cpp/rnwgpu/async/AsyncRunner.h +53 -0
- package/cpp/rnwgpu/async/AsyncTaskHandle.cpp +181 -0
- package/cpp/rnwgpu/async/AsyncTaskHandle.h +55 -0
- package/cpp/rnwgpu/async/JSIMicrotaskDispatcher.cpp +23 -0
- package/cpp/rnwgpu/async/JSIMicrotaskDispatcher.h +22 -0
- package/cpp/webgpu/webgpu.h +5 -4827
- package/cpp/webgpu/webgpu_cpp.h +5 -10140
- package/cpp/{dawn/native/WebGPUBackend.h → webgpu/webgpu_cpp_print.h} +4 -20
- package/lib/commonjs/Canvas.js +6 -66
- package/lib/commonjs/Canvas.js.map +1 -1
- package/lib/commonjs/hooks.js +6 -42
- package/lib/commonjs/hooks.js.map +1 -1
- package/lib/module/Canvas.js +7 -67
- package/lib/module/Canvas.js.map +1 -1
- package/lib/module/hooks.js +5 -40
- package/lib/module/hooks.js.map +1 -1
- package/lib/typescript/lib/commonjs/hooks.d.ts +1 -5
- package/lib/typescript/lib/commonjs/hooks.d.ts.map +1 -1
- package/lib/typescript/lib/module/Canvas.d.ts.map +1 -1
- package/lib/typescript/lib/module/hooks.d.ts +1 -5
- package/lib/typescript/lib/module/hooks.d.ts.map +1 -1
- package/lib/typescript/src/Canvas.d.ts +0 -1
- package/lib/typescript/src/Canvas.d.ts.map +1 -1
- package/lib/typescript/src/hooks.d.ts +2 -7
- package/lib/typescript/src/hooks.d.ts.map +1 -1
- package/libs/android/arm64-v8a/libwebgpu_dawn.so +0 -0
- package/libs/android/armeabi-v7a/libwebgpu_dawn.so +0 -0
- package/libs/android/x86/libwebgpu_dawn.so +0 -0
- package/libs/android/x86_64/libwebgpu_dawn.so +0 -0
- package/libs/apple/libwebgpu_dawn.xcframework/Info.plist +5 -35
- package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64/libwebgpu_dawn.a +0 -0
- package/libs/apple/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/libwebgpu_dawn.a +0 -0
- package/libs/apple/libwebgpu_dawn.xcframework/macos-arm64_x86_64/libwebgpu_dawn.a +0 -0
- package/package.json +4 -3
- package/react-native-wgpu.podspec +12 -16
- package/src/Canvas.tsx +8 -69
- package/src/hooks.tsx +14 -48
- package/android/cpp/platform/ThreadUtils.cpp +0 -41
- package/android/src/oldarch/com/webgpu/NativeWebGPUModuleSpec.java +0 -23
- package/android/src/oldarch/com/webgpu/WebGPUViewManagerSpec.java +0 -12
- package/apple/WebGPUViewManager.mm +0 -24
- package/apple/platform/ThreadUtils.cpp +0 -34
- package/cpp/dawn/dawn_proc.h +0 -50
- package/cpp/dawn/dawn_thread_dispatch_proc.h +0 -47
- package/cpp/dawn/native/D3D11Backend.h +0 -77
- package/cpp/dawn/native/D3D12Backend.h +0 -68
- package/cpp/dawn/native/D3DBackend.h +0 -56
- package/cpp/dawn/native/MetalBackend.h +0 -56
- package/cpp/dawn/platform/DawnPlatform.h +0 -167
- package/cpp/dawn/platform/dawn_platform_export.h +0 -49
- package/cpp/platform/ThreadUtils.h +0 -30
- package/cpp/rnwgpu/api/AsyncRunner.h +0 -30
- package/cpp/threading/CallInvokerDispatcher.h +0 -37
- package/cpp/threading/Dispatcher.cpp +0 -55
- package/cpp/threading/Dispatcher.h +0 -93
- package/cpp/threading/ThreadPool.cpp +0 -88
- package/cpp/threading/ThreadPool.h +0 -53
- package/cpp/webgpu/webgpu_glfw.h +0 -88
- package/lib/typescript/src/__tests__/Alpha.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/Alpha.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/ArrayBuffer.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/ArrayBuffer.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/Buffer.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/Buffer.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/ComputeShader.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/ComputeShader.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/Constants.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/Constants.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/Device.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/Device.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/ErrorScope.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/ErrorScope.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/ExternalTexture.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/ExternalTexture.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/GPU.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/GPU.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/ImageData.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/ImageData.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/Shaders.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/Shaders.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/Texture.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/Texture.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/components/Wireframe/Shaders.d.ts +0 -3
- package/lib/typescript/src/__tests__/components/Wireframe/Shaders.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/components/Wireframe/models.d.ts +0 -29
- package/lib/typescript/src/__tests__/components/Wireframe/models.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/components/Wireframe/utils.d.ts +0 -5
- package/lib/typescript/src/__tests__/components/Wireframe/utils.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/components/cube.d.ts +0 -7
- package/lib/typescript/src/__tests__/components/cube.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/components/meshes/mesh.d.ts +0 -22
- package/lib/typescript/src/__tests__/components/meshes/mesh.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/components/meshes/sphere.d.ts +0 -12
- package/lib/typescript/src/__tests__/components/meshes/sphere.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/components/meshes/stanfordDragon.d.ts +0 -7
- package/lib/typescript/src/__tests__/components/meshes/stanfordDragon.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/components/meshes/stanfordDragonData.d.ts +0 -6
- package/lib/typescript/src/__tests__/components/meshes/stanfordDragonData.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/components/meshes/teapot.d.ts +0 -6
- package/lib/typescript/src/__tests__/components/meshes/teapot.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/components/meshes/utils.d.ts +0 -10
- package/lib/typescript/src/__tests__/components/meshes/utils.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/components/triangle.d.ts +0 -3
- package/lib/typescript/src/__tests__/components/triangle.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/config.d.ts +0 -3
- package/lib/typescript/src/__tests__/config.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/demos/ABuffer.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/demos/ABuffer.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/demos/Blur.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/demos/Blur.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/demos/Cube.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/demos/Cube.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/demos/FractalCube.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/demos/FractalCube.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/demos/OcclusionQuery.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/demos/OcclusionQuery.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/demos/RenderBundles.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/demos/RenderBundles.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/demos/Triangle.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/demos/Triangle.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/demos/Wireframe.spec.d.ts +0 -2
- package/lib/typescript/src/__tests__/demos/Wireframe.spec.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/globalSetup.d.ts +0 -3
- package/lib/typescript/src/__tests__/globalSetup.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/globalTeardown.d.ts +0 -3
- package/lib/typescript/src/__tests__/globalTeardown.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/setup.d.ts +0 -63
- package/lib/typescript/src/__tests__/setup.d.ts.map +0 -1
- package/libs/apple/arm64_iphoneos/libwebgpu_dawn.a +0 -0
- package/libs/apple/arm64_iphonesimulator/libwebgpu_dawn.a +0 -0
- package/libs/apple/arm64_xros/libwebgpu_dawn.a +0 -0
- package/libs/apple/arm64_xrsimulator/libwebgpu_dawn.a +0 -0
- package/libs/apple/iphonesimulator/libwebgpu_dawn.a +0 -0
- package/libs/apple/libwebgpu_dawn.xcframework/xros-arm64/libwebgpu_dawn.a +0 -0
- package/libs/apple/libwebgpu_dawn.xcframework/xros-arm64-simulator/libwebgpu_dawn.a +0 -0
- package/libs/apple/universal_macosx/libwebgpu_dawn.a +0 -0
- package/libs/apple/x86_64_iphonesimulator/libwebgpu_dawn.a +0 -0
- package/libs/dawn.json +0 -4670
- package/src/__tests__/Alpha.spec.ts +0 -28
- package/src/__tests__/ArrayBuffer.spec.ts +0 -76
- package/src/__tests__/Buffer.spec.ts +0 -357
- package/src/__tests__/ComputeShader.spec.ts +0 -375
- package/src/__tests__/Constants.spec.ts +0 -89
- package/src/__tests__/Device.spec.ts +0 -84
- package/src/__tests__/ErrorScope.spec.ts +0 -92
- package/src/__tests__/ExternalTexture.spec.ts +0 -284
- package/src/__tests__/GPU.spec.ts +0 -272
- package/src/__tests__/ImageData.spec.ts +0 -26
- package/src/__tests__/Shaders.spec.ts +0 -232
- package/src/__tests__/Texture.spec.ts +0 -197
- package/src/__tests__/assets/Di-3d.png +0 -0
- package/src/__tests__/components/Wireframe/Shaders.ts +0 -138
- package/src/__tests__/components/Wireframe/models.ts +0 -113
- package/src/__tests__/components/Wireframe/utils.ts +0 -22
- package/src/__tests__/components/cube.ts +0 -51
- package/src/__tests__/components/meshes/mesh.ts +0 -96
- package/src/__tests__/components/meshes/sphere.ts +0 -103
- package/src/__tests__/components/meshes/stanfordDragon.ts +0 -44
- package/src/__tests__/components/meshes/stanfordDragonData.ts +0 -5
- package/src/__tests__/components/meshes/teapot.ts +0 -13
- package/src/__tests__/components/meshes/utils.ts +0 -235
- package/src/__tests__/components/triangle.ts +0 -17
- package/src/__tests__/config.ts +0 -2
- package/src/__tests__/demos/ABuffer.spec.ts +0 -890
- package/src/__tests__/demos/Blur.spec.ts +0 -398
- package/src/__tests__/demos/Cube.spec.ts +0 -929
- package/src/__tests__/demos/FractalCube.spec.ts +0 -240
- package/src/__tests__/demos/OcclusionQuery.spec.ts +0 -376
- package/src/__tests__/demos/RenderBundles.spec.ts +0 -580
- package/src/__tests__/demos/Triangle.spec.ts +0 -266
- package/src/__tests__/demos/Wireframe.spec.ts +0 -188
- package/src/__tests__/globalSetup.ts +0 -45
- package/src/__tests__/globalTeardown.ts +0 -11
- package/src/__tests__/setup.ts +0 -423
- package/src/__tests__/snapshots/abuffer.png +0 -0
- package/src/__tests__/snapshots/asteroid.png +0 -0
- package/src/__tests__/snapshots/blur.png +0 -0
- package/src/__tests__/snapshots/buffer.png +0 -0
- package/src/__tests__/snapshots/constant-triangle.png +0 -0
- package/src/__tests__/snapshots/cube.png +0 -0
- package/src/__tests__/snapshots/f.png +0 -0
- package/src/__tests__/snapshots/f2.png +0 -0
- package/src/__tests__/snapshots/fractal-cubes.png +0 -0
- package/src/__tests__/snapshots/instanced-cubes.png +0 -0
- package/src/__tests__/snapshots/occlusion-query.png +0 -0
- package/src/__tests__/snapshots/ref.png +0 -0
- package/src/__tests__/snapshots/semi-opaque-cyan.png +0 -0
- package/src/__tests__/snapshots/texture.png +0 -0
- package/src/__tests__/snapshots/textured-cube.png +0 -0
- package/src/__tests__/snapshots/triangle-msaa.png +0 -0
- package/src/__tests__/snapshots/triangle.png +0 -0
- package/src/__tests__/snapshots/two-cube.png +0 -0
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// ThreadPool.hpp
|
|
3
|
-
// NitroModules
|
|
4
|
-
//
|
|
5
|
-
// Created by Marc Rousavy on 21.06.24.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <atomic>
|
|
11
|
-
#include <condition_variable>
|
|
12
|
-
#include <functional>
|
|
13
|
-
#include <memory>
|
|
14
|
-
#include <mutex>
|
|
15
|
-
#include <queue>
|
|
16
|
-
#include <string>
|
|
17
|
-
#include <thread>
|
|
18
|
-
#include <vector>
|
|
19
|
-
|
|
20
|
-
namespace margelo {
|
|
21
|
-
|
|
22
|
-
class ThreadPool final {
|
|
23
|
-
public:
|
|
24
|
-
/**
|
|
25
|
-
* Create a new ThreadPool with the given number of fixed workers/threads.
|
|
26
|
-
*/
|
|
27
|
-
explicit ThreadPool(const char *const name, size_t numThreads);
|
|
28
|
-
~ThreadPool();
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Schedules the given task asynchronously on the ThreadPool.
|
|
32
|
-
* It will run once a worker is available.
|
|
33
|
-
*/
|
|
34
|
-
void run(std::function<void()> &&task);
|
|
35
|
-
|
|
36
|
-
public:
|
|
37
|
-
/**
|
|
38
|
-
* Get a static singleton instance - a shared ThreadPool.
|
|
39
|
-
* The shared ThreadPool has 3 threads.
|
|
40
|
-
*/
|
|
41
|
-
static std::shared_ptr<ThreadPool> getSharedPool();
|
|
42
|
-
|
|
43
|
-
private:
|
|
44
|
-
std::vector<std::thread> _workers;
|
|
45
|
-
std::queue<std::function<void()>> _tasks;
|
|
46
|
-
std::mutex _queueMutex;
|
|
47
|
-
std::condition_variable _condition;
|
|
48
|
-
std::atomic<bool> _isAlive;
|
|
49
|
-
const char *_name;
|
|
50
|
-
static constexpr auto TAG = "ThreadPool";
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
} // namespace margelo
|
package/cpp/webgpu/webgpu_glfw.h
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 The Dawn & Tint Authors
|
|
2
|
-
//
|
|
3
|
-
// Redistribution and use in source and binary forms, with or without
|
|
4
|
-
// modification, are permitted provided that the following conditions are met:
|
|
5
|
-
//
|
|
6
|
-
// 1. Redistributions of source code must retain the above copyright notice, this
|
|
7
|
-
// list of conditions and the following disclaimer.
|
|
8
|
-
//
|
|
9
|
-
// 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
-
// this list of conditions and the following disclaimer in the documentation
|
|
11
|
-
// and/or other materials provided with the distribution.
|
|
12
|
-
//
|
|
13
|
-
// 3. Neither the name of the copyright holder nor the names of its
|
|
14
|
-
// contributors may be used to endorse or promote products derived from
|
|
15
|
-
// this software without specific prior written permission.
|
|
16
|
-
//
|
|
17
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
18
|
-
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
-
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
-
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
-
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
-
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
-
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
-
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
-
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
-
|
|
28
|
-
#ifndef INCLUDE_WEBGPU_WEBGPU_GLFW_H_
|
|
29
|
-
#define INCLUDE_WEBGPU_WEBGPU_GLFW_H_
|
|
30
|
-
|
|
31
|
-
#ifdef __cplusplus
|
|
32
|
-
#include <memory>
|
|
33
|
-
|
|
34
|
-
#include "webgpu/webgpu_cpp.h"
|
|
35
|
-
#else
|
|
36
|
-
#include "webgpu/webgpu.h"
|
|
37
|
-
#endif
|
|
38
|
-
|
|
39
|
-
#if defined(WGPU_GLFW_SHARED_LIBRARY)
|
|
40
|
-
#if defined(_WIN32)
|
|
41
|
-
#if defined(WGPU_GLFW_IMPLEMENTATION)
|
|
42
|
-
#define WGPU_GLFW_EXPORT __declspec(dllexport)
|
|
43
|
-
#else
|
|
44
|
-
#define WGPU_GLFW_EXPORT __declspec(dllimport)
|
|
45
|
-
#endif
|
|
46
|
-
#else // defined(_WIN32)
|
|
47
|
-
#if defined(WGPU_GLFW_IMPLEMENTATION)
|
|
48
|
-
#define WGPU_GLFW_EXPORT __attribute__((visibility("default")))
|
|
49
|
-
#else
|
|
50
|
-
#define WGPU_GLFW_EXPORT
|
|
51
|
-
#endif
|
|
52
|
-
#endif // defined(_WIN32)
|
|
53
|
-
#else // defined(WGPU_GLFW_SHARED_LIBRARY)
|
|
54
|
-
#define WGPU_GLFW_EXPORT
|
|
55
|
-
#endif // defined(WGPU_GLFW_SHARED_LIBRARY)
|
|
56
|
-
|
|
57
|
-
struct GLFWwindow;
|
|
58
|
-
|
|
59
|
-
#ifdef __cplusplus
|
|
60
|
-
extern "C" {
|
|
61
|
-
#endif
|
|
62
|
-
|
|
63
|
-
WGPU_GLFW_EXPORT WGPUSurface wgpuGlfwCreateSurfaceForWindow(const WGPUInstance instance,
|
|
64
|
-
struct GLFWwindow* window);
|
|
65
|
-
|
|
66
|
-
#ifdef __cplusplus
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
namespace wgpu::glfw {
|
|
70
|
-
|
|
71
|
-
// Does the necessary setup on the GLFWwindow to allow creating a wgpu::Surface with it and
|
|
72
|
-
// calls `instance.CreateSurface` with the correct descriptor for this window.
|
|
73
|
-
// Returns a null wgpu::Surface on failure.
|
|
74
|
-
WGPU_GLFW_EXPORT wgpu::Surface CreateSurfaceForWindow(const wgpu::Instance& instance,
|
|
75
|
-
GLFWwindow* window);
|
|
76
|
-
|
|
77
|
-
// Use for testing only. Does everything that CreateSurfaceForWindow does except the call to
|
|
78
|
-
// CreateSurface. Useful to be able to modify the descriptor for testing, or when trying to
|
|
79
|
-
// avoid using the global proc table.
|
|
80
|
-
// NOLINTNEXTLINE(build/include_what_you_use)
|
|
81
|
-
WGPU_GLFW_EXPORT std::unique_ptr<wgpu::ChainedStruct, void (*)(wgpu::ChainedStruct*)>
|
|
82
|
-
SetupWindowAndGetSurfaceDescriptor(GLFWwindow* window);
|
|
83
|
-
|
|
84
|
-
} // namespace wgpu::glfw
|
|
85
|
-
|
|
86
|
-
#endif
|
|
87
|
-
|
|
88
|
-
#endif // INCLUDE_WEBGPU_WEBGPU_GLFW_H_
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Alpha.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/Alpha.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayBuffer.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/ArrayBuffer.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Buffer.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/Buffer.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComputeShader.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/ComputeShader.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/Constants.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Device.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/Device.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorScope.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/ErrorScope.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalTexture.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/ExternalTexture.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GPU.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/GPU.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageData.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/ImageData.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shaders.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/Shaders.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Texture.spec.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/Texture.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const solidColorLitWGSL = "struct Uniforms {\n worldViewProjectionMatrix: mat4x4f,\n worldMatrix: mat4x4f,\n color: vec4f,\n};\n\nstruct Vertex {\n @location(0) position: vec4f,\n @location(1) normal: vec3f,\n};\n\nstruct VSOut {\n @builtin(position) position: vec4f,\n @location(0) normal: vec3f,\n};\n\n@group(0) @binding(0) var<uniform> uni: Uniforms;\n\n@vertex fn vs(vin: Vertex) -> VSOut {\n var vOut: VSOut;\n vOut.position = uni.worldViewProjectionMatrix * vin.position;\n vOut.normal = (uni.worldMatrix * vec4f(vin.normal, 0)).xyz;\n return vOut;\n}\n\n@fragment fn fs(vin: VSOut) -> @location(0) vec4f {\n let lightDirection = normalize(vec3f(4, 10, 6));\n let light = dot(normalize(vin.normal), lightDirection) * 0.5 + 0.5;\n return vec4f(uni.color.rgb * light, uni.color.a);\n}";
|
|
2
|
-
export declare const wireframeWGSL = "struct Uniforms {\n worldViewProjectionMatrix: mat4x4f,\n worldMatrix: mat4x4f,\n color: vec4f,\n};\n\nstruct LineUniforms {\n stride: u32,\n thickness: f32,\n alphaThreshold: f32,\n};\n\nstruct VSOut {\n @builtin(position) position: vec4f,\n};\n\n@group(0) @binding(0) var<uniform> uni: Uniforms;\n@group(0) @binding(1) var<storage, read> positions: array<f32>;\n@group(0) @binding(2) var<storage, read> indices: array<u32>;\n@group(0) @binding(3) var<uniform> line: LineUniforms;\n\n@vertex fn vsIndexedU32(@builtin(vertex_index) vNdx: u32) -> VSOut {\n // indices make a triangle so for every 3 indices we need to output\n // 6 values\n let triNdx = vNdx / 6;\n // 0 1 0 1 0 1 0 1 0 1 0 1 vNdx % 2\n // 0 0 1 1 2 2 3 3 4 4 5 5 vNdx / 2\n // 0 1 1 2 2 3 3 4 4 5 5 6 vNdx % 2 + vNdx / 2\n // 0 1 1 2 2 0 0 1 1 2 2 0 (vNdx % 2 + vNdx / 2) % 3\n let vertNdx = (vNdx % 2 + vNdx / 2) % 3;\n let index = indices[triNdx * 3 + vertNdx];\n\n // note:\n //\n // * if your indices are U16 you could use this\n //\n // let indexNdx = triNdx * 3 + vertNdx;\n // let twoIndices = indices[indexNdx / 2]; // indices is u32 but we want u16\n // let index = (twoIndices >> ((indexNdx & 1) * 16)) & 0xFFFF;\n //\n // * if you're not using indices you could use this\n //\n // let index = triNdx * 3 + vertNdx;\n\n let pNdx = index * line.stride;\n let position = vec4f(positions[pNdx], positions[pNdx + 1], positions[pNdx + 2], 1);\n\n var vOut: VSOut;\n vOut.position = uni.worldViewProjectionMatrix * position;\n return vOut;\n}\n\n@fragment fn fs() -> @location(0) vec4f {\n return uni.color + vec4f(0.5);\n}\n\nstruct BarycentricCoordinateBasedVSOutput {\n @builtin(position) position: vec4f,\n @location(0) barycenticCoord: vec3f,\n};\n\n@vertex fn vsIndexedU32BarycentricCoordinateBasedLines(\n @builtin(vertex_index) vNdx: u32\n) -> BarycentricCoordinateBasedVSOutput {\n let vertNdx = vNdx % 3;\n let index = indices[vNdx];\n\n // note:\n //\n // * if your indices are U16 you could use this\n //\n // let twoIndices = indices[vNdx / 2]; // indices is u32 but we want u16\n // let index = (twoIndices >> ((vNdx & 1) * 16)) & 0xFFFF;\n //\n // * if you're not using indices you could use this\n //\n // let index = vNdx;\n\n let pNdx = index * line.stride;\n let position = vec4f(positions[pNdx], positions[pNdx + 1], positions[pNdx + 2], 1);\n\n var vsOut: BarycentricCoordinateBasedVSOutput;\n vsOut.position = uni.worldViewProjectionMatrix * position;\n\n // emit a barycentric coordinate\n vsOut.barycenticCoord = vec3f(0);\n vsOut.barycenticCoord[vertNdx] = 1.0;\n return vsOut;\n}\n\nfn edgeFactor(bary: vec3f) -> f32 {\n let d = fwidth(bary);\n let a3 = smoothstep(vec3f(0.0), d * line.thickness, bary);\n return min(min(a3.x, a3.y), a3.z);\n}\n\n@fragment fn fsBarycentricCoordinateBasedLines(\n v: BarycentricCoordinateBasedVSOutput\n) -> @location(0) vec4f {\n let a = 1.0 - edgeFactor(v.barycenticCoord);\n if (a < line.alphaThreshold) {\n discard;\n }\n\n return vec4((uni.color.rgb + 0.5) * a, a);\n}\n";
|
|
3
|
-
//# sourceMappingURL=Shaders.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shaders.d.ts","sourceRoot":"","sources":["../../../../../../src/__tests__/components/Wireframe/Shaders.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,6wBA6B5B,CAAC;AAEH,eAAO,MAAM,aAAa,oiGA0GzB,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
type Mesh = {
|
|
2
|
-
positions: [number, number, number][];
|
|
3
|
-
triangles: [number, number, number][];
|
|
4
|
-
normals: [number, number, number][];
|
|
5
|
-
};
|
|
6
|
-
export declare function convertMeshToTypedArrays(mesh: Mesh, scale: number, offset?: number[]): {
|
|
7
|
-
vertices: Float32Array<ArrayBuffer>;
|
|
8
|
-
indices: Uint32Array<ArrayBuffer>;
|
|
9
|
-
};
|
|
10
|
-
export declare const modelData: {
|
|
11
|
-
teapot: {
|
|
12
|
-
vertices: Float32Array<ArrayBuffer>;
|
|
13
|
-
indices: Uint32Array<ArrayBuffer>;
|
|
14
|
-
};
|
|
15
|
-
sphere: {
|
|
16
|
-
vertices: Float32Array<ArrayBuffer>;
|
|
17
|
-
indices: Uint32Array<ArrayBuffer>;
|
|
18
|
-
};
|
|
19
|
-
jewel: {
|
|
20
|
-
vertices: Float32Array<ArrayBuffer>;
|
|
21
|
-
indices: Uint32Array<ArrayBuffer>;
|
|
22
|
-
};
|
|
23
|
-
rock: {
|
|
24
|
-
vertices: Float32Array<ArrayBuffer>;
|
|
25
|
-
indices: Uint32Array<ArrayBuffer>;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../../src/__tests__/components/Wireframe/models.ts"],"names":[],"mappings":"AAUA,KAAK,IAAI,GAAG;IACV,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACtC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACtC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CACrC,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,EACb,MAAM,WAAY;;;EAoBnB;AAoED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;CAKrB,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function rand(min?: number, max?: number): number;
|
|
2
|
-
export declare function randInt(min: number, max?: number): number;
|
|
3
|
-
export declare function randColor(): number[];
|
|
4
|
-
export declare function randElement<T>(arr: T[]): T;
|
|
5
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/__tests__/components/Wireframe/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,UAS9C;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,UAEhD;AAED,wBAAgB,SAAS,aAExB;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAE1C"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const cubeVertexSize: number;
|
|
2
|
-
export declare const cubePositionOffset = 0;
|
|
3
|
-
export declare const cubeColorOffset: number;
|
|
4
|
-
export declare const cubeUVOffset: number;
|
|
5
|
-
export declare const cubeVertexCount = 36;
|
|
6
|
-
export declare const cubeVertexArray: Float32Array<ArrayBuffer>;
|
|
7
|
-
//# sourceMappingURL=cube.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cube.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/components/cube.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QAAS,CAAC;AACrC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,eAAe,QAAQ,CAAC;AACrC,eAAO,MAAM,YAAY,QAAQ,CAAC;AAClC,eAAO,MAAM,eAAe,KAAK,CAAC;AAGlC,eAAO,MAAM,eAAe,2BA2C1B,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface Renderable {
|
|
2
|
-
vertexBuffer: GPUBuffer;
|
|
3
|
-
indexBuffer: GPUBuffer;
|
|
4
|
-
indexCount: number;
|
|
5
|
-
bindGroup?: GPUBindGroup;
|
|
6
|
-
}
|
|
7
|
-
export interface Mesh {
|
|
8
|
-
vertices: Float32Array;
|
|
9
|
-
indices: Uint16Array | Uint32Array;
|
|
10
|
-
vertexStride: number;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @param {GPUDevice} device - A valid GPUDevice.
|
|
14
|
-
* @param {Mesh} mesh - An indexed triangle-list mesh, containing its vertices, indices, and vertexStride (number of elements per vertex).
|
|
15
|
-
* @param {boolean} storeVertices - A boolean flag indicating whether the vertexBuffer should be available to use as a storage buffer.
|
|
16
|
-
* @returns {boolean} An object containing an array of bindGroups and the bindGroupLayout they implement.
|
|
17
|
-
*/
|
|
18
|
-
export declare const createMeshRenderable: (device: GPUDevice, mesh: Mesh, storeVertices?: boolean, storeIndices?: boolean) => Renderable;
|
|
19
|
-
export declare const getMeshPosAtIndex: (mesh: Mesh, index: number) => Float32Array<ArrayBufferLike>;
|
|
20
|
-
export declare const getMeshNormalAtIndex: (mesh: Mesh, index: number) => Float32Array<ArrayBufferLike>;
|
|
21
|
-
export declare const getMeshUVAtIndex: (mesh: Mesh, index: number) => Float32Array<ArrayBufferLike>;
|
|
22
|
-
//# sourceMappingURL=mesh.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mesh.d.ts","sourceRoot":"","sources":["../../../../../../src/__tests__/components/meshes/mesh.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,EAAE,SAAS,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED,MAAM,WAAW,IAAI;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,WAAW,GAAG,WAAW,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,SAAS,EACjB,MAAM,IAAI,EACV,uBAAqB,EACrB,sBAAoB,KACnB,UAyCF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,IAAI,EAAE,OAAO,MAAM,kCAO1D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,IAAI,EAAE,OAAO,MAAM,kCAO7D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,MAAM,IAAI,EAAE,OAAO,MAAM,kCAOzD,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface SphereMesh {
|
|
2
|
-
vertices: Float32Array;
|
|
3
|
-
indices: Uint16Array;
|
|
4
|
-
}
|
|
5
|
-
export declare const SphereLayout: {
|
|
6
|
-
vertexStride: number;
|
|
7
|
-
positionsOffset: number;
|
|
8
|
-
normalOffset: number;
|
|
9
|
-
uvOffset: number;
|
|
10
|
-
};
|
|
11
|
-
export declare function createSphereMesh(radius: number, widthSegments?: number, heightSegments?: number, randomness?: number): SphereMesh;
|
|
12
|
-
//# sourceMappingURL=sphere.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sphere.d.ts","sourceRoot":"","sources":["../../../../../../src/__tests__/components/meshes/sphere.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,eAAO,MAAM,YAAY;;;;;CAKxB,CAAC;AAGF,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,aAAa,SAAK,EAClB,cAAc,SAAK,EACnB,UAAU,SAAI,GACb,UAAU,CAkFZ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stanfordDragon.d.ts","sourceRoot":"","sources":["../../../../../../src/__tests__/components/meshes/stanfordDragon.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,IAAI;;;;;CAKhB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stanfordDragonData.d.ts","sourceRoot":"","sources":["../../../../../../src/__tests__/components/meshes/stanfordDragonData.ts"],"names":[],"mappings":";;;;AACA,wBAGE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"teapot.d.ts","sourceRoot":"","sources":["../../../../../../src/__tests__/components/meshes/teapot.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI;eACoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;eAC9B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;aAC1C,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;CAC1C,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare function computeSurfaceNormals(positions: [number, number, number][], triangles: [number, number, number][]): [number, number, number][];
|
|
2
|
-
export declare function generateNormals(maxAngle: number, positions: [number, number, number][], triangles: [number, number, number][]): {
|
|
3
|
-
positions: [number, number, number][];
|
|
4
|
-
normals: [number, number, number][];
|
|
5
|
-
triangles: [number, number, number][];
|
|
6
|
-
};
|
|
7
|
-
type ProjectedPlane = "xy" | "xz" | "yz";
|
|
8
|
-
export declare function computeProjectedPlaneUVs(positions: [number, number, number][], projectedPlane?: ProjectedPlane): [number, number][];
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/__tests__/components/meshes/utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EACrC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GACpC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CA4B5B;AAsBD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EACrC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;;;;EA2ItC;AAED,KAAK,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAQzC,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EACrC,cAAc,GAAE,cAAqB,GACpC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAuBpB"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const triangleVertWGSL = "@vertex\nfn main(\n @builtin(vertex_index) VertexIndex : u32\n) -> @builtin(position) vec4f {\n var pos = array<vec2f, 3>(\n vec2(0.0, 0.5),\n vec2(-0.5, -0.5),\n vec2(0.5, -0.5)\n );\n\n return vec4f(pos[VertexIndex], 0.0, 1.0);\n}";
|
|
2
|
-
export declare const redFragWGSL = "@fragment\nfn main() -> @location(0) vec4f {\n return vec4(1.0, 0.0, 0.0, 1.0);\n}";
|
|
3
|
-
//# sourceMappingURL=triangle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"triangle.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/components/triangle.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,0PAW3B,CAAC;AAEH,eAAO,MAAM,WAAW,wFAGtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,SAA+B,CAAC;AAClD,eAAO,MAAM,SAAS,SAAmC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ABuffer.spec.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/demos/ABuffer.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Blur.spec.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/demos/Blur.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const basicVert = "struct Uniforms {\n modelViewProjectionMatrix : mat4x4f,\n}\n@binding(0) @group(0) var<uniform> uniforms : Uniforms;\n\nstruct VertexOutput {\n @builtin(position) Position : vec4f,\n @location(0) fragUV : vec2f,\n @location(1) fragPosition: vec4f,\n}\n\n@vertex\nfn main(\n @location(0) position : vec4f,\n @location(1) uv : vec2f\n) -> VertexOutput {\n var output : VertexOutput;\n output.Position = uniforms.modelViewProjectionMatrix * position;\n output.fragUV = uv;\n output.fragPosition = 0.5 * (position + vec4(1.0, 1.0, 1.0, 1.0));\n return output;\n}\n";
|
|
2
|
-
//# sourceMappingURL=Cube.spec.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Cube.spec.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/demos/Cube.spec.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,gkBAsBrB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FractalCube.spec.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/demos/FractalCube.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export type TypedArrayConstructor = Int8ArrayConstructor | Uint8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor;
|
|
2
|
-
//# sourceMappingURL=OcclusionQuery.spec.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OcclusionQuery.spec.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/demos/OcclusionQuery.spec.ts"],"names":[],"mappings":"AA6CA,MAAM,MAAM,qBAAqB,GAC7B,oBAAoB,GACpB,qBAAqB,GACrB,qBAAqB,GACrB,sBAAsB,GACtB,qBAAqB,GACrB,sBAAsB,GACtB,uBAAuB,GACvB,uBAAuB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RenderBundles.spec.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/demos/RenderBundles.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Triangle.spec.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/demos/Triangle.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Wireframe.spec.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/demos/Wireframe.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/globalSetup.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,WAAW,qBA6BhB,CAAC;AAGF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"globalTeardown.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/globalTeardown.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,cAAc,YAOnB,CAAC;AAGF,eAAe,cAAc,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { PNG } from "pngjs";
|
|
2
|
-
import type { mat4, vec3, mat3 } from "wgpu-matrix";
|
|
3
|
-
import type { Server, WebSocket } from "ws";
|
|
4
|
-
import type { GPUOffscreenCanvas } from "../Offscreen";
|
|
5
|
-
type TestOS = "ios" | "android" | "web" | "node";
|
|
6
|
-
declare global {
|
|
7
|
-
var testServer: Server;
|
|
8
|
-
var testClient: WebSocket;
|
|
9
|
-
var testOS: TestOS;
|
|
10
|
-
var testArch: "paper" | "fabric";
|
|
11
|
-
}
|
|
12
|
-
interface GPUTestingContext {
|
|
13
|
-
gpu: GPU;
|
|
14
|
-
device: GPUDevice;
|
|
15
|
-
shaders: {
|
|
16
|
-
triangleVertWGSL: string;
|
|
17
|
-
redFragWGSL: string;
|
|
18
|
-
};
|
|
19
|
-
urls: {
|
|
20
|
-
fTexture: string;
|
|
21
|
-
};
|
|
22
|
-
assets: {
|
|
23
|
-
cubeVertexArray: Float32Array;
|
|
24
|
-
di3D: ImageData;
|
|
25
|
-
moon: ImageData;
|
|
26
|
-
saturn: ImageData;
|
|
27
|
-
};
|
|
28
|
-
ctx: GPUCanvasContext;
|
|
29
|
-
canvas: GPUOffscreenCanvas;
|
|
30
|
-
mat4: typeof mat4;
|
|
31
|
-
vec3: typeof vec3;
|
|
32
|
-
mat3: typeof mat3;
|
|
33
|
-
}
|
|
34
|
-
type Ctx = Record<string, unknown>;
|
|
35
|
-
type JSONValue = {
|
|
36
|
-
[key: string]: JSONValue;
|
|
37
|
-
} | JSONValue[] | number | string | boolean | null;
|
|
38
|
-
interface TestingClient {
|
|
39
|
-
eval<C = Ctx, R = JSONValue>(fn: (ctx: GPUTestingContext & C) => R | Promise<R>, ctx?: C): Promise<R>;
|
|
40
|
-
OS: TestOS;
|
|
41
|
-
arch: "paper" | "fabric";
|
|
42
|
-
init(): Promise<void>;
|
|
43
|
-
dispose(): Promise<void>;
|
|
44
|
-
}
|
|
45
|
-
export declare let client: TestingClient;
|
|
46
|
-
interface BitmapData {
|
|
47
|
-
data: number[];
|
|
48
|
-
width: number;
|
|
49
|
-
height: number;
|
|
50
|
-
format: string;
|
|
51
|
-
}
|
|
52
|
-
export declare const encodeImage: (bitmap: BitmapData) => PNG;
|
|
53
|
-
interface CheckImageOptions {
|
|
54
|
-
maxPixelDiff?: number;
|
|
55
|
-
threshold?: number;
|
|
56
|
-
overwrite?: boolean;
|
|
57
|
-
mute?: boolean;
|
|
58
|
-
shouldFail?: boolean;
|
|
59
|
-
}
|
|
60
|
-
export declare const checkImage: (toTest: PNG, relPath: string, opts?: CheckImageOptions) => number;
|
|
61
|
-
export declare const decodeImage: (relPath: string) => BitmapData;
|
|
62
|
-
export {};
|
|
63
|
-
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/setup.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAG5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAQvD,KAAK,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEjD,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,UAAU,EAAE,MAAM,CAAC;IACvB,IAAI,UAAU,EAAE,SAAS,CAAC;IAC1B,IAAI,MAAM,EAAE,MAAM,CAAC;IACnB,IAAI,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC;CAClC;AAED,UAAU,iBAAiB;IACzB,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE;QACP,gBAAgB,EAAE,MAAM,CAAC;QACzB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,EAAE;QACN,eAAe,EAAE,YAAY,CAAC;QAC9B,IAAI,EAAE,SAAS,CAAC;QAChB,IAAI,EAAE,SAAS,CAAC;QAChB,MAAM,EAAE,SAAS,CAAC;KACnB,CAAC;IACF,GAAG,EAAE,gBAAgB,CAAC;IACtB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,IAAI,EAAE,OAAO,IAAI,CAAC;CACnB;AAED,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnC,KAAK,SAAS,GACV;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC5B,SAAS,EAAE,GACX,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,CAAC;AAET,UAAU,aAAa;IACrB,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,SAAS,EACzB,EAAE,EAAE,CAAC,GAAG,EAAE,iBAAiB,GAAG,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAClD,GAAG,CAAC,EAAE,CAAC,GACN,OAAO,CAAC,CAAC,CAAC,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,eAAO,IAAI,MAAM,EAAE,aAAa,CAAC;AA8OjC,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,GAAI,QAAQ,UAAU,QAuB7C,CAAC;AAEF,UAAU,iBAAiB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAYD,eAAO,MAAM,UAAU,GACrB,QAAQ,GAAG,EACX,SAAS,MAAM,EACf,OAAO,iBAAiB,WA2CzB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,UAa7C,CAAC"}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|