@nativescript/canvas 2.0.0-webgpu.0 → 2.0.0-webgpu.1
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/Canvas/common.d.ts +2 -3
- package/Canvas/common.js +8 -10
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.js +1 -0
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.ios.js +1 -0
- package/Canvas/index.ios.js.map +1 -1
- package/WebGPU/GPUCanvasContext.d.ts +3 -1
- package/WebGPU/GPUCanvasContext.js +13 -4
- package/WebGPU/GPUCanvasContext.js.map +1 -1
- package/WebGPU/GPUCommandEncoder.js +6 -1
- package/WebGPU/GPUCommandEncoder.js.map +1 -1
- package/WebGPU/GPUDevice.js +37 -62
- package/WebGPU/GPUDevice.js.map +1 -1
- package/WebGPU/GPURenderPassEncoder.js.map +1 -1
- package/WebGPU/GPUTexture.d.ts +1 -0
- package/WebGPU/GPUTexture.js +3 -0
- package/WebGPU/GPUTexture.js.map +1 -1
- package/WebGPU/Utils.d.ts +1 -1
- package/common.d.ts +0 -3
- package/common.js +1 -5
- package/common.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +40 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +602 -602
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +40 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +604 -604
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +638 -638
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +207 -72
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +26 -17
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +21 -51
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUUtils.h +69 -2
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
#include "Common.h"
|
|
9
9
|
#include "Helpers.h"
|
|
10
10
|
#include "ObjectWrapperImpl.h"
|
|
11
|
+
#include "GPUUtils.h"
|
|
11
12
|
|
|
12
13
|
class GPURenderPassEncoderImpl : ObjectWrapperImpl {
|
|
13
14
|
public:
|
|
14
|
-
GPURenderPassEncoderImpl(const CanvasGPURenderPassEncoder *pass);
|
|
15
|
+
explicit GPURenderPassEncoderImpl(const CanvasGPURenderPassEncoder *pass);
|
|
15
16
|
|
|
16
17
|
~GPURenderPassEncoderImpl() {
|
|
17
18
|
canvas_native_webgpu_render_pass_encoder_release(this->GetPass());
|
|
@@ -78,7 +79,6 @@ public:
|
|
|
78
79
|
|
|
79
80
|
private:
|
|
80
81
|
const CanvasGPURenderPassEncoder *pass_;
|
|
81
|
-
bool ended_ = false;
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
|
|
@@ -129,8 +129,8 @@ ParseExtent3d(v8::Isolate *isolate, const v8::Local<v8::Value> &obj) {
|
|
|
129
129
|
CanvasExtent3d ret{
|
|
130
130
|
0, 1, 1
|
|
131
131
|
};
|
|
132
|
-
|
|
133
|
-
if(!obj.IsEmpty()){
|
|
132
|
+
|
|
133
|
+
if (!obj.IsEmpty()) {
|
|
134
134
|
if (obj->IsArray()) {
|
|
135
135
|
auto array = obj.As<v8::Array>();
|
|
136
136
|
v8::Local<v8::Value> width;
|
|
@@ -175,4 +175,71 @@ ParseExtent3d(v8::Isolate *isolate, const v8::Local<v8::Value> &obj) {
|
|
|
175
175
|
return ret;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
|
|
179
|
+
inline static CanvasColor
|
|
180
|
+
ParseColor(v8::Isolate *isolate, const v8::Local<v8::Value> &obj) {
|
|
181
|
+
|
|
182
|
+
auto context = isolate->GetCurrentContext();
|
|
183
|
+
CanvasColor ret{
|
|
184
|
+
0, 0, 0, 0
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
if (!obj.IsEmpty()) {
|
|
188
|
+
if (obj->IsArray()) {
|
|
189
|
+
auto array = obj.As<v8::Array>();
|
|
190
|
+
v8::Local<v8::Value> r;
|
|
191
|
+
if (array->Get(context, 0).ToLocal(&r) &&
|
|
192
|
+
r->IsNumber()) {
|
|
193
|
+
ret.r = r->NumberValue(context).FromJust();
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
v8::Local<v8::Value> g;
|
|
197
|
+
if (array->Get(context, 1).ToLocal(&g) &&
|
|
198
|
+
g->IsNumber()) {
|
|
199
|
+
ret.g = g->NumberValue(context).FromJust();
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
v8::Local<v8::Value> b;
|
|
203
|
+
if (array->Get(context, 2).ToLocal(
|
|
204
|
+
&b) && b->IsNumber()) {
|
|
205
|
+
ret.b = b->NumberValue(context).FromJust();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
v8::Local<v8::Value> a;
|
|
210
|
+
if (array->Get(context, 3).ToLocal(
|
|
211
|
+
&a) && a->IsNumber()) {
|
|
212
|
+
ret.a = a->NumberValue(context).FromJust();
|
|
213
|
+
}
|
|
214
|
+
} else if (obj->IsObject()) {
|
|
215
|
+
auto colorObj = obj.As<v8::Object>();
|
|
216
|
+
v8::Local<v8::Value> r;
|
|
217
|
+
if (colorObj->Get(context, ConvertToV8String(isolate, "r")).ToLocal(&r) &&
|
|
218
|
+
r->IsNumber()) {
|
|
219
|
+
ret.r = r->NumberValue(context).FromJust();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
v8::Local<v8::Value> g;
|
|
223
|
+
if (colorObj->Get(context, ConvertToV8String(isolate, "g")).ToLocal(&g) &&
|
|
224
|
+
g->IsNumber()) {
|
|
225
|
+
ret.g = g->NumberValue(context).FromJust();
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
v8::Local<v8::Value> b;
|
|
229
|
+
if (colorObj->Get(context, ConvertToV8String(isolate, "b")).ToLocal(
|
|
230
|
+
&b) && b->IsNumber()) {
|
|
231
|
+
ret.b = b->NumberValue(context).FromJust();
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
v8::Local<v8::Value> a;
|
|
235
|
+
if (colorObj->Get(context, ConvertToV8String(isolate, "a")).ToLocal(
|
|
236
|
+
&a) && a->IsNumber()) {
|
|
237
|
+
ret.a = a->NumberValue(context).FromJust();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return ret;
|
|
243
|
+
}
|
|
244
|
+
|
|
178
245
|
#endif //CANVAS_ANDROID_GPUUTILS_H
|