@nativescript/canvas 2.0.0-alpha.21 → 2.0.0-alpha.23
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/index.android.js +1 -3
- package/Canvas/index.android.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/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/DWARF/CanvasNative +0 -0
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +4 -4
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +291 -302
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.cpp +0 -2
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +1545 -1760
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.cpp +14 -14
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.cpp +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.cpp +4 -4
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.cpp +58 -71
- package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +4 -4
- package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +4 -4
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +3 -3
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +10 -10
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +4 -4
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +4 -4
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +4 -4
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.cpp +5 -13
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +40 -39
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +1454 -1586
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
#include "WebGL2RenderingContext.h"
|
|
6
6
|
|
|
7
|
-
WebGL2RenderingContext::WebGL2RenderingContext(WebGLState*
|
|
7
|
+
WebGL2RenderingContext::WebGL2RenderingContext(WebGLState *state) : WebGLRenderingContext(
|
|
8
8
|
state, WebGLRenderingVersion::V2) {
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
WebGL2RenderingContext::WebGL2RenderingContext(WebGLState*
|
|
12
|
+
WebGL2RenderingContext::WebGL2RenderingContext(WebGLState *state,
|
|
13
13
|
WebGLRenderingVersion version)
|
|
14
14
|
: WebGLRenderingContext(state, version) {
|
|
15
15
|
}
|
|
@@ -61,7 +61,7 @@ void WebGL2RenderingContext::BeginQuery(const v8::FunctionCallbackInfo<v8::Value
|
|
|
61
61
|
auto value = args[1];
|
|
62
62
|
auto type = GetNativeType(isolate, value);
|
|
63
63
|
if (type == NativeType::WebGLQuery) {
|
|
64
|
-
auto target =
|
|
64
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
65
65
|
auto query = WebGLQuery::GetPointer(value.As<v8::Object>());
|
|
66
66
|
|
|
67
67
|
if (query != nullptr) {
|
|
@@ -87,7 +87,7 @@ WebGL2RenderingContext::BeginTransformFeedback(const v8::FunctionCallbackInfo<v8
|
|
|
87
87
|
auto value = args[0];
|
|
88
88
|
if (value->IsNumber()) {
|
|
89
89
|
canvas_native_webgl2_begin_transform_feedback(
|
|
90
|
-
|
|
90
|
+
args[0]->Uint32Value(context).ToChecked(),
|
|
91
91
|
ptr->GetState()
|
|
92
92
|
);
|
|
93
93
|
}
|
|
@@ -106,8 +106,8 @@ void WebGL2RenderingContext::BindBufferBase(const v8::FunctionCallbackInfo<v8::V
|
|
|
106
106
|
auto type = GetNativeType(isolate, bufferValue);
|
|
107
107
|
|
|
108
108
|
if (type == NativeType::WebGLBuffer) {
|
|
109
|
-
auto target =
|
|
110
|
-
auto index =
|
|
109
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
110
|
+
auto index = args[1]->Uint32Value(context).ToChecked();
|
|
111
111
|
|
|
112
112
|
auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
|
|
113
113
|
|
|
@@ -132,8 +132,8 @@ void WebGL2RenderingContext::BindBufferRange(const v8::FunctionCallbackInfo<v8::
|
|
|
132
132
|
auto bufferValue = args[2];
|
|
133
133
|
auto type = GetNativeType(isolate, bufferValue);
|
|
134
134
|
if (args.Length() > 4 && type == NativeType::WebGLBuffer) {
|
|
135
|
-
auto target =
|
|
136
|
-
auto index =
|
|
135
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
136
|
+
auto index = args[1]->Uint32Value(context).ToChecked();
|
|
137
137
|
auto offset = args[3]->NumberValue(context).ToChecked();
|
|
138
138
|
auto size = args[4]->NumberValue(context).ToChecked();
|
|
139
139
|
auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
|
|
@@ -160,7 +160,7 @@ void WebGL2RenderingContext::BindSampler(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
160
160
|
auto samplerValue = args[1];
|
|
161
161
|
auto type = GetNativeType(isolate, samplerValue);
|
|
162
162
|
if (type == NativeType::WebGLSampler) {
|
|
163
|
-
auto unit =
|
|
163
|
+
auto unit = args[0]->Uint32Value(context).ToChecked();
|
|
164
164
|
auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
|
|
165
165
|
|
|
166
166
|
canvas_native_webgl2_bind_sampler(
|
|
@@ -185,7 +185,7 @@ WebGL2RenderingContext::BindTransformFeedback(const v8::FunctionCallbackInfo<v8:
|
|
|
185
185
|
auto type = GetNativeType(isolate, transformFeedbackValue);
|
|
186
186
|
|
|
187
187
|
if (type == NativeType::WebGLTransformFeedback) {
|
|
188
|
-
auto target =
|
|
188
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
189
189
|
auto transformFeedback = WebGLTransformFeedback::GetPointer(
|
|
190
190
|
transformFeedbackValue.As<v8::Object>());
|
|
191
191
|
|
|
@@ -237,20 +237,20 @@ void WebGL2RenderingContext::BlitFramebuffer(const v8::FunctionCallbackInfo<v8::
|
|
|
237
237
|
auto context = isolate->GetCurrentContext();
|
|
238
238
|
|
|
239
239
|
if (args.Length() > 9) {
|
|
240
|
-
auto srcX0 =
|
|
241
|
-
auto srcY0 =
|
|
240
|
+
auto srcX0 = args[0]->Int32Value(context).ToChecked();
|
|
241
|
+
auto srcY0 = args[1]->Int32Value(context).ToChecked();
|
|
242
242
|
|
|
243
|
-
auto srcX1 =
|
|
244
|
-
auto srcY1 =
|
|
243
|
+
auto srcX1 = args[2]->Int32Value(context).ToChecked();
|
|
244
|
+
auto srcY1 = args[3]->Int32Value(context).ToChecked();
|
|
245
245
|
|
|
246
|
-
auto dstX0 =
|
|
247
|
-
auto dstY0 =
|
|
246
|
+
auto dstX0 = args[4]->Int32Value(context).ToChecked();
|
|
247
|
+
auto dstY0 = args[5]->Int32Value(context).ToChecked();
|
|
248
248
|
|
|
249
|
-
auto dstX1 =
|
|
250
|
-
auto dstY1 =
|
|
249
|
+
auto dstX1 = args[6]->Int32Value(context).ToChecked();
|
|
250
|
+
auto dstY1 = args[7]->Int32Value(context).ToChecked();
|
|
251
251
|
|
|
252
|
-
auto mask =
|
|
253
|
-
auto filter =
|
|
252
|
+
auto mask = args[8]->Uint32Value(context).ToChecked();
|
|
253
|
+
auto filter = args[9]->Uint32Value(context).ToChecked();
|
|
254
254
|
canvas_native_webgl2_blit_framebuffer(
|
|
255
255
|
srcX0,
|
|
256
256
|
srcY0,
|
|
@@ -276,56 +276,46 @@ void WebGL2RenderingContext::ClearBufferfv(const v8::FunctionCallbackInfo<v8::Va
|
|
|
276
276
|
auto isolate = args.GetIsolate();
|
|
277
277
|
auto context = isolate->GetCurrentContext();
|
|
278
278
|
|
|
279
|
-
auto bufferValue = args[0];
|
|
280
|
-
auto type = GetNativeType(isolate, bufferValue);
|
|
281
279
|
auto values = args[2];
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
auto
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
if (!item->IsNumber()) {
|
|
295
|
-
buf.push_back(
|
|
296
|
-
std::nanf(""));
|
|
297
|
-
} else {
|
|
298
|
-
buf.push_back(
|
|
299
|
-
static_cast<float>(item->NumberValue(context).ToChecked())
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
canvas_native_webgl2_clear_bufferfv(
|
|
305
|
-
buffer->GetBuffer(),
|
|
306
|
-
drawbuffer,
|
|
307
|
-
buf.data(),
|
|
308
|
-
buf.size(),
|
|
309
|
-
ptr->GetState()
|
|
280
|
+
auto buffer = args[0]->Uint32Value(context).ToChecked();
|
|
281
|
+
auto drawbuffer = args[1]->Int32Value(context).ToChecked();
|
|
282
|
+
if (values->IsArray()) {
|
|
283
|
+
auto array = values.As<v8::Array>();
|
|
284
|
+
auto len = array->Length();
|
|
285
|
+
std::vector<float> buf;
|
|
286
|
+
buf.reserve(len);
|
|
287
|
+
for (int j = 0; j < len; ++j) {
|
|
288
|
+
auto item = array->Get(
|
|
289
|
+
context, j).ToLocalChecked();
|
|
290
|
+
buf.push_back(
|
|
291
|
+
static_cast<float>(item->NumberValue(context).ToChecked())
|
|
310
292
|
);
|
|
293
|
+
}
|
|
311
294
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
295
|
+
canvas_native_webgl2_clear_bufferfv(
|
|
296
|
+
buffer,
|
|
297
|
+
drawbuffer,
|
|
298
|
+
buf.data(),
|
|
299
|
+
buf.size(),
|
|
300
|
+
ptr->GetState()
|
|
301
|
+
);
|
|
319
302
|
|
|
303
|
+
} else if (values->IsFloat32Array()) {
|
|
304
|
+
auto buf = values.As<v8::Float32Array>();
|
|
305
|
+
auto array = buf->Buffer();
|
|
306
|
+
auto offset = buf->ByteOffset();
|
|
307
|
+
auto size = buf->Length();
|
|
308
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
309
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
320
310
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
311
|
+
|
|
312
|
+
canvas_native_webgl2_clear_bufferfv(
|
|
313
|
+
buffer,
|
|
314
|
+
drawbuffer,
|
|
315
|
+
data,
|
|
316
|
+
size,
|
|
317
|
+
ptr->GetState()
|
|
318
|
+
);
|
|
329
319
|
}
|
|
330
320
|
}
|
|
331
321
|
|
|
@@ -338,55 +328,49 @@ void WebGL2RenderingContext::ClearBufferiv(const v8::FunctionCallbackInfo<v8::Va
|
|
|
338
328
|
auto isolate = args.GetIsolate();
|
|
339
329
|
auto context = isolate->GetCurrentContext();
|
|
340
330
|
|
|
341
|
-
auto bufferValue = args[0];
|
|
342
|
-
auto type = GetNativeType(isolate, bufferValue);
|
|
343
331
|
auto values = args[2];
|
|
344
|
-
if (args.Length() > 2 && type == NativeType::WebGLBuffer &&
|
|
345
|
-
args[1]->IsObject()) {
|
|
346
|
-
auto drawbuffer = (int32_t) args[1]->NumberValue(context).ToChecked();
|
|
347
|
-
auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
|
|
348
|
-
if (values->IsArray()) {
|
|
349
|
-
auto array = values.As<v8::Array>();
|
|
350
|
-
auto len = array->Length();
|
|
351
|
-
std::vector<int32_t> buf;
|
|
352
|
-
buf.reserve(len);
|
|
353
|
-
for (int j = 0; j < len; ++j) {
|
|
354
|
-
auto item = array->Get(
|
|
355
|
-
context, j).ToLocalChecked();
|
|
356
|
-
buf.push_back(
|
|
357
|
-
static_cast<int32_t>(item->NumberValue(context).ToChecked())
|
|
358
|
-
);
|
|
359
|
-
}
|
|
360
332
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
333
|
+
auto buffer = args[0]->Uint32Value(context).ToChecked();
|
|
334
|
+
auto drawbuffer = args[1]->Int32Value(context).ToChecked();
|
|
335
|
+
if (values->IsArray()) {
|
|
336
|
+
auto array = values.As<v8::Array>();
|
|
337
|
+
auto len = array->Length();
|
|
338
|
+
std::vector<int32_t> buf;
|
|
339
|
+
buf.reserve(len);
|
|
340
|
+
for (int j = 0; j < len; ++j) {
|
|
341
|
+
auto item = array->Get(
|
|
342
|
+
context, j).ToLocalChecked();
|
|
343
|
+
buf.push_back(
|
|
344
|
+
item->Int32Value(context).ToChecked()
|
|
368
345
|
);
|
|
346
|
+
}
|
|
369
347
|
|
|
370
|
-
} else if (values->IsInt32Array()) {
|
|
371
|
-
auto buf = values.As<v8::Int32Array>();
|
|
372
348
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
349
|
+
canvas_native_webgl2_clear_bufferiv(
|
|
350
|
+
buffer,
|
|
351
|
+
drawbuffer,
|
|
352
|
+
buf.data(),
|
|
353
|
+
buf.size(),
|
|
354
|
+
ptr->GetState()
|
|
355
|
+
);
|
|
378
356
|
|
|
357
|
+
} else if (values->IsInt32Array()) {
|
|
358
|
+
auto buf = values.As<v8::Int32Array>();
|
|
379
359
|
|
|
360
|
+
auto array = buf->Buffer();
|
|
361
|
+
auto offset = buf->ByteOffset();
|
|
362
|
+
auto size = buf->Length();
|
|
363
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
364
|
+
auto data = static_cast<int32_t *>((void *) data_ptr);
|
|
380
365
|
|
|
381
366
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}
|
|
367
|
+
canvas_native_webgl2_clear_bufferiv(
|
|
368
|
+
buffer,
|
|
369
|
+
drawbuffer,
|
|
370
|
+
data,
|
|
371
|
+
size,
|
|
372
|
+
ptr->GetState()
|
|
373
|
+
);
|
|
390
374
|
}
|
|
391
375
|
}
|
|
392
376
|
|
|
@@ -399,23 +383,17 @@ void WebGL2RenderingContext::ClearBufferfi(const v8::FunctionCallbackInfo<v8::Va
|
|
|
399
383
|
auto isolate = args.GetIsolate();
|
|
400
384
|
auto context = isolate->GetCurrentContext();
|
|
401
385
|
|
|
402
|
-
auto
|
|
403
|
-
auto
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
static_cast<float>(depth),
|
|
414
|
-
stencil,
|
|
415
|
-
ptr->GetState()
|
|
416
|
-
);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
386
|
+
auto buffer = args[0]->Uint32Value(context).ToChecked();
|
|
387
|
+
auto drawbuffer = args[1]->Int32Value(context).ToChecked();
|
|
388
|
+
auto depth = args[2]->NumberValue(context).ToChecked();
|
|
389
|
+
auto stencil = args[3]->Int32Value(context).ToChecked();
|
|
390
|
+
canvas_native_webgl2_clear_bufferfi(
|
|
391
|
+
buffer,
|
|
392
|
+
drawbuffer,
|
|
393
|
+
static_cast<float>(depth),
|
|
394
|
+
stencil,
|
|
395
|
+
ptr->GetState()
|
|
396
|
+
);
|
|
419
397
|
}
|
|
420
398
|
|
|
421
399
|
void WebGL2RenderingContext::ClearBufferuiv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -427,52 +405,48 @@ void WebGL2RenderingContext::ClearBufferuiv(const v8::FunctionCallbackInfo<v8::V
|
|
|
427
405
|
auto isolate = args.GetIsolate();
|
|
428
406
|
auto context = isolate->GetCurrentContext();
|
|
429
407
|
|
|
430
|
-
auto bufferValue = args[0];
|
|
431
|
-
auto type = GetNativeType(isolate, bufferValue);
|
|
432
|
-
auto values = args[2];
|
|
433
|
-
if (args.Length() > 2 && type == NativeType::WebGLBuffer &&
|
|
434
|
-
args[1]->IsObject()) {
|
|
435
|
-
auto drawbuffer = (int32_t) args[1]->NumberValue(context).ToChecked();
|
|
436
|
-
auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
|
|
437
|
-
if (values->IsArray()) {
|
|
438
|
-
auto array = values.As<v8::Array>();
|
|
439
|
-
auto len = array->Length();
|
|
440
|
-
std::vector<uint32_t> buf;
|
|
441
|
-
buf.reserve(len);
|
|
442
|
-
for (int j = 0; j < len; ++j) {
|
|
443
|
-
auto item = array->Get(
|
|
444
|
-
context, j).ToLocalChecked();
|
|
445
|
-
buf.push_back(
|
|
446
|
-
static_cast<uint32_t>(item->NumberValue(context).ToChecked())
|
|
447
|
-
);
|
|
448
|
-
}
|
|
449
408
|
|
|
409
|
+
auto values = args[2];
|
|
450
410
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
411
|
+
auto buffer = args[0]->Uint32Value(context).ToChecked();
|
|
412
|
+
auto drawbuffer = args[1]->Int32Value(context).ToChecked();
|
|
413
|
+
if (values->IsArray()) {
|
|
414
|
+
auto array = values.As<v8::Array>();
|
|
415
|
+
auto len = array->Length();
|
|
416
|
+
std::vector<uint32_t> buf;
|
|
417
|
+
buf.reserve(len);
|
|
418
|
+
for (int j = 0; j < len; ++j) {
|
|
419
|
+
auto item = array->Get(
|
|
420
|
+
context, j).ToLocalChecked();
|
|
421
|
+
buf.push_back(
|
|
422
|
+
item->Uint32Value(context).ToChecked()
|
|
457
423
|
);
|
|
424
|
+
}
|
|
458
425
|
|
|
459
|
-
} else if (values->IsUint32Array()) {
|
|
460
|
-
auto buf = values.As<v8::Uint32Array>();
|
|
461
|
-
auto array = buf->Buffer();
|
|
462
|
-
auto offset = buf->ByteOffset();
|
|
463
|
-
auto size = buf->Length();
|
|
464
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
465
|
-
auto data = static_cast<uint32_t *>((void*) data_ptr);
|
|
466
426
|
|
|
427
|
+
canvas_native_webgl2_clear_bufferuiv(
|
|
428
|
+
buffer,
|
|
429
|
+
drawbuffer,
|
|
430
|
+
buf.data(),
|
|
431
|
+
buf.size(),
|
|
432
|
+
ptr->GetState()
|
|
433
|
+
);
|
|
467
434
|
|
|
435
|
+
} else if (values->IsUint32Array()) {
|
|
436
|
+
auto buf = values.As<v8::Uint32Array>();
|
|
437
|
+
auto array = buf->Buffer();
|
|
438
|
+
auto offset = buf->ByteOffset();
|
|
439
|
+
auto size = buf->Length();
|
|
440
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
441
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
468
442
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
443
|
+
|
|
444
|
+
canvas_native_webgl2_clear_bufferuiv(
|
|
445
|
+
buffer,
|
|
446
|
+
drawbuffer,
|
|
447
|
+
data, size,
|
|
448
|
+
ptr->GetState()
|
|
449
|
+
);
|
|
476
450
|
}
|
|
477
451
|
}
|
|
478
452
|
|
|
@@ -490,7 +464,7 @@ void WebGL2RenderingContext::ClientWaitSync(const v8::FunctionCallbackInfo<v8::V
|
|
|
490
464
|
if (args.Length() > 2 && type == NativeType::WebGLSync) {
|
|
491
465
|
auto sync = WebGLSyncImpl::GetPointer(syncValue.As<v8::Object>());
|
|
492
466
|
if (sync != nullptr) {
|
|
493
|
-
auto flags =
|
|
467
|
+
auto flags = args[1]->Uint32Value(context).ToChecked();
|
|
494
468
|
auto timeout = args[2]->NumberValue(context).ToChecked();
|
|
495
469
|
auto ret = canvas_native_webgl2_client_wait_sync(
|
|
496
470
|
sync->GetSync(),
|
|
@@ -499,7 +473,7 @@ void WebGL2RenderingContext::ClientWaitSync(const v8::FunctionCallbackInfo<v8::V
|
|
|
499
473
|
ptr->GetState()
|
|
500
474
|
);
|
|
501
475
|
|
|
502
|
-
args.GetReturnValue().Set(
|
|
476
|
+
args.GetReturnValue().Set(ret);
|
|
503
477
|
return;
|
|
504
478
|
}
|
|
505
479
|
}
|
|
@@ -518,15 +492,15 @@ WebGL2RenderingContext::CompressedTexSubImage3D(const v8::FunctionCallbackInfo<v
|
|
|
518
492
|
auto context = isolate->GetCurrentContext();
|
|
519
493
|
|
|
520
494
|
if (args.Length() > 8) {
|
|
521
|
-
auto target =
|
|
522
|
-
auto level =
|
|
523
|
-
auto xoffset =
|
|
524
|
-
auto yoffset =
|
|
525
|
-
auto zoffset =
|
|
526
|
-
auto width =
|
|
527
|
-
auto height =
|
|
528
|
-
auto depth =
|
|
529
|
-
auto format =
|
|
495
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
496
|
+
auto level = args[1]->Int32Value(context).ToChecked();
|
|
497
|
+
auto xoffset = args[2]->Int32Value(context).ToChecked();
|
|
498
|
+
auto yoffset = args[3]->Int32Value(context).ToChecked();
|
|
499
|
+
auto zoffset = args[4]->Int32Value(context).ToChecked();
|
|
500
|
+
auto width = args[5]->Int32Value(context).ToChecked();
|
|
501
|
+
auto height = args[6]->Int32Value(context).ToChecked();
|
|
502
|
+
auto depth = args[7]->Int32Value(context).ToChecked();
|
|
503
|
+
auto format = args[8]->Uint32Value(context).ToChecked();
|
|
530
504
|
|
|
531
505
|
auto imageSizeOrBufValue = args[0];
|
|
532
506
|
if (args[9]->IsObject()) {
|
|
@@ -535,8 +509,8 @@ WebGL2RenderingContext::CompressedTexSubImage3D(const v8::FunctionCallbackInfo<v
|
|
|
535
509
|
auto array = buf->Buffer();
|
|
536
510
|
auto offset = buf->ByteOffset();
|
|
537
511
|
auto size = buf->ByteLength();
|
|
538
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
539
|
-
auto data = static_cast<uint8_t *>((void*) data_ptr);
|
|
512
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
513
|
+
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
540
514
|
|
|
541
515
|
size_t srcOffset = 0;
|
|
542
516
|
if (args[10]->IsNumber()) {
|
|
@@ -567,10 +541,10 @@ WebGL2RenderingContext::CompressedTexSubImage3D(const v8::FunctionCallbackInfo<v
|
|
|
567
541
|
);
|
|
568
542
|
}
|
|
569
543
|
} else {
|
|
570
|
-
auto imageSizeOrBuf =
|
|
544
|
+
auto imageSizeOrBuf = imageSizeOrBufValue->Int32Value(context).ToChecked();
|
|
571
545
|
auto offset = 0;
|
|
572
546
|
if (args[10]->IsNumber()) {
|
|
573
|
-
offset =
|
|
547
|
+
offset = args[10]->Int32Value(context).ToChecked();
|
|
574
548
|
}
|
|
575
549
|
canvas_native_webgl2_compressed_tex_sub_image3d_none(
|
|
576
550
|
target,
|
|
@@ -600,8 +574,8 @@ void WebGL2RenderingContext::CopyBufferSubData(const v8::FunctionCallbackInfo<v8
|
|
|
600
574
|
auto context = isolate->GetCurrentContext();
|
|
601
575
|
|
|
602
576
|
if (args.Length() > 4) {
|
|
603
|
-
auto readTarget =
|
|
604
|
-
auto writeTarget =
|
|
577
|
+
auto readTarget = args[0]->Uint32Value(context).ToChecked();
|
|
578
|
+
auto writeTarget = args[1]->Uint32Value(context).ToChecked();
|
|
605
579
|
auto readOffset = args[2]->NumberValue(context).ToChecked();
|
|
606
580
|
auto writeOffset = args[3]->NumberValue(context).ToChecked();
|
|
607
581
|
auto size = args[4]->NumberValue(context).ToChecked();
|
|
@@ -626,15 +600,15 @@ void WebGL2RenderingContext::CopyTexSubImage3D(const v8::FunctionCallbackInfo<v8
|
|
|
626
600
|
auto context = isolate->GetCurrentContext();
|
|
627
601
|
|
|
628
602
|
if (args.Length() > 8) {
|
|
629
|
-
auto target =
|
|
630
|
-
auto level =
|
|
631
|
-
auto xoffset =
|
|
632
|
-
auto yoffset =
|
|
633
|
-
auto zoffset =
|
|
634
|
-
auto x =
|
|
635
|
-
auto y =
|
|
636
|
-
auto width =
|
|
637
|
-
auto height =
|
|
603
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
604
|
+
auto level = args[1]->Int32Value(context).ToChecked();
|
|
605
|
+
auto xoffset = args[2]->Int32Value(context).ToChecked();
|
|
606
|
+
auto yoffset = args[3]->Int32Value(context).ToChecked();
|
|
607
|
+
auto zoffset = args[4]->Int32Value(context).ToChecked();
|
|
608
|
+
auto x = args[5]->Int32Value(context).ToChecked();
|
|
609
|
+
auto y = args[6]->Int32Value(context).ToChecked();
|
|
610
|
+
auto width = args[7]->Int32Value(context).ToChecked();
|
|
611
|
+
auto height = args[8]->Int32Value(context).ToChecked();
|
|
638
612
|
canvas_native_webgl2_copy_tex_sub_image3d(
|
|
639
613
|
target,
|
|
640
614
|
level,
|
|
@@ -748,7 +722,7 @@ void WebGL2RenderingContext::DeleteSampler(const v8::FunctionCallbackInfo<v8::Va
|
|
|
748
722
|
}
|
|
749
723
|
|
|
750
724
|
auto isolate = args.GetIsolate();
|
|
751
|
-
|
|
725
|
+
|
|
752
726
|
|
|
753
727
|
auto samplerValue = args[0];
|
|
754
728
|
auto type = GetNativeType(isolate, samplerValue);
|
|
@@ -772,7 +746,7 @@ void WebGL2RenderingContext::DeleteSync(const v8::FunctionCallbackInfo<v8::Value
|
|
|
772
746
|
}
|
|
773
747
|
|
|
774
748
|
auto isolate = args.GetIsolate();
|
|
775
|
-
|
|
749
|
+
|
|
776
750
|
|
|
777
751
|
auto syncValue = args[0];
|
|
778
752
|
auto type = GetNativeType(isolate, syncValue);
|
|
@@ -796,7 +770,7 @@ WebGL2RenderingContext::DeleteTransformFeedback(const v8::FunctionCallbackInfo<v
|
|
|
796
770
|
}
|
|
797
771
|
|
|
798
772
|
auto isolate = args.GetIsolate();
|
|
799
|
-
|
|
773
|
+
|
|
800
774
|
|
|
801
775
|
auto transformFeedbackValue = args[0];
|
|
802
776
|
auto type = GetNativeType(isolate, transformFeedbackValue);
|
|
@@ -820,7 +794,7 @@ void WebGL2RenderingContext::DeleteVertexArray(const v8::FunctionCallbackInfo<v8
|
|
|
820
794
|
}
|
|
821
795
|
|
|
822
796
|
auto isolate = args.GetIsolate();
|
|
823
|
-
|
|
797
|
+
|
|
824
798
|
|
|
825
799
|
auto vertexArrayValue = args[0];
|
|
826
800
|
auto type = GetNativeType(isolate, vertexArrayValue);
|
|
@@ -845,21 +819,19 @@ void WebGL2RenderingContext::DrawArraysInstanced(const v8::FunctionCallbackInfo<
|
|
|
845
819
|
auto isolate = args.GetIsolate();
|
|
846
820
|
auto context = isolate->GetCurrentContext();
|
|
847
821
|
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
);
|
|
822
|
+
auto mode = args[0]->Uint32Value(context).ToChecked();
|
|
823
|
+
auto first = args[1]->Int32Value(context).ToChecked();
|
|
824
|
+
auto count_ = args[2]->Int32Value(context).ToChecked();
|
|
825
|
+
auto instanceCount = args[3]->Int32Value(context).ToChecked();
|
|
826
|
+
canvas_native_webgl2_draw_arrays_instanced(
|
|
827
|
+
mode,
|
|
828
|
+
first,
|
|
829
|
+
count_,
|
|
830
|
+
instanceCount,
|
|
831
|
+
ptr->GetState()
|
|
832
|
+
);
|
|
860
833
|
|
|
861
|
-
|
|
862
|
-
}
|
|
834
|
+
ptr->UpdateInvalidateState();
|
|
863
835
|
}
|
|
864
836
|
|
|
865
837
|
void WebGL2RenderingContext::DrawBuffers(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -880,12 +852,11 @@ void WebGL2RenderingContext::DrawBuffers(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
880
852
|
for (int j = 0; j < len; ++j) {
|
|
881
853
|
auto item = array->Get(
|
|
882
854
|
context, j).ToLocalChecked();
|
|
883
|
-
buf.emplace_back(
|
|
884
|
-
(uint32_t) item->NumberValue(context).ToChecked());
|
|
855
|
+
buf.emplace_back(item->Uint32Value(context).ToChecked());
|
|
885
856
|
}
|
|
886
857
|
|
|
887
858
|
canvas_native_webgl2_draw_buffers(
|
|
888
|
-
|
|
859
|
+
buf.data(), buf.size(),
|
|
889
860
|
ptr->GetState());
|
|
890
861
|
}
|
|
891
862
|
}
|
|
@@ -900,23 +871,21 @@ WebGL2RenderingContext::DrawElementsInstanced(const v8::FunctionCallbackInfo<v8:
|
|
|
900
871
|
auto isolate = args.GetIsolate();
|
|
901
872
|
auto context = isolate->GetCurrentContext();
|
|
902
873
|
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
);
|
|
874
|
+
auto mode = args[0]->Uint32Value(context).ToChecked();
|
|
875
|
+
auto count_ = args[1]->Int32Value(context).ToChecked();
|
|
876
|
+
auto type = args[2]->Uint32Value(context).ToChecked();
|
|
877
|
+
auto offset = args[3]->NumberValue(context).ToChecked();
|
|
878
|
+
auto instanceCount = args[4]->Int32Value(context).ToChecked();
|
|
879
|
+
canvas_native_webgl2_draw_elements_instanced(
|
|
880
|
+
mode,
|
|
881
|
+
count_,
|
|
882
|
+
type,
|
|
883
|
+
static_cast<ssize_t>(offset),
|
|
884
|
+
instanceCount,
|
|
885
|
+
ptr->GetState()
|
|
886
|
+
);
|
|
917
887
|
|
|
918
|
-
|
|
919
|
-
}
|
|
888
|
+
ptr->UpdateInvalidateState();
|
|
920
889
|
}
|
|
921
890
|
|
|
922
891
|
void WebGL2RenderingContext::DrawRangeElements(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -928,25 +897,23 @@ void WebGL2RenderingContext::DrawRangeElements(const v8::FunctionCallbackInfo<v8
|
|
|
928
897
|
auto isolate = args.GetIsolate();
|
|
929
898
|
auto context = isolate->GetCurrentContext();
|
|
930
899
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
);
|
|
900
|
+
auto mode = args[0]->Uint32Value(context).ToChecked();
|
|
901
|
+
auto start = args[1]->Uint32Value(context).ToChecked();
|
|
902
|
+
auto end = args[2]->Uint32Value(context).ToChecked();
|
|
903
|
+
auto count_ = args[3]->Int32Value(context).ToChecked();
|
|
904
|
+
auto type = args[4]->Uint32Value(context).ToChecked();
|
|
905
|
+
auto offset = args[5]->NumberValue(context).ToChecked();
|
|
906
|
+
canvas_native_webgl2_draw_range_elements(
|
|
907
|
+
mode,
|
|
908
|
+
start,
|
|
909
|
+
end,
|
|
910
|
+
count_,
|
|
911
|
+
type,
|
|
912
|
+
static_cast<ssize_t>(offset),
|
|
913
|
+
ptr->GetState()
|
|
914
|
+
);
|
|
947
915
|
|
|
948
|
-
|
|
949
|
-
}
|
|
916
|
+
ptr->UpdateInvalidateState();
|
|
950
917
|
}
|
|
951
918
|
|
|
952
919
|
void WebGL2RenderingContext::EndQuery(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -959,7 +926,7 @@ void WebGL2RenderingContext::EndQuery(const v8::FunctionCallbackInfo<v8::Value>
|
|
|
959
926
|
auto context = isolate->GetCurrentContext();
|
|
960
927
|
|
|
961
928
|
if (args[0]->IsNumber()) {
|
|
962
|
-
auto target =
|
|
929
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
963
930
|
canvas_native_webgl2_end_query(target,
|
|
964
931
|
ptr->GetState());
|
|
965
932
|
}
|
|
@@ -972,7 +939,7 @@ void WebGL2RenderingContext::EndTransformFeedback(const v8::FunctionCallbackInfo
|
|
|
972
939
|
}
|
|
973
940
|
|
|
974
941
|
auto isolate = args.GetIsolate();
|
|
975
|
-
|
|
942
|
+
|
|
976
943
|
|
|
977
944
|
canvas_native_webgl2_end_transform_feedback(
|
|
978
945
|
ptr->GetState());
|
|
@@ -988,18 +955,16 @@ void WebGL2RenderingContext::FenceSync(const v8::FunctionCallbackInfo<v8::Value>
|
|
|
988
955
|
auto isolate = args.GetIsolate();
|
|
989
956
|
auto context = isolate->GetCurrentContext();
|
|
990
957
|
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
auto ret = WebGLSyncImpl::NewInstance(isolate, new WebGLSyncImpl(std::move(sync)));
|
|
958
|
+
auto condition = args[0]->Uint32Value(context).ToChecked();
|
|
959
|
+
auto flags = args[1]->Uint32Value(context).ToChecked();
|
|
960
|
+
auto sync = canvas_native_webgl2_fence_sync(
|
|
961
|
+
condition,
|
|
962
|
+
flags,
|
|
963
|
+
ptr->GetState()
|
|
964
|
+
);
|
|
965
|
+
auto ret = WebGLSyncImpl::NewInstance(isolate, new WebGLSyncImpl(sync));
|
|
1000
966
|
|
|
1001
|
-
|
|
1002
|
-
}
|
|
967
|
+
args.GetReturnValue().Set(ret);
|
|
1003
968
|
}
|
|
1004
969
|
|
|
1005
970
|
void
|
|
@@ -1016,12 +981,12 @@ WebGL2RenderingContext::FramebufferTextureLayer(const v8::FunctionCallbackInfo<v
|
|
|
1016
981
|
|
|
1017
982
|
auto textureValue = args[2];
|
|
1018
983
|
auto type = GetNativeType(isolate, textureValue);
|
|
1019
|
-
if (
|
|
1020
|
-
auto target =
|
|
1021
|
-
auto attachment =
|
|
984
|
+
if (type == NativeType::WebGLTexture) {
|
|
985
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
986
|
+
auto attachment = args[1]->Uint32Value(context).ToChecked();
|
|
1022
987
|
auto texture = WebGLTexture::GetPointer(textureValue.As<v8::Object>());
|
|
1023
|
-
auto level =
|
|
1024
|
-
auto layer =
|
|
988
|
+
auto level = args[3]->Int32Value(context).ToChecked();
|
|
989
|
+
auto layer = args[4]->Int32Value(context).ToChecked();
|
|
1025
990
|
if (texture != nullptr) {
|
|
1026
991
|
canvas_native_webgl2_framebuffer_texture_layer(
|
|
1027
992
|
target,
|
|
@@ -1052,13 +1017,13 @@ WebGL2RenderingContext::GetActiveUniformBlockName(const v8::FunctionCallbackInfo
|
|
|
1052
1017
|
if (type == NativeType::WebGLProgram) {
|
|
1053
1018
|
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1054
1019
|
if (program != nullptr) {
|
|
1055
|
-
auto uniformBlockIndex =
|
|
1020
|
+
auto uniformBlockIndex = args[1]->Uint32Value(context).ToChecked();
|
|
1056
1021
|
auto name = canvas_native_webgl2_get_active_uniform_block_name(
|
|
1057
1022
|
program->GetProgram(),
|
|
1058
1023
|
uniformBlockIndex,
|
|
1059
1024
|
ptr->GetState()
|
|
1060
1025
|
);
|
|
1061
|
-
args.GetReturnValue().Set(ConvertToV8OneByteString(isolate, (char*)name));
|
|
1026
|
+
args.GetReturnValue().Set(ConvertToV8OneByteString(isolate, (char *) name));
|
|
1062
1027
|
return;
|
|
1063
1028
|
}
|
|
1064
1029
|
|
|
@@ -1081,12 +1046,12 @@ void WebGL2RenderingContext::GetActiveUniformBlockParameter(
|
|
|
1081
1046
|
auto programValue = args[0];
|
|
1082
1047
|
auto type = GetNativeType(isolate, programValue);
|
|
1083
1048
|
|
|
1084
|
-
if (
|
|
1049
|
+
if (type == NativeType::WebGLProgram) {
|
|
1085
1050
|
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1086
1051
|
|
|
1087
1052
|
if (program != nullptr) {
|
|
1088
|
-
auto uniformBlockIndex =
|
|
1089
|
-
auto pname =
|
|
1053
|
+
auto uniformBlockIndex = args[1]->Uint32Value(context).ToChecked();
|
|
1054
|
+
auto pname = args[2]->Uint32Value(context).ToChecked();
|
|
1090
1055
|
auto ret = canvas_native_webgl2_get_active_uniform_block_parameter(
|
|
1091
1056
|
program->GetProgram(),
|
|
1092
1057
|
uniformBlockIndex,
|
|
@@ -1106,7 +1071,7 @@ void WebGL2RenderingContext::GetActiveUniformBlockParameter(
|
|
|
1106
1071
|
auto value = canvas_native_webgl_result_get_u32_array(
|
|
1107
1072
|
ret);
|
|
1108
1073
|
|
|
1109
|
-
auto buf = (uint8_t*)canvas_native_u32_buffer_get_bytes(value);
|
|
1074
|
+
auto buf = (uint8_t *) canvas_native_u32_buffer_get_bytes(value);
|
|
1110
1075
|
auto size = canvas_native_u32_buffer_get_length(value);
|
|
1111
1076
|
auto bytes_size = size * sizeof(uint32_t);
|
|
1112
1077
|
|
|
@@ -1114,7 +1079,8 @@ void WebGL2RenderingContext::GetActiveUniformBlockParameter(
|
|
|
1114
1079
|
[](void *data, size_t length,
|
|
1115
1080
|
void *deleter_data) {
|
|
1116
1081
|
if (deleter_data != nullptr) {
|
|
1117
|
-
canvas_native_u32_buffer_destroy(
|
|
1082
|
+
canvas_native_u32_buffer_destroy(
|
|
1083
|
+
(U32Buffer *) deleter_data);
|
|
1118
1084
|
}
|
|
1119
1085
|
},
|
|
1120
1086
|
value);
|
|
@@ -1154,11 +1120,11 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo<v8
|
|
|
1154
1120
|
|
|
1155
1121
|
auto programValue = args[0];
|
|
1156
1122
|
auto type = GetNativeType(isolate, programValue);
|
|
1157
|
-
if (
|
|
1123
|
+
if (type == NativeType::WebGLProgram) {
|
|
1158
1124
|
|
|
1159
1125
|
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1160
1126
|
auto uniformIndicesObject = args[1];
|
|
1161
|
-
auto pname =
|
|
1127
|
+
auto pname = args[2]->Uint32Value(context).ToChecked();
|
|
1162
1128
|
|
|
1163
1129
|
if (uniformIndicesObject->IsArray()) {
|
|
1164
1130
|
auto uniformIndices = uniformIndicesObject.As<v8::Array>();
|
|
@@ -1166,14 +1132,14 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo<v8
|
|
|
1166
1132
|
std::vector<uint32_t> buf;
|
|
1167
1133
|
buf.reserve(size);
|
|
1168
1134
|
for (int j = 0; j < size; j++) {
|
|
1169
|
-
auto item =
|
|
1170
|
-
context, j).ToLocalChecked()->
|
|
1135
|
+
auto item = uniformIndices->Get(
|
|
1136
|
+
context, j).ToLocalChecked()->Uint32Value(context).ToChecked();
|
|
1171
1137
|
buf.emplace_back(item);
|
|
1172
1138
|
}
|
|
1173
1139
|
|
|
1174
1140
|
auto ret = canvas_native_webgl2_get_active_uniforms(
|
|
1175
1141
|
program->GetProgram(),
|
|
1176
|
-
|
|
1142
|
+
buf.data(), buf.size(),
|
|
1177
1143
|
pname,
|
|
1178
1144
|
ptr->GetState()
|
|
1179
1145
|
);
|
|
@@ -1184,17 +1150,17 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo<v8
|
|
|
1184
1150
|
auto value = canvas_native_webgl_result_get_u32_array(
|
|
1185
1151
|
ret);
|
|
1186
1152
|
auto len = canvas_native_u32_buffer_get_length(value);
|
|
1187
|
-
auto
|
|
1153
|
+
auto buffer = canvas_native_u32_buffer_get_bytes(value);
|
|
1188
1154
|
|
|
1189
1155
|
auto array = v8::Array::New(
|
|
1190
1156
|
isolate, (int) len);
|
|
1191
1157
|
|
|
1192
1158
|
for (int j = 0;
|
|
1193
1159
|
j < len; ++j) {
|
|
1194
|
-
auto item =
|
|
1160
|
+
auto item = buffer[j];
|
|
1195
1161
|
array->Set(
|
|
1196
1162
|
context, j,
|
|
1197
|
-
v8::
|
|
1163
|
+
v8::Integer::NewFromUnsigned(isolate, item));
|
|
1198
1164
|
}
|
|
1199
1165
|
args.GetReturnValue().Set(array);
|
|
1200
1166
|
canvas_native_u32_buffer_destroy(value);
|
|
@@ -1208,16 +1174,15 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo<v8
|
|
|
1208
1174
|
auto value = canvas_native_webgl_result_get_i32_array(
|
|
1209
1175
|
ret);
|
|
1210
1176
|
auto len = canvas_native_i32_buffer_get_length(value);
|
|
1211
|
-
auto
|
|
1177
|
+
auto buffer = canvas_native_i32_buffer_get_bytes(value);
|
|
1212
1178
|
auto array = v8::Array::New(
|
|
1213
1179
|
isolate, (int) len);
|
|
1214
1180
|
for (int j = 0;
|
|
1215
1181
|
j < len; ++j) {
|
|
1216
|
-
auto item =
|
|
1182
|
+
auto item = buffer[j];
|
|
1217
1183
|
array->Set(
|
|
1218
1184
|
context, j,
|
|
1219
|
-
v8::
|
|
1220
|
-
(double) item));
|
|
1185
|
+
v8::Integer::New(isolate, item));
|
|
1221
1186
|
}
|
|
1222
1187
|
args.GetReturnValue().Set(array);
|
|
1223
1188
|
canvas_native_i32_buffer_destroy(value);
|
|
@@ -1228,14 +1193,14 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo<v8
|
|
|
1228
1193
|
auto value = canvas_native_webgl_result_get_bool_array(
|
|
1229
1194
|
ret);
|
|
1230
1195
|
auto len = canvas_native_u8_buffer_get_length(value);
|
|
1231
|
-
auto
|
|
1196
|
+
auto buffer = canvas_native_u8_buffer_get_bytes(value);
|
|
1232
1197
|
auto array = v8::Array::New(
|
|
1233
1198
|
isolate,
|
|
1234
1199
|
(int) len);
|
|
1235
1200
|
for (int j = 0;
|
|
1236
1201
|
j < len; ++j) {
|
|
1237
1202
|
bool item =
|
|
1238
|
-
|
|
1203
|
+
buffer[j] == 1;
|
|
1239
1204
|
array->Set(
|
|
1240
1205
|
context, j,
|
|
1241
1206
|
v8::Boolean::New(isolate, item));
|
|
@@ -1267,50 +1232,45 @@ void WebGL2RenderingContext::GetBufferSubData(const v8::FunctionCallbackInfo<v8:
|
|
|
1267
1232
|
auto context = isolate->GetCurrentContext();
|
|
1268
1233
|
|
|
1269
1234
|
auto dstDataObject = args[2];
|
|
1270
|
-
if (
|
|
1271
|
-
|
|
1272
|
-
auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
|
|
1235
|
+
if (dstDataObject->IsArrayBufferView()) {
|
|
1236
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1273
1237
|
auto srcByteOffset = args[1]->NumberValue(context).ToChecked();
|
|
1274
1238
|
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
auto array = dstDataObject.As<v8::ArrayBufferView>();
|
|
1278
|
-
|
|
1279
|
-
auto buf = array->Buffer();
|
|
1280
|
-
auto offset = array->ByteOffset();
|
|
1281
|
-
auto size = buf->ByteLength();
|
|
1282
|
-
auto data = reinterpret_cast<uint8_t *>(buf->GetBackingStore()->Data()) + offset;
|
|
1239
|
+
auto array = dstDataObject.As<v8::ArrayBufferView>();
|
|
1283
1240
|
|
|
1241
|
+
auto buf = array->Buffer();
|
|
1242
|
+
auto offset = array->ByteOffset();
|
|
1243
|
+
auto size = buf->ByteLength();
|
|
1244
|
+
auto data = reinterpret_cast<uint8_t *>(buf->GetBackingStore()->Data()) + offset;
|
|
1284
1245
|
|
|
1285
1246
|
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
ssize_t dstOffsetValue = 0;
|
|
1292
|
-
if (args[3]->IsNumber()) {
|
|
1293
|
-
dstOffsetValue =
|
|
1294
|
-
static_cast<ssize_t>(args[3]->NumberValue(context).ToChecked()) *
|
|
1295
|
-
BYTES_PER_ELEMENT;
|
|
1296
|
-
}
|
|
1247
|
+
auto BYTES_PER_ELEMENT = (ssize_t) array->Get(
|
|
1248
|
+
context,
|
|
1249
|
+
ConvertToV8String(isolate, "BYTES_PER_ELEMENT")).ToLocalChecked()->NumberValue(
|
|
1250
|
+
context).ToChecked();
|
|
1297
1251
|
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1252
|
+
ssize_t dstOffsetValue = 0;
|
|
1253
|
+
if (args[3]->IsNumber()) {
|
|
1254
|
+
dstOffsetValue =
|
|
1255
|
+
static_cast<ssize_t>(args[3]->NumberValue(context).ToChecked()) *
|
|
1256
|
+
BYTES_PER_ELEMENT;
|
|
1257
|
+
}
|
|
1304
1258
|
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
lengthValue,
|
|
1311
|
-
ptr->GetState()
|
|
1312
|
-
);
|
|
1259
|
+
ssize_t lengthValue = 0;
|
|
1260
|
+
if (args[4]->IsNumber()) {
|
|
1261
|
+
lengthValue =
|
|
1262
|
+
static_cast<ssize_t>(args[4]->NumberValue(context).ToChecked()) *
|
|
1263
|
+
BYTES_PER_ELEMENT;
|
|
1313
1264
|
}
|
|
1265
|
+
|
|
1266
|
+
canvas_native_webgl2_get_buffer_sub_data(
|
|
1267
|
+
target,
|
|
1268
|
+
static_cast<ssize_t>(srcByteOffset),
|
|
1269
|
+
data, size,
|
|
1270
|
+
dstOffsetValue,
|
|
1271
|
+
lengthValue,
|
|
1272
|
+
ptr->GetState()
|
|
1273
|
+
);
|
|
1314
1274
|
}
|
|
1315
1275
|
}
|
|
1316
1276
|
|
|
@@ -1357,41 +1317,38 @@ void WebGL2RenderingContext::GetIndexedParameter(const v8::FunctionCallbackInfo<
|
|
|
1357
1317
|
auto isolate = args.GetIsolate();
|
|
1358
1318
|
auto context = isolate->GetCurrentContext();
|
|
1359
1319
|
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
);
|
|
1320
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1321
|
+
auto index = args[1]->Uint32Value(context).ToChecked();
|
|
1322
|
+
auto ret = canvas_native_webgl2_get_indexed_parameter(
|
|
1323
|
+
target,
|
|
1324
|
+
index,
|
|
1325
|
+
ptr->GetState()
|
|
1326
|
+
);
|
|
1368
1327
|
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1328
|
+
switch (target) {
|
|
1329
|
+
case GL_UNIFORM_BUFFER_BINDING:
|
|
1330
|
+
case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: {
|
|
1331
|
+
auto buffer = canvas_native_webgl2_indexed_parameter_get_buffer_value(
|
|
1332
|
+
ret);
|
|
1374
1333
|
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
}
|
|
1388
|
-
break;
|
|
1389
|
-
default:
|
|
1390
|
-
args.GetReturnValue().SetNull();
|
|
1391
|
-
return;
|
|
1334
|
+
args.GetReturnValue().Set(
|
|
1335
|
+
WebGLBuffer::NewInstance(isolate, new WebGLBuffer(buffer)));
|
|
1336
|
+
}
|
|
1337
|
+
return;
|
|
1338
|
+
case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
|
|
1339
|
+
case GL_TRANSFORM_FEEDBACK_BUFFER_START:
|
|
1340
|
+
case GL_UNIFORM_BUFFER_SIZE:
|
|
1341
|
+
case GL_UNIFORM_BUFFER_START: {
|
|
1342
|
+
auto value = canvas_native_webgl2_indexed_parameter_get_value(
|
|
1343
|
+
ret);
|
|
1344
|
+
args.GetReturnValue().Set(static_cast<double>(value));
|
|
1345
|
+
return;
|
|
1392
1346
|
}
|
|
1347
|
+
break;
|
|
1348
|
+
default:
|
|
1349
|
+
args.GetReturnValue().SetNull();
|
|
1350
|
+
return;
|
|
1393
1351
|
}
|
|
1394
|
-
args.GetReturnValue().SetNull();
|
|
1395
1352
|
}
|
|
1396
1353
|
|
|
1397
1354
|
void WebGL2RenderingContext::GetInternalformatParameter(
|
|
@@ -1405,102 +1362,100 @@ void WebGL2RenderingContext::GetInternalformatParameter(
|
|
|
1405
1362
|
auto isolate = args.GetIsolate();
|
|
1406
1363
|
auto context = isolate->GetCurrentContext();
|
|
1407
1364
|
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
return;
|
|
1439
|
-
}
|
|
1440
|
-
case GL_R8:
|
|
1441
|
-
case GL_RG8:
|
|
1442
|
-
case GL_RGB565:
|
|
1443
|
-
case GL_RGBA8:
|
|
1444
|
-
case GL_SRGB8_ALPHA8:
|
|
1445
|
-
case GL_RGB5_A1:
|
|
1446
|
-
case GL_RGBA4:
|
|
1447
|
-
case GL_RGB10_A2:
|
|
1448
|
-
case GL_DEPTH_COMPONENT16:
|
|
1449
|
-
case GL_DEPTH_COMPONENT24:
|
|
1450
|
-
case GL_DEPTH_COMPONENT32F:
|
|
1451
|
-
case GL_DEPTH24_STENCIL8:
|
|
1452
|
-
case GL_DEPTH32F_STENCIL8:
|
|
1453
|
-
case GL_STENCIL_INDEX8:
|
|
1454
|
-
// noop
|
|
1455
|
-
break;
|
|
1456
|
-
case GL_R16F:
|
|
1457
|
-
case GL_RG16F:
|
|
1458
|
-
case GL_R32F:
|
|
1459
|
-
case GL_RG32F:
|
|
1460
|
-
case GL_RGBA32F:
|
|
1461
|
-
case GL_R11F_G11F_B10F:
|
|
1462
|
-
// noop
|
|
1463
|
-
break;
|
|
1464
|
-
default:
|
|
1465
|
-
args.GetReturnValue().SetNull();
|
|
1466
|
-
return;
|
|
1365
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1366
|
+
auto internalformat = args[1]->Uint32Value(context).ToChecked();
|
|
1367
|
+
auto pname = args[2]->Uint32Value(context).ToChecked();
|
|
1368
|
+
switch (internalformat) {
|
|
1369
|
+
case GL_RGB:
|
|
1370
|
+
case GL_RGBA:
|
|
1371
|
+
case GL_R8UI:
|
|
1372
|
+
case GL_R8I:
|
|
1373
|
+
case GL_R16UI:
|
|
1374
|
+
case GL_R16I:
|
|
1375
|
+
case GL_R32UI:
|
|
1376
|
+
case GL_R32I:
|
|
1377
|
+
case GL_RG8UI:
|
|
1378
|
+
case GL_RG8I:
|
|
1379
|
+
case GL_RG16UI:
|
|
1380
|
+
case GL_RG16I:
|
|
1381
|
+
case GL_RG32UI:
|
|
1382
|
+
case GL_RG32I:
|
|
1383
|
+
case GL_RGBA8UI:
|
|
1384
|
+
case GL_RGBA8I:
|
|
1385
|
+
case GL_RGB10_A2UI:
|
|
1386
|
+
case GL_RGBA16UI:
|
|
1387
|
+
case GL_RGBA16I:
|
|
1388
|
+
case GL_RGBA32UI:
|
|
1389
|
+
case GL_RGBA32I: {
|
|
1390
|
+
// empty
|
|
1391
|
+
auto arraybuffer = v8::ArrayBuffer::New(isolate, 0);
|
|
1392
|
+
|
|
1393
|
+
args.GetReturnValue().Set(v8::Int32Array::New(arraybuffer, 0, 0));
|
|
1394
|
+
return;
|
|
1467
1395
|
}
|
|
1396
|
+
case GL_R8:
|
|
1397
|
+
case GL_RG8:
|
|
1398
|
+
case GL_RGB565:
|
|
1399
|
+
case GL_RGBA8:
|
|
1400
|
+
case GL_SRGB8_ALPHA8:
|
|
1401
|
+
case GL_RGB5_A1:
|
|
1402
|
+
case GL_RGBA4:
|
|
1403
|
+
case GL_RGB10_A2:
|
|
1404
|
+
case GL_DEPTH_COMPONENT16:
|
|
1405
|
+
case GL_DEPTH_COMPONENT24:
|
|
1406
|
+
case GL_DEPTH_COMPONENT32F:
|
|
1407
|
+
case GL_DEPTH24_STENCIL8:
|
|
1408
|
+
case GL_DEPTH32F_STENCIL8:
|
|
1409
|
+
case GL_STENCIL_INDEX8:
|
|
1410
|
+
// noop
|
|
1411
|
+
break;
|
|
1412
|
+
case GL_R16F:
|
|
1413
|
+
case GL_RG16F:
|
|
1414
|
+
case GL_R32F:
|
|
1415
|
+
case GL_RG32F:
|
|
1416
|
+
case GL_RGBA32F:
|
|
1417
|
+
case GL_R11F_G11F_B10F:
|
|
1418
|
+
// noop
|
|
1419
|
+
break;
|
|
1420
|
+
default:
|
|
1421
|
+
args.GetReturnValue().SetNull();
|
|
1422
|
+
return;
|
|
1423
|
+
}
|
|
1468
1424
|
|
|
1469
1425
|
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
if (pname == GL_SAMPLES) {
|
|
1478
|
-
auto value = canvas_native_webgl_result_get_i32_array(ret);
|
|
1479
|
-
|
|
1480
|
-
auto buf = (uint8_t*)canvas_native_i32_buffer_get_bytes(value);
|
|
1481
|
-
auto size = canvas_native_i32_buffer_get_length(value);
|
|
1482
|
-
auto bytes_size = size * sizeof(int32_t);
|
|
1483
|
-
|
|
1484
|
-
auto store = v8::ArrayBuffer::NewBackingStore(buf, bytes_size,
|
|
1485
|
-
[](void *data, size_t length,
|
|
1486
|
-
void *deleter_data) {
|
|
1487
|
-
if (deleter_data != nullptr) {
|
|
1488
|
-
canvas_native_i32_buffer_destroy((I32Buffer *) deleter_data);
|
|
1489
|
-
}
|
|
1490
|
-
},
|
|
1491
|
-
value);
|
|
1426
|
+
auto ret = canvas_native_webgl2_get_internalformat_parameter(
|
|
1427
|
+
target,
|
|
1428
|
+
internalformat,
|
|
1429
|
+
pname,
|
|
1430
|
+
ptr->GetState()
|
|
1431
|
+
);
|
|
1492
1432
|
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1433
|
+
if (pname == GL_SAMPLES) {
|
|
1434
|
+
auto value = canvas_native_webgl_result_get_i32_array(ret);
|
|
1435
|
+
|
|
1436
|
+
auto buf = (uint8_t *) canvas_native_i32_buffer_get_bytes(value);
|
|
1437
|
+
auto size = canvas_native_i32_buffer_get_length(value);
|
|
1438
|
+
auto bytes_size = size * sizeof(int32_t);
|
|
1439
|
+
|
|
1440
|
+
auto store = v8::ArrayBuffer::NewBackingStore(buf, bytes_size,
|
|
1441
|
+
[](void *data, size_t length,
|
|
1442
|
+
void *deleter_data) {
|
|
1443
|
+
if (deleter_data != nullptr) {
|
|
1444
|
+
canvas_native_i32_buffer_destroy(
|
|
1445
|
+
(I32Buffer *) deleter_data);
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1448
|
+
value);
|
|
1449
|
+
|
|
1450
|
+
auto arraybuffer = v8::ArrayBuffer::New(isolate, std::move(store));
|
|
1451
|
+
args.GetReturnValue().Set(v8::Int32Array::New(arraybuffer, 0, size));
|
|
1452
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1453
|
+
return;
|
|
1454
|
+
} else {
|
|
1455
|
+
args.GetReturnValue().SetNull();
|
|
1456
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1457
|
+
return;
|
|
1502
1458
|
}
|
|
1503
|
-
args.GetReturnValue().SetNull();
|
|
1504
1459
|
}
|
|
1505
1460
|
|
|
1506
1461
|
void WebGL2RenderingContext::GetParameter(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -1513,33 +1468,29 @@ void WebGL2RenderingContext::GetParameter(const v8::FunctionCallbackInfo<v8::Val
|
|
|
1513
1468
|
auto isolate = args.GetIsolate();
|
|
1514
1469
|
auto context = isolate->GetCurrentContext();
|
|
1515
1470
|
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
result));
|
|
1471
|
+
auto pname = args[0]->Uint32Value(context).ToChecked();
|
|
1472
|
+
auto result = canvas_native_webgl2_get_parameter(
|
|
1473
|
+
pname,
|
|
1474
|
+
ptr->GetState());
|
|
1475
|
+
switch (pname) {
|
|
1476
|
+
case GL_COPY_READ_BUFFER_BINDING:
|
|
1477
|
+
case GL_COPY_WRITE_BUFFER_BINDING:
|
|
1478
|
+
case GL_DRAW_FRAMEBUFFER_BINDING:
|
|
1479
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
1480
|
+
result));
|
|
1527
1481
|
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1482
|
+
canvas_native_webgl_WebGLResult_destroy(result);
|
|
1483
|
+
return;
|
|
1484
|
+
default: {
|
|
1485
|
+
auto ret = ptr->GetParameterInternal(
|
|
1486
|
+
isolate, pname, result);
|
|
1533
1487
|
|
|
1534
|
-
|
|
1488
|
+
canvas_native_webgl_WebGLResult_destroy(result);
|
|
1535
1489
|
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
}
|
|
1490
|
+
args.GetReturnValue().Set(ret);
|
|
1491
|
+
return;
|
|
1539
1492
|
}
|
|
1540
1493
|
}
|
|
1541
|
-
|
|
1542
|
-
args.GetReturnValue().SetNull();
|
|
1543
1494
|
}
|
|
1544
1495
|
|
|
1545
1496
|
void WebGL2RenderingContext::GetQueryParameter(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -1552,37 +1503,34 @@ void WebGL2RenderingContext::GetQueryParameter(const v8::FunctionCallbackInfo<v8
|
|
|
1552
1503
|
auto isolate = args.GetIsolate();
|
|
1553
1504
|
auto context = isolate->GetCurrentContext();
|
|
1554
1505
|
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked();
|
|
1506
|
+
auto queryValue = args[0];
|
|
1507
|
+
auto type = GetNativeType(isolate, queryValue);
|
|
1508
|
+
if (type == NativeType::WebGLQuery) {
|
|
1509
|
+
auto query = WebGLQuery::GetPointer(queryValue.As<v8::Object>());
|
|
1510
|
+
if (query != nullptr) {
|
|
1511
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
1562
1512
|
|
|
1563
1513
|
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1572
|
-
return;
|
|
1573
|
-
} else if (pname ==
|
|
1574
|
-
GL_QUERY_RESULT_AVAILABLE) {
|
|
1575
|
-
args.GetReturnValue().Set((int32_t) canvas_native_webgl_result_get_u32(
|
|
1576
|
-
ret));
|
|
1577
|
-
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1578
|
-
return;
|
|
1579
|
-
}
|
|
1580
|
-
//clean up
|
|
1514
|
+
auto ret = canvas_native_webgl2_get_query_parameter(
|
|
1515
|
+
query->GetQuery(),
|
|
1516
|
+
pname,
|
|
1517
|
+
ptr->GetState());
|
|
1518
|
+
if (pname == GL_QUERY_RESULT) {
|
|
1519
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_bool(
|
|
1520
|
+
ret));
|
|
1581
1521
|
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1582
|
-
|
|
1522
|
+
return;
|
|
1523
|
+
} else if (pname ==
|
|
1524
|
+
GL_QUERY_RESULT_AVAILABLE) {
|
|
1525
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_u32(
|
|
1526
|
+
ret));
|
|
1527
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1528
|
+
return;
|
|
1583
1529
|
}
|
|
1584
|
-
|
|
1530
|
+
//clean up
|
|
1531
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1585
1532
|
|
|
1533
|
+
}
|
|
1586
1534
|
}
|
|
1587
1535
|
|
|
1588
1536
|
args.GetReturnValue().SetNull();
|
|
@@ -1598,24 +1546,20 @@ void WebGL2RenderingContext::GetQuery(const v8::FunctionCallbackInfo<v8::Value>
|
|
|
1598
1546
|
auto isolate = args.GetIsolate();
|
|
1599
1547
|
auto context = isolate->GetCurrentContext();
|
|
1600
1548
|
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
ret));
|
|
1611
|
-
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1612
|
-
return;
|
|
1613
|
-
}
|
|
1614
|
-
// clean up
|
|
1549
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1550
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
1551
|
+
auto ret = canvas_native_webgl2_get_query(
|
|
1552
|
+
target,
|
|
1553
|
+
pname,
|
|
1554
|
+
ptr->GetState());
|
|
1555
|
+
if (pname == GL_CURRENT_QUERY) {
|
|
1556
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
1557
|
+
ret));
|
|
1615
1558
|
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1559
|
+
return;
|
|
1616
1560
|
}
|
|
1617
|
-
|
|
1618
|
-
|
|
1561
|
+
// clean up
|
|
1562
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1619
1563
|
}
|
|
1620
1564
|
|
|
1621
1565
|
void WebGL2RenderingContext::GetSamplerParameter(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -1628,49 +1572,46 @@ void WebGL2RenderingContext::GetSamplerParameter(const v8::FunctionCallbackInfo<
|
|
|
1628
1572
|
auto isolate = args.GetIsolate();
|
|
1629
1573
|
auto context = isolate->GetCurrentContext();
|
|
1630
1574
|
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
ptr->GetState());
|
|
1642
|
-
|
|
1643
|
-
switch (pname) {
|
|
1644
|
-
case GL_TEXTURE_MAX_LOD:
|
|
1645
|
-
case GL_TEXTURE_MIN_LOD:
|
|
1646
|
-
args.GetReturnValue().Set(
|
|
1647
|
-
static_cast<double>(canvas_native_webgl_result_get_f32(
|
|
1648
|
-
ret)));
|
|
1649
|
-
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1650
|
-
return;
|
|
1651
|
-
case GL_TEXTURE_COMPARE_FUNC:
|
|
1652
|
-
case GL_TEXTURE_COMPARE_MODE:
|
|
1653
|
-
case GL_TEXTURE_MAG_FILTER:
|
|
1654
|
-
case GL_TEXTURE_MIN_FILTER:
|
|
1655
|
-
case GL_TEXTURE_WRAP_R:
|
|
1656
|
-
case GL_TEXTURE_WRAP_S:
|
|
1657
|
-
case GL_TEXTURE_WRAP_T:
|
|
1658
|
-
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
1659
|
-
ret));
|
|
1660
|
-
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1661
|
-
return;
|
|
1662
|
-
default:
|
|
1663
|
-
args.GetReturnValue().SetNull();
|
|
1664
|
-
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1665
|
-
return;
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
}
|
|
1575
|
+
auto samplerValue = args[0];
|
|
1576
|
+
auto type = GetNativeType(isolate, samplerValue);
|
|
1577
|
+
if (type == NativeType::WebGLSampler) {
|
|
1578
|
+
auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
|
|
1579
|
+
if (sampler != nullptr) {
|
|
1580
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
1581
|
+
auto ret = canvas_native_webgl2_get_sampler_parameter(
|
|
1582
|
+
sampler->GetSampler(),
|
|
1583
|
+
pname,
|
|
1584
|
+
ptr->GetState());
|
|
1671
1585
|
|
|
1672
|
-
|
|
1673
|
-
|
|
1586
|
+
switch (pname) {
|
|
1587
|
+
case GL_TEXTURE_MAX_LOD:
|
|
1588
|
+
case GL_TEXTURE_MIN_LOD:
|
|
1589
|
+
args.GetReturnValue().Set(
|
|
1590
|
+
static_cast<double>(canvas_native_webgl_result_get_f32(
|
|
1591
|
+
ret)));
|
|
1592
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1593
|
+
return;
|
|
1594
|
+
case GL_TEXTURE_COMPARE_FUNC:
|
|
1595
|
+
case GL_TEXTURE_COMPARE_MODE:
|
|
1596
|
+
case GL_TEXTURE_MAG_FILTER:
|
|
1597
|
+
case GL_TEXTURE_MIN_FILTER:
|
|
1598
|
+
case GL_TEXTURE_WRAP_R:
|
|
1599
|
+
case GL_TEXTURE_WRAP_S:
|
|
1600
|
+
case GL_TEXTURE_WRAP_T:
|
|
1601
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
1602
|
+
ret));
|
|
1603
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1604
|
+
return;
|
|
1605
|
+
default:
|
|
1606
|
+
args.GetReturnValue().SetNull();
|
|
1607
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1608
|
+
return;
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
args.GetReturnValue().SetNull();
|
|
1614
|
+
}
|
|
1674
1615
|
|
|
1675
1616
|
void WebGL2RenderingContext::GetSyncParameter(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
1676
1617
|
WebGL2RenderingContext *ptr = GetPointer(args.This());
|
|
@@ -1682,34 +1623,31 @@ void WebGL2RenderingContext::GetSyncParameter(const v8::FunctionCallbackInfo<v8:
|
|
|
1682
1623
|
auto isolate = args.GetIsolate();
|
|
1683
1624
|
auto context = isolate->GetCurrentContext();
|
|
1684
1625
|
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
ptr->GetState());
|
|
1626
|
+
auto syncValue = args[0];
|
|
1627
|
+
auto sync = WebGLSyncImpl::GetPointer(syncValue.As<v8::Object>());
|
|
1628
|
+
if (sync != nullptr) {
|
|
1629
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
1630
|
+
auto ret = canvas_native_webgl2_get_sync_parameter(
|
|
1631
|
+
sync->GetSync(),
|
|
1632
|
+
pname,
|
|
1633
|
+
ptr->GetState());
|
|
1694
1634
|
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1635
|
+
switch (pname) {
|
|
1636
|
+
case GL_OBJECT_TYPE:
|
|
1637
|
+
case GL_SYNC_STATUS:
|
|
1638
|
+
case GL_SYNC_CONDITION:
|
|
1639
|
+
case GL_SYNC_FLAGS:
|
|
1640
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
1641
|
+
ret));
|
|
1702
1642
|
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
}
|
|
1643
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1644
|
+
return;
|
|
1645
|
+
default:
|
|
1646
|
+
args.GetReturnValue().SetNull();
|
|
1647
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
1648
|
+
return;
|
|
1710
1649
|
}
|
|
1711
1650
|
}
|
|
1712
|
-
|
|
1713
1651
|
args.GetReturnValue().SetNull();
|
|
1714
1652
|
}
|
|
1715
1653
|
|
|
@@ -1724,30 +1662,28 @@ void WebGL2RenderingContext::GetTransformFeedbackVarying(
|
|
|
1724
1662
|
auto isolate = args.GetIsolate();
|
|
1725
1663
|
auto context = isolate->GetCurrentContext();
|
|
1726
1664
|
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
);
|
|
1739
|
-
|
|
1740
|
-
if (canvas_native_webgl_active_info_get_is_empty(
|
|
1741
|
-
ret)) {
|
|
1742
|
-
canvas_native_webgl_active_info_destroy(ret);
|
|
1743
|
-
args.GetReturnValue().SetNull();
|
|
1744
|
-
return;
|
|
1745
|
-
}
|
|
1665
|
+
auto programValue = args[0];
|
|
1666
|
+
auto type = GetNativeType(isolate, programValue);
|
|
1667
|
+
if (type == NativeType::WebGLProgram) {
|
|
1668
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1669
|
+
auto index = args[1]->Uint32Value(context).ToChecked();
|
|
1670
|
+
if (program != nullptr) {
|
|
1671
|
+
auto ret = canvas_native_webgl2_get_transform_feedback_varying(
|
|
1672
|
+
program->GetProgram(),
|
|
1673
|
+
index,
|
|
1674
|
+
ptr->GetState()
|
|
1675
|
+
);
|
|
1746
1676
|
|
|
1747
|
-
|
|
1748
|
-
|
|
1677
|
+
if (canvas_native_webgl_active_info_get_is_empty(
|
|
1678
|
+
ret)) {
|
|
1679
|
+
canvas_native_webgl_active_info_destroy(ret);
|
|
1680
|
+
args.GetReturnValue().SetNull();
|
|
1749
1681
|
return;
|
|
1750
1682
|
}
|
|
1683
|
+
|
|
1684
|
+
auto info = WebGLActiveInfoImpl::NewInstance(isolate, new WebGLActiveInfoImpl(ret));
|
|
1685
|
+
args.GetReturnValue().Set(info);
|
|
1686
|
+
return;
|
|
1751
1687
|
}
|
|
1752
1688
|
}
|
|
1753
1689
|
|
|
@@ -1764,22 +1700,19 @@ void WebGL2RenderingContext::GetUniformBlockIndex(const v8::FunctionCallbackInfo
|
|
|
1764
1700
|
auto isolate = args.GetIsolate();
|
|
1765
1701
|
auto context = isolate->GetCurrentContext();
|
|
1766
1702
|
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
return;
|
|
1780
|
-
}
|
|
1703
|
+
auto programValue = args[0];
|
|
1704
|
+
auto type = GetNativeType(isolate, programValue);
|
|
1705
|
+
if (type == NativeType::WebGLProgram) {
|
|
1706
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1707
|
+
auto index = ConvertFromV8String(isolate, args[1]);
|
|
1708
|
+
if (program != nullptr) {
|
|
1709
|
+
auto ret = canvas_native_webgl2_get_uniform_block_index(
|
|
1710
|
+
program->GetProgram(),
|
|
1711
|
+
index.c_str(),
|
|
1712
|
+
ptr->GetState());
|
|
1713
|
+
args.GetReturnValue().Set((int) ret);
|
|
1714
|
+
return;
|
|
1781
1715
|
}
|
|
1782
|
-
|
|
1783
1716
|
}
|
|
1784
1717
|
|
|
1785
1718
|
args.GetReturnValue().SetNull();
|
|
@@ -1795,58 +1728,54 @@ void WebGL2RenderingContext::GetUniformIndices(const v8::FunctionCallbackInfo<v8
|
|
|
1795
1728
|
auto isolate = args.GetIsolate();
|
|
1796
1729
|
auto context = isolate->GetCurrentContext();
|
|
1797
1730
|
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
auto len = uniformNames->Length();
|
|
1808
|
-
|
|
1809
|
-
std::vector<std::string> store;
|
|
1810
|
-
store.reserve(len);
|
|
1811
|
-
|
|
1812
|
-
for (int j = 0; j < len; ++j) {
|
|
1813
|
-
auto name = ConvertFromV8String(isolate, uniformNames->Get(
|
|
1814
|
-
context, j).ToLocalChecked());
|
|
1815
|
-
|
|
1816
|
-
store.push_back(name);
|
|
1817
|
-
}
|
|
1731
|
+
auto programValue = args[0];
|
|
1732
|
+
auto type = GetNativeType(isolate, programValue);
|
|
1733
|
+
if (type == NativeType::WebGLProgram) {
|
|
1734
|
+
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
1735
|
+
auto uniformNamesObject = args[1];
|
|
1736
|
+
if (program != nullptr &&
|
|
1737
|
+
uniformNamesObject->IsArray()) {
|
|
1738
|
+
auto uniformNames = uniformNamesObject.As<v8::Array>();
|
|
1739
|
+
auto len = uniformNames->Length();
|
|
1818
1740
|
|
|
1741
|
+
std::vector<std::string> store;
|
|
1742
|
+
store.reserve(len);
|
|
1819
1743
|
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
}
|
|
1744
|
+
for (int j = 0; j < len; ++j) {
|
|
1745
|
+
auto name = ConvertFromV8String(isolate, uniformNames->Get(
|
|
1746
|
+
context, j).ToLocalChecked());
|
|
1824
1747
|
|
|
1748
|
+
store.push_back(name);
|
|
1749
|
+
}
|
|
1825
1750
|
|
|
1826
|
-
auto ret = canvas_native_webgl2_get_uniform_indices(
|
|
1827
|
-
program->GetProgram(),
|
|
1828
|
-
cStrings,
|
|
1829
|
-
store.size(),
|
|
1830
|
-
ptr->GetState());
|
|
1831
1751
|
|
|
1752
|
+
const char *cStrings[store.size()];
|
|
1753
|
+
for (size_t i = 0; i < store.size(); ++i) {
|
|
1754
|
+
cStrings[i] = store[i].c_str();
|
|
1755
|
+
}
|
|
1832
1756
|
|
|
1833
|
-
auto retSize = canvas_native_u32_buffer_get_length(ret);
|
|
1834
|
-
auto buf = canvas_native_u32_buffer_get_bytes(ret);
|
|
1835
|
-
auto result = v8::Array::New(isolate, (int) retSize);
|
|
1836
|
-
for (int j = 0; j < retSize; ++j) {
|
|
1837
|
-
auto item = buf[j];
|
|
1838
|
-
result->Set(context,
|
|
1839
|
-
j,
|
|
1840
|
-
v8::Number::New(isolate,
|
|
1841
|
-
(int32_t) item));
|
|
1842
|
-
}
|
|
1843
1757
|
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1758
|
+
auto ret = canvas_native_webgl2_get_uniform_indices(
|
|
1759
|
+
program->GetProgram(),
|
|
1760
|
+
cStrings,
|
|
1761
|
+
store.size(),
|
|
1762
|
+
ptr->GetState());
|
|
1763
|
+
|
|
1764
|
+
|
|
1765
|
+
auto retSize = canvas_native_u32_buffer_get_length(ret);
|
|
1766
|
+
auto buf = canvas_native_u32_buffer_get_bytes(ret);
|
|
1767
|
+
auto result = v8::Array::New(isolate, (int) retSize);
|
|
1768
|
+
for (int j = 0; j < retSize; ++j) {
|
|
1769
|
+
auto item = buf[j];
|
|
1770
|
+
result->Set(context,
|
|
1771
|
+
j,
|
|
1772
|
+
v8::Integer::NewFromUnsigned(isolate, item));
|
|
1847
1773
|
}
|
|
1848
|
-
}
|
|
1849
1774
|
|
|
1775
|
+
args.GetReturnValue().Set(result);
|
|
1776
|
+
canvas_native_u32_buffer_destroy(ret);
|
|
1777
|
+
return;
|
|
1778
|
+
}
|
|
1850
1779
|
}
|
|
1851
1780
|
|
|
1852
1781
|
args.GetReturnValue().SetNull();
|
|
@@ -1863,24 +1792,22 @@ WebGL2RenderingContext::InvalidateFramebuffer(const v8::FunctionCallbackInfo<v8:
|
|
|
1863
1792
|
auto context = isolate->GetCurrentContext();
|
|
1864
1793
|
|
|
1865
1794
|
auto attachments = args[1];
|
|
1866
|
-
|
|
1867
|
-
auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
|
|
1795
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1868
1796
|
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1880
|
-
canvas_native_webgl2_invalidate_framebuffer(
|
|
1881
|
-
target, buf.data(), buf.size(),
|
|
1882
|
-
ptr->GetState());
|
|
1797
|
+
if (attachments->IsArray()) {
|
|
1798
|
+
auto array = attachments.As<v8::Array>();
|
|
1799
|
+
auto len = array->Length();
|
|
1800
|
+
std::vector<uint32_t> buf;
|
|
1801
|
+
buf.reserve(len);
|
|
1802
|
+
for (int j = 0; j < len; ++j) {
|
|
1803
|
+
auto item = array->Get(
|
|
1804
|
+
context, j).ToLocalChecked()->Uint32Value(context).ToChecked();
|
|
1805
|
+
buf.push_back(item);
|
|
1883
1806
|
}
|
|
1807
|
+
|
|
1808
|
+
canvas_native_webgl2_invalidate_framebuffer(
|
|
1809
|
+
target, buf.data(), buf.size(),
|
|
1810
|
+
ptr->GetState());
|
|
1884
1811
|
}
|
|
1885
1812
|
}
|
|
1886
1813
|
|
|
@@ -1894,36 +1821,32 @@ WebGL2RenderingContext::InvalidateSubFramebuffer(const v8::FunctionCallbackInfo<
|
|
|
1894
1821
|
auto isolate = args.GetIsolate();
|
|
1895
1822
|
auto context = isolate->GetCurrentContext();
|
|
1896
1823
|
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
buf.push_back(item);
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
canvas_native_webgl2_invalidate_sub_framebuffer(
|
|
1917
|
-
target,
|
|
1918
|
-
buf.data(), buf.size(),
|
|
1919
|
-
x,
|
|
1920
|
-
y,
|
|
1921
|
-
width,
|
|
1922
|
-
height,
|
|
1923
|
-
ptr->GetState());
|
|
1824
|
+
auto attachments = args[1];
|
|
1825
|
+
if (attachments->IsArray()) {
|
|
1826
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
1827
|
+
auto x = args[2]->Int32Value(context).ToChecked();
|
|
1828
|
+
auto y = args[3]->Int32Value(context).ToChecked();
|
|
1829
|
+
auto width = args[4]->Int32Value(context).ToChecked();
|
|
1830
|
+
auto height = args[5]->Int32Value(context).ToChecked();
|
|
1831
|
+
|
|
1832
|
+
auto array = attachments.As<v8::Array>();
|
|
1833
|
+
auto len = array->Length();
|
|
1834
|
+
std::vector<uint32_t> buf;
|
|
1835
|
+
buf.reserve(len);
|
|
1836
|
+
for (int j = 0; j < len; ++j) {
|
|
1837
|
+
auto item = array->Get(
|
|
1838
|
+
context, j).ToLocalChecked()->Uint32Value(context).ToChecked();
|
|
1839
|
+
buf.push_back(item);
|
|
1924
1840
|
}
|
|
1925
1841
|
|
|
1926
|
-
|
|
1842
|
+
canvas_native_webgl2_invalidate_sub_framebuffer(
|
|
1843
|
+
target,
|
|
1844
|
+
buf.data(), buf.size(),
|
|
1845
|
+
x,
|
|
1846
|
+
y,
|
|
1847
|
+
width,
|
|
1848
|
+
height,
|
|
1849
|
+
ptr->GetState());
|
|
1927
1850
|
}
|
|
1928
1851
|
}
|
|
1929
1852
|
|
|
@@ -2071,13 +1994,11 @@ void WebGL2RenderingContext::ReadBuffer(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2071
1994
|
auto isolate = args.GetIsolate();
|
|
2072
1995
|
auto context = isolate->GetCurrentContext();
|
|
2073
1996
|
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
);
|
|
2080
|
-
}
|
|
1997
|
+
auto src = args[0]->Uint32Value(context).ToChecked();
|
|
1998
|
+
canvas_native_webgl2_read_buffer(
|
|
1999
|
+
src,
|
|
2000
|
+
ptr->GetState()
|
|
2001
|
+
);
|
|
2081
2002
|
}
|
|
2082
2003
|
|
|
2083
2004
|
void WebGL2RenderingContext::RenderbufferStorageMultisample(
|
|
@@ -2090,21 +2011,19 @@ void WebGL2RenderingContext::RenderbufferStorageMultisample(
|
|
|
2090
2011
|
auto isolate = args.GetIsolate();
|
|
2091
2012
|
auto context = isolate->GetCurrentContext();
|
|
2092
2013
|
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
);
|
|
2107
|
-
}
|
|
2014
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
2015
|
+
auto samples = args[1]->Int32Value(context).ToChecked();
|
|
2016
|
+
auto internalFormat = args[2]->Uint32Value(context).ToChecked();
|
|
2017
|
+
auto width = args[3]->Int32Value(context).ToChecked();
|
|
2018
|
+
auto height = args[4]->Int32Value(context).ToChecked();
|
|
2019
|
+
canvas_native_webgl2_renderbuffer_storage_multisample(
|
|
2020
|
+
target,
|
|
2021
|
+
samples,
|
|
2022
|
+
internalFormat,
|
|
2023
|
+
width,
|
|
2024
|
+
height,
|
|
2025
|
+
ptr->GetState()
|
|
2026
|
+
);
|
|
2108
2027
|
}
|
|
2109
2028
|
|
|
2110
2029
|
void
|
|
@@ -2127,22 +2046,19 @@ void WebGL2RenderingContext::SamplerParameterf(const v8::FunctionCallbackInfo<v8
|
|
|
2127
2046
|
auto isolate = args.GetIsolate();
|
|
2128
2047
|
auto context = isolate->GetCurrentContext();
|
|
2129
2048
|
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
ptr->GetState());
|
|
2143
|
-
}
|
|
2049
|
+
auto samplerValue = args[0];
|
|
2050
|
+
auto type = GetNativeType(isolate, samplerValue);
|
|
2051
|
+
if (type == NativeType::WebGLSampler) {
|
|
2052
|
+
auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
|
|
2053
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
2054
|
+
auto param = args[2]->NumberValue(context).ToChecked();
|
|
2055
|
+
if (sampler != nullptr) {
|
|
2056
|
+
canvas_native_webgl2_sampler_parameterf(
|
|
2057
|
+
sampler->GetSampler(),
|
|
2058
|
+
pname,
|
|
2059
|
+
static_cast<float>(param),
|
|
2060
|
+
ptr->GetState());
|
|
2144
2061
|
}
|
|
2145
|
-
|
|
2146
2062
|
}
|
|
2147
2063
|
|
|
2148
2064
|
}
|
|
@@ -2156,22 +2072,19 @@ void WebGL2RenderingContext::SamplerParameteri(const v8::FunctionCallbackInfo<v8
|
|
|
2156
2072
|
auto isolate = args.GetIsolate();
|
|
2157
2073
|
auto context = isolate->GetCurrentContext();
|
|
2158
2074
|
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
ptr->GetState());
|
|
2172
|
-
}
|
|
2075
|
+
auto samplerValue = args[0];
|
|
2076
|
+
auto type = GetNativeType(isolate, samplerValue);
|
|
2077
|
+
if (type == NativeType::WebGLSampler) {
|
|
2078
|
+
auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
|
|
2079
|
+
auto pname = args[1]->Uint32Value(context).ToChecked();
|
|
2080
|
+
auto param = args[2]->Int32Value(context).ToChecked();
|
|
2081
|
+
if (sampler != nullptr) {
|
|
2082
|
+
canvas_native_webgl2_sampler_parameteri(
|
|
2083
|
+
sampler->GetSampler(),
|
|
2084
|
+
pname,
|
|
2085
|
+
param,
|
|
2086
|
+
ptr->GetState());
|
|
2173
2087
|
}
|
|
2174
|
-
|
|
2175
2088
|
}
|
|
2176
2089
|
|
|
2177
2090
|
}
|
|
@@ -2189,23 +2102,23 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2189
2102
|
|
|
2190
2103
|
|
|
2191
2104
|
if (count == 10) {
|
|
2192
|
-
auto target =
|
|
2105
|
+
auto target = args[0]->Int32Value(
|
|
2193
2106
|
context).ToChecked();
|
|
2194
|
-
auto level =
|
|
2107
|
+
auto level = args[1]->Int32Value(
|
|
2195
2108
|
context).ToChecked();
|
|
2196
|
-
auto internalformat =
|
|
2109
|
+
auto internalformat = args[2]->Int32Value(
|
|
2197
2110
|
context).ToChecked();
|
|
2198
|
-
auto width =
|
|
2111
|
+
auto width = args[3]->Int32Value(
|
|
2199
2112
|
context).ToChecked();
|
|
2200
|
-
auto height =
|
|
2113
|
+
auto height = args[4]->Int32Value(
|
|
2201
2114
|
context).ToChecked();
|
|
2202
|
-
auto depth =
|
|
2115
|
+
auto depth = args[5]->Int32Value(
|
|
2203
2116
|
context).ToChecked();
|
|
2204
|
-
auto border =
|
|
2117
|
+
auto border = args[6]->Int32Value(
|
|
2205
2118
|
context).ToChecked();
|
|
2206
|
-
auto format =
|
|
2119
|
+
auto format = args[7]->Int32Value(
|
|
2207
2120
|
context).ToChecked();
|
|
2208
|
-
auto type =
|
|
2121
|
+
auto type = args[8]->Uint32Value(
|
|
2209
2122
|
context).ToChecked();
|
|
2210
2123
|
|
|
2211
2124
|
auto imageOrPixelsOrOffset = args[9];
|
|
@@ -2236,8 +2149,8 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2236
2149
|
auto array = buf->Buffer();
|
|
2237
2150
|
auto offset = buf->ByteOffset();
|
|
2238
2151
|
auto size = buf->ByteLength();
|
|
2239
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
2240
|
-
auto data = static_cast<uint8_t *>((void*) data_ptr);
|
|
2152
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2153
|
+
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
2241
2154
|
|
|
2242
2155
|
|
|
2243
2156
|
canvas_native_webgl2_tex_image3d(
|
|
@@ -2309,23 +2222,23 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2309
2222
|
}
|
|
2310
2223
|
} else if (args.Length() > 10) {
|
|
2311
2224
|
|
|
2312
|
-
auto target =
|
|
2225
|
+
auto target = args[0]->Int32Value(
|
|
2313
2226
|
context).ToChecked();
|
|
2314
|
-
auto level =
|
|
2227
|
+
auto level = args[1]->Int32Value(
|
|
2315
2228
|
context).ToChecked();
|
|
2316
|
-
auto internalformat =
|
|
2229
|
+
auto internalformat = args[2]->Int32Value(
|
|
2317
2230
|
context).ToChecked();
|
|
2318
|
-
auto width =
|
|
2231
|
+
auto width = args[3]->Int32Value(
|
|
2319
2232
|
context).ToChecked();
|
|
2320
|
-
auto height =
|
|
2233
|
+
auto height = args[4]->Int32Value(
|
|
2321
2234
|
context).ToChecked();
|
|
2322
|
-
auto depth =
|
|
2235
|
+
auto depth = args[5]->Int32Value(
|
|
2323
2236
|
context).ToChecked();
|
|
2324
|
-
auto border =
|
|
2237
|
+
auto border = args[6]->Int32Value(
|
|
2325
2238
|
context).ToChecked();
|
|
2326
|
-
auto format =
|
|
2239
|
+
auto format = args[7]->Int32Value(
|
|
2327
2240
|
context).ToChecked();
|
|
2328
|
-
auto type =
|
|
2241
|
+
auto type = args[8]->Uint32Value(
|
|
2329
2242
|
context).ToChecked();
|
|
2330
2243
|
|
|
2331
2244
|
auto imageOrPixelsOrOffset = args[9];
|
|
@@ -2342,8 +2255,8 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2342
2255
|
auto array = buf->Buffer();
|
|
2343
2256
|
auto offset = buf->ByteOffset();
|
|
2344
2257
|
auto size = buf->ByteLength();
|
|
2345
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
2346
|
-
auto data = static_cast<uint8_t *>((void*) data_ptr);
|
|
2258
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2259
|
+
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
2347
2260
|
|
|
2348
2261
|
srcOffsetValue =
|
|
2349
2262
|
srcOffsetValue * size;
|
|
@@ -2381,26 +2294,24 @@ void WebGL2RenderingContext::TexStorage2D(const v8::FunctionCallbackInfo<v8::Val
|
|
|
2381
2294
|
auto isolate = args.GetIsolate();
|
|
2382
2295
|
auto context = isolate->GetCurrentContext();
|
|
2383
2296
|
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
);
|
|
2403
|
-
}
|
|
2297
|
+
auto target = args[0]->Uint32Value(
|
|
2298
|
+
context).ToChecked();
|
|
2299
|
+
auto levels = args[1]->Int32Value(
|
|
2300
|
+
context).ToChecked();
|
|
2301
|
+
auto internalFormat = args[2]->Uint32Value(
|
|
2302
|
+
context).ToChecked();
|
|
2303
|
+
auto width = args[3]->Int32Value(
|
|
2304
|
+
context).ToChecked();
|
|
2305
|
+
auto height = args[4]->Int32Value(
|
|
2306
|
+
context).ToChecked();
|
|
2307
|
+
canvas_native_webgl2_tex_storage2d(
|
|
2308
|
+
target,
|
|
2309
|
+
levels,
|
|
2310
|
+
internalFormat,
|
|
2311
|
+
width,
|
|
2312
|
+
height,
|
|
2313
|
+
ptr->GetState()
|
|
2314
|
+
);
|
|
2404
2315
|
}
|
|
2405
2316
|
|
|
2406
2317
|
void WebGL2RenderingContext::TexStorage3D(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -2412,29 +2323,27 @@ void WebGL2RenderingContext::TexStorage3D(const v8::FunctionCallbackInfo<v8::Val
|
|
|
2412
2323
|
auto isolate = args.GetIsolate();
|
|
2413
2324
|
auto context = isolate->GetCurrentContext();
|
|
2414
2325
|
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
);
|
|
2437
|
-
}
|
|
2326
|
+
auto target = args[0]->Uint32Value(
|
|
2327
|
+
context).ToChecked();
|
|
2328
|
+
auto levels = args[1]->Int32Value(
|
|
2329
|
+
context).ToChecked();
|
|
2330
|
+
auto internalFormat = args[2]->Uint32Value(
|
|
2331
|
+
context).ToChecked();
|
|
2332
|
+
auto width = args[3]->Int32Value(
|
|
2333
|
+
context).ToChecked();
|
|
2334
|
+
auto height = args[4]->Int32Value(
|
|
2335
|
+
context).ToChecked();
|
|
2336
|
+
auto depth = args[5]->Int32Value(
|
|
2337
|
+
context).ToChecked();
|
|
2338
|
+
canvas_native_webgl2_tex_storage3d(
|
|
2339
|
+
target,
|
|
2340
|
+
levels,
|
|
2341
|
+
internalFormat,
|
|
2342
|
+
width,
|
|
2343
|
+
height,
|
|
2344
|
+
depth,
|
|
2345
|
+
ptr->GetState()
|
|
2346
|
+
);
|
|
2438
2347
|
}
|
|
2439
2348
|
|
|
2440
2349
|
void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -2448,25 +2357,25 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfo<v8::Va
|
|
|
2448
2357
|
|
|
2449
2358
|
auto count = args.Length();
|
|
2450
2359
|
if (count == 11) {
|
|
2451
|
-
auto target =
|
|
2360
|
+
auto target = args[0]->Uint32Value(
|
|
2452
2361
|
context).ToChecked();
|
|
2453
|
-
auto level =
|
|
2362
|
+
auto level = args[1]->Int32Value(
|
|
2454
2363
|
context).ToChecked();
|
|
2455
|
-
auto xoffset =
|
|
2364
|
+
auto xoffset = args[2]->Int32Value(
|
|
2456
2365
|
context).ToChecked();
|
|
2457
|
-
auto yoffset =
|
|
2366
|
+
auto yoffset = args[3]->Int32Value(
|
|
2458
2367
|
context).ToChecked();
|
|
2459
|
-
auto zoffset =
|
|
2368
|
+
auto zoffset = args[4]->Int32Value(
|
|
2460
2369
|
context).ToChecked();
|
|
2461
|
-
auto width =
|
|
2370
|
+
auto width = args[5]->Int32Value(
|
|
2462
2371
|
context).ToChecked();
|
|
2463
|
-
auto height =
|
|
2372
|
+
auto height = args[6]->Int32Value(
|
|
2464
2373
|
context).ToChecked();
|
|
2465
|
-
auto depth =
|
|
2374
|
+
auto depth = args[7]->Int32Value(
|
|
2466
2375
|
context).ToChecked();
|
|
2467
|
-
auto format =
|
|
2376
|
+
auto format = args[8]->Uint32Value(
|
|
2468
2377
|
context).ToChecked();
|
|
2469
|
-
auto type =
|
|
2378
|
+
auto type = args[9]->Uint32Value(
|
|
2470
2379
|
context).ToChecked();
|
|
2471
2380
|
|
|
2472
2381
|
if (args[10]->IsNumber()) {
|
|
@@ -2497,9 +2406,8 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfo<v8::Va
|
|
|
2497
2406
|
auto array = buf->Buffer();
|
|
2498
2407
|
auto offset = buf->ByteOffset();
|
|
2499
2408
|
auto size = buf->ByteLength();
|
|
2500
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
2501
|
-
auto data = static_cast<uint8_t *>((void*) data_ptr);
|
|
2502
|
-
|
|
2409
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2410
|
+
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
2503
2411
|
|
|
2504
2412
|
|
|
2505
2413
|
canvas_native_webgl2_tex_sub_image3d(
|
|
@@ -2545,25 +2453,25 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfo<v8::Va
|
|
|
2545
2453
|
}
|
|
2546
2454
|
|
|
2547
2455
|
} else if (count > 11) {
|
|
2548
|
-
auto target =
|
|
2456
|
+
auto target = args[0]->Uint32Value(
|
|
2549
2457
|
context).ToChecked();
|
|
2550
|
-
auto level =
|
|
2458
|
+
auto level = args[1]->Int32Value(
|
|
2551
2459
|
context).ToChecked();
|
|
2552
|
-
auto xoffset =
|
|
2460
|
+
auto xoffset = args[2]->Int32Value(
|
|
2553
2461
|
context).ToChecked();
|
|
2554
|
-
auto yoffset =
|
|
2462
|
+
auto yoffset = args[3]->Int32Value(
|
|
2555
2463
|
context).ToChecked();
|
|
2556
|
-
auto zoffset =
|
|
2464
|
+
auto zoffset = args[4]->Int32Value(
|
|
2557
2465
|
context).ToChecked();
|
|
2558
|
-
auto width =
|
|
2466
|
+
auto width = args[5]->Int32Value(
|
|
2559
2467
|
context).ToChecked();
|
|
2560
|
-
auto height =
|
|
2468
|
+
auto height = args[6]->Int32Value(
|
|
2561
2469
|
context).ToChecked();
|
|
2562
|
-
auto depth =
|
|
2470
|
+
auto depth = args[7]->Int32Value(
|
|
2563
2471
|
context).ToChecked();
|
|
2564
|
-
auto format =
|
|
2472
|
+
auto format = args[8]->Uint32Value(
|
|
2565
2473
|
context).ToChecked();
|
|
2566
|
-
auto type =
|
|
2474
|
+
auto type = args[9]->Uint32Value(
|
|
2567
2475
|
context).ToChecked();
|
|
2568
2476
|
|
|
2569
2477
|
size_t srcOffsetValue = 0;
|
|
@@ -2582,8 +2490,8 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfo<v8::Va
|
|
|
2582
2490
|
auto array = buf->Buffer();
|
|
2583
2491
|
auto offset = buf->ByteOffset();
|
|
2584
2492
|
auto size = buf->ByteLength();
|
|
2585
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
2586
|
-
auto data = static_cast<uint8_t *>((void*) data_ptr);
|
|
2493
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2494
|
+
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
2587
2495
|
|
|
2588
2496
|
|
|
2589
2497
|
srcOffsetValue =
|
|
@@ -2624,10 +2532,10 @@ WebGL2RenderingContext::TransformFeedbackVaryings(const v8::FunctionCallbackInfo
|
|
|
2624
2532
|
|
|
2625
2533
|
auto programValue = args[0];
|
|
2626
2534
|
auto type = GetNativeType(isolate, programValue);
|
|
2627
|
-
if (
|
|
2535
|
+
if (type == NativeType::WebGLProgram) {
|
|
2628
2536
|
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
2629
2537
|
auto varyingsObject = args[1];
|
|
2630
|
-
auto bufferMode =
|
|
2538
|
+
auto bufferMode = args[2]->Uint32Value(
|
|
2631
2539
|
context).ToChecked();
|
|
2632
2540
|
|
|
2633
2541
|
if (program != nullptr &&
|
|
@@ -2647,10 +2555,10 @@ WebGL2RenderingContext::TransformFeedbackVaryings(const v8::FunctionCallbackInfo
|
|
|
2647
2555
|
}
|
|
2648
2556
|
|
|
2649
2557
|
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2558
|
+
const char *cStrings[store.size()];
|
|
2559
|
+
for (size_t i = 0; i < store.size(); ++i) {
|
|
2560
|
+
cStrings[i] = store[i].c_str();
|
|
2561
|
+
}
|
|
2654
2562
|
|
|
2655
2563
|
canvas_native_webgl2_transform_feedback_varyings(
|
|
2656
2564
|
program->GetProgram(),
|
|
@@ -2675,11 +2583,11 @@ void WebGL2RenderingContext::Uniform1ui(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2675
2583
|
auto locationValue = args[0];
|
|
2676
2584
|
auto type = GetNativeType(isolate, locationValue);
|
|
2677
2585
|
|
|
2678
|
-
|
|
2679
|
-
|
|
2586
|
+
auto v0Value = args[1];
|
|
2587
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2680
2588
|
|
|
2681
2589
|
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2682
|
-
auto v0 =
|
|
2590
|
+
auto v0 = v0Value->Uint32Value(
|
|
2683
2591
|
context).ToChecked();
|
|
2684
2592
|
|
|
2685
2593
|
if (location != nullptr) {
|
|
@@ -2705,13 +2613,12 @@ void WebGL2RenderingContext::Uniform2ui(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2705
2613
|
auto locationValue = args[0];
|
|
2706
2614
|
auto type = GetNativeType(isolate, locationValue);
|
|
2707
2615
|
|
|
2708
|
-
if (
|
|
2709
|
-
args[1]->IsNumber() && type == NativeType::WebGLUniformLocation) {
|
|
2616
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2710
2617
|
|
|
2711
2618
|
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2712
|
-
auto v0 =
|
|
2619
|
+
auto v0 = args[1]->Uint32Value(
|
|
2713
2620
|
context).ToChecked();
|
|
2714
|
-
auto v1 =
|
|
2621
|
+
auto v1 = args[2]->Uint32Value(
|
|
2715
2622
|
context).ToChecked();
|
|
2716
2623
|
|
|
2717
2624
|
if (location != nullptr) {
|
|
@@ -2738,17 +2645,16 @@ void WebGL2RenderingContext::Uniform3ui(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2738
2645
|
auto locationValue = args[0];
|
|
2739
2646
|
auto type = GetNativeType(isolate, locationValue);
|
|
2740
2647
|
|
|
2741
|
-
if (
|
|
2742
|
-
args[1]->IsNumber() && type == NativeType::WebGLUniformLocation) {
|
|
2648
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2743
2649
|
|
|
2744
2650
|
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2745
|
-
auto v0 =
|
|
2651
|
+
auto v0 = args[1]->Uint32Value(
|
|
2746
2652
|
context).ToChecked();
|
|
2747
2653
|
|
|
2748
|
-
auto v1 =
|
|
2654
|
+
auto v1 = args[2]->Uint32Value(
|
|
2749
2655
|
context).ToChecked();
|
|
2750
2656
|
|
|
2751
|
-
auto v2 =
|
|
2657
|
+
auto v2 = args[3]->Uint32Value(
|
|
2752
2658
|
context).ToChecked();
|
|
2753
2659
|
|
|
2754
2660
|
if (location != nullptr) {
|
|
@@ -2776,19 +2682,18 @@ void WebGL2RenderingContext::Uniform4ui(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2776
2682
|
auto locationValue = args[0];
|
|
2777
2683
|
auto type = GetNativeType(isolate, locationValue);
|
|
2778
2684
|
|
|
2779
|
-
if (
|
|
2780
|
-
args[1]->IsNumber() && type == NativeType::WebGLUniformLocation) {
|
|
2685
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2781
2686
|
|
|
2782
2687
|
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2783
|
-
auto v0 =
|
|
2688
|
+
auto v0 = args[1]->Uint32Value(
|
|
2784
2689
|
context).ToChecked();
|
|
2785
2690
|
|
|
2786
|
-
auto v1 =
|
|
2691
|
+
auto v1 = args[2]->Uint32Value(
|
|
2787
2692
|
context).ToChecked();
|
|
2788
2693
|
|
|
2789
|
-
auto v2 =
|
|
2694
|
+
auto v2 = args[3]->Uint32Value(
|
|
2790
2695
|
context).ToChecked();
|
|
2791
|
-
auto v3 =
|
|
2696
|
+
auto v3 = args[4]->Uint32Value(
|
|
2792
2697
|
context).ToChecked();
|
|
2793
2698
|
|
|
2794
2699
|
|
|
@@ -2820,18 +2725,17 @@ void WebGL2RenderingContext::Uniform1uiv(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2820
2725
|
auto type = GetNativeType(isolate, locationValue);
|
|
2821
2726
|
|
|
2822
2727
|
|
|
2823
|
-
if (
|
|
2824
|
-
args[1]->IsObject() && type == NativeType::WebGLUniformLocation) {
|
|
2728
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2825
2729
|
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2826
|
-
auto
|
|
2730
|
+
auto dataValue = args[1];
|
|
2827
2731
|
if (location != nullptr &&
|
|
2828
|
-
|
|
2829
|
-
auto buf =
|
|
2732
|
+
dataValue->IsUint32Array()) {
|
|
2733
|
+
auto buf = dataValue.As<v8::Uint32Array>();
|
|
2830
2734
|
auto array = buf->Buffer();
|
|
2831
2735
|
auto offset = buf->ByteOffset();
|
|
2832
2736
|
auto size = buf->Length();
|
|
2833
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
2834
|
-
auto data = static_cast<uint32_t *>((void*) data_ptr);
|
|
2737
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2738
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
2835
2739
|
|
|
2836
2740
|
|
|
2837
2741
|
canvas_native_webgl2_uniform1uiv(
|
|
@@ -2841,13 +2745,13 @@ void WebGL2RenderingContext::Uniform1uiv(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2841
2745
|
);
|
|
2842
2746
|
} else {
|
|
2843
2747
|
std::vector<uint32_t> buf;
|
|
2844
|
-
auto array =
|
|
2748
|
+
auto array = dataValue.As<v8::Array>();
|
|
2845
2749
|
auto len = array->Length();
|
|
2846
2750
|
buf.reserve(len);
|
|
2847
2751
|
for (int i = 0; i < len; i++) {
|
|
2848
|
-
auto item =
|
|
2752
|
+
auto item = array->Get(
|
|
2849
2753
|
context,
|
|
2850
|
-
i).ToLocalChecked()->
|
|
2754
|
+
i).ToLocalChecked()->Uint32Value(
|
|
2851
2755
|
context).ToChecked();
|
|
2852
2756
|
buf.push_back(item);
|
|
2853
2757
|
}
|
|
@@ -2878,19 +2782,17 @@ void WebGL2RenderingContext::Uniform2uiv(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2878
2782
|
auto type = GetNativeType(isolate, locationValue);
|
|
2879
2783
|
|
|
2880
2784
|
|
|
2881
|
-
if (
|
|
2882
|
-
args[1]->IsObject() && type == NativeType::WebGLUniformLocation) {
|
|
2785
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2883
2786
|
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2884
|
-
auto
|
|
2787
|
+
auto dataValue = args[1];
|
|
2885
2788
|
if (location != nullptr &&
|
|
2886
|
-
|
|
2887
|
-
auto buf =
|
|
2789
|
+
dataValue->IsUint32Array()) {
|
|
2790
|
+
auto buf = dataValue.As<v8::Uint32Array>();
|
|
2888
2791
|
auto array = buf->Buffer();
|
|
2889
2792
|
auto offset = buf->ByteOffset();
|
|
2890
2793
|
auto size = buf->Length();
|
|
2891
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
2892
|
-
auto data = static_cast<uint32_t *>((void*) data_ptr);
|
|
2893
|
-
|
|
2794
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2795
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
2894
2796
|
|
|
2895
2797
|
|
|
2896
2798
|
canvas_native_webgl2_uniform2uiv(
|
|
@@ -2900,13 +2802,13 @@ void WebGL2RenderingContext::Uniform2uiv(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2900
2802
|
);
|
|
2901
2803
|
} else {
|
|
2902
2804
|
std::vector<uint32_t> buf;
|
|
2903
|
-
auto array =
|
|
2805
|
+
auto array = dataValue.As<v8::Array>();
|
|
2904
2806
|
auto len = array->Length();
|
|
2905
2807
|
buf.reserve(len);
|
|
2906
2808
|
for (int i = 0; i < len; i++) {
|
|
2907
|
-
auto item =
|
|
2809
|
+
auto item = array->Get(
|
|
2908
2810
|
context,
|
|
2909
|
-
i).ToLocalChecked()->
|
|
2811
|
+
i).ToLocalChecked()->Uint32Value(
|
|
2910
2812
|
context).ToChecked();
|
|
2911
2813
|
buf.push_back(item);
|
|
2912
2814
|
}
|
|
@@ -2936,19 +2838,18 @@ void WebGL2RenderingContext::Uniform3uiv(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2936
2838
|
auto type = GetNativeType(isolate, locationValue);
|
|
2937
2839
|
|
|
2938
2840
|
|
|
2939
|
-
if (
|
|
2940
|
-
args[1]->IsObject() && type == NativeType::WebGLUniformLocation) {
|
|
2841
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2941
2842
|
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2942
|
-
auto
|
|
2843
|
+
auto dataValue = args[1];
|
|
2943
2844
|
if (location != nullptr &&
|
|
2944
|
-
|
|
2945
|
-
auto buf =
|
|
2845
|
+
dataValue->IsUint32Array()) {
|
|
2846
|
+
auto buf = dataValue.As<v8::Uint32Array>();
|
|
2946
2847
|
|
|
2947
2848
|
auto array = buf->Buffer();
|
|
2948
2849
|
auto offset = buf->ByteOffset();
|
|
2949
2850
|
auto size = buf->Length();
|
|
2950
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
2951
|
-
auto data = static_cast<uint32_t *>((void*) data_ptr);
|
|
2851
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2852
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
2952
2853
|
|
|
2953
2854
|
|
|
2954
2855
|
canvas_native_webgl2_uniform3uiv(
|
|
@@ -2958,13 +2859,13 @@ void WebGL2RenderingContext::Uniform3uiv(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2958
2859
|
);
|
|
2959
2860
|
} else {
|
|
2960
2861
|
std::vector<uint32_t> buf;
|
|
2961
|
-
auto array =
|
|
2862
|
+
auto array = dataValue.As<v8::Array>();
|
|
2962
2863
|
auto len = array->Length();
|
|
2963
2864
|
buf.reserve(len);
|
|
2964
2865
|
for (int i = 0; i < len; i++) {
|
|
2965
|
-
auto item =
|
|
2866
|
+
auto item = array->Get(
|
|
2966
2867
|
context,
|
|
2967
|
-
i).ToLocalChecked()->
|
|
2868
|
+
i).ToLocalChecked()->Uint32Value(
|
|
2968
2869
|
context).ToChecked();
|
|
2969
2870
|
buf.push_back(item);
|
|
2970
2871
|
}
|
|
@@ -2994,19 +2895,18 @@ void WebGL2RenderingContext::Uniform4uiv(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2994
2895
|
auto type = GetNativeType(isolate, locationValue);
|
|
2995
2896
|
|
|
2996
2897
|
|
|
2997
|
-
if (
|
|
2998
|
-
args[1]->IsObject() && type == NativeType::WebGLUniformLocation) {
|
|
2898
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2999
2899
|
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3000
|
-
auto
|
|
2900
|
+
auto dataValue = args[1];
|
|
3001
2901
|
if (location != nullptr &&
|
|
3002
|
-
|
|
3003
|
-
auto buf =
|
|
2902
|
+
dataValue->IsUint32Array()) {
|
|
2903
|
+
auto buf = dataValue.As<v8::Uint32Array>();
|
|
3004
2904
|
|
|
3005
2905
|
auto array = buf->Buffer();
|
|
3006
2906
|
auto offset = buf->ByteOffset();
|
|
3007
2907
|
auto size = buf->Length();
|
|
3008
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
3009
|
-
auto data = static_cast<uint32_t *>((void*) data_ptr);
|
|
2908
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2909
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
3010
2910
|
|
|
3011
2911
|
|
|
3012
2912
|
canvas_native_webgl2_uniform4uiv(
|
|
@@ -3016,13 +2916,13 @@ void WebGL2RenderingContext::Uniform4uiv(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
3016
2916
|
);
|
|
3017
2917
|
} else {
|
|
3018
2918
|
std::vector<uint32_t> buf;
|
|
3019
|
-
auto array =
|
|
2919
|
+
auto array = dataValue.As<v8::Array>();
|
|
3020
2920
|
auto len = array->Length();
|
|
3021
2921
|
buf.reserve(len);
|
|
3022
2922
|
for (int i = 0; i < len; i++) {
|
|
3023
|
-
auto item =
|
|
2923
|
+
auto item = array->Get(
|
|
3024
2924
|
context,
|
|
3025
|
-
i).ToLocalChecked()->
|
|
2925
|
+
i).ToLocalChecked()->Uint32Value(
|
|
3026
2926
|
context).ToChecked();
|
|
3027
2927
|
buf.push_back(item);
|
|
3028
2928
|
}
|
|
@@ -3050,19 +2950,19 @@ void WebGL2RenderingContext::UniformBlockBinding(const v8::FunctionCallbackInfo<
|
|
|
3050
2950
|
|
|
3051
2951
|
auto programValue = args[0];
|
|
3052
2952
|
auto type = GetNativeType(isolate, programValue);
|
|
3053
|
-
if (
|
|
2953
|
+
if (type == NativeType::WebGLProgram) {
|
|
3054
2954
|
|
|
3055
2955
|
auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
|
|
3056
|
-
auto uniformBlockIndex = args[1]->
|
|
2956
|
+
auto uniformBlockIndex = args[1]->Uint32Value(
|
|
3057
2957
|
context).ToChecked();
|
|
3058
|
-
auto uniformBlockBinding = args[2]->
|
|
2958
|
+
auto uniformBlockBinding = args[2]->Uint32Value(
|
|
3059
2959
|
context).ToChecked();
|
|
3060
2960
|
|
|
3061
2961
|
if (program != nullptr) {
|
|
3062
2962
|
canvas_native_webgl2_uniform_block_binding(
|
|
3063
2963
|
program->GetProgram(),
|
|
3064
|
-
|
|
3065
|
-
|
|
2964
|
+
uniformBlockIndex,
|
|
2965
|
+
uniformBlockBinding,
|
|
3066
2966
|
ptr->GetState()
|
|
3067
2967
|
);
|
|
3068
2968
|
}
|
|
@@ -3081,57 +2981,48 @@ void WebGL2RenderingContext::UniformMatrix2x3fv(const v8::FunctionCallbackInfo<v
|
|
|
3081
2981
|
auto context = isolate->GetCurrentContext();
|
|
3082
2982
|
|
|
3083
2983
|
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
auto
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
auto transpose = args[1]->BooleanValue(isolate);
|
|
3091
|
-
auto data = args[2];
|
|
2984
|
+
auto locationValue = args[0];
|
|
2985
|
+
auto type = GetNativeType(isolate, locationValue);
|
|
2986
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
2987
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2988
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
2989
|
+
auto dataValue = args[2];
|
|
3092
2990
|
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
2991
|
+
if (dataValue->IsFloat32Array()) {
|
|
2992
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
2993
|
+
auto array = buf->Buffer();
|
|
2994
|
+
auto offset = buf->ByteOffset();
|
|
2995
|
+
auto size = buf->Length();
|
|
2996
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2997
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3100
2998
|
|
|
3101
2999
|
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
} else {
|
|
3120
|
-
buf.push_back(
|
|
3121
|
-
std::nanf(""));
|
|
3122
|
-
}
|
|
3123
|
-
}
|
|
3000
|
+
canvas_native_webgl2_uniform_matrix2x3fv(
|
|
3001
|
+
location->GetUniformLocation(),
|
|
3002
|
+
transpose,
|
|
3003
|
+
data, size,
|
|
3004
|
+
ptr->GetState()
|
|
3005
|
+
);
|
|
3006
|
+
} else if (dataValue->IsArray()) {
|
|
3007
|
+
std::vector<float> buf;
|
|
3008
|
+
auto array = dataValue.As<v8::Array>();
|
|
3009
|
+
auto len = array->Length();
|
|
3010
|
+
for (int i = 0; i < len; i++) {
|
|
3011
|
+
auto item = array->Get(
|
|
3012
|
+
context, i).ToLocalChecked();
|
|
3013
|
+
buf.push_back(
|
|
3014
|
+
static_cast<float>(item->NumberValue(
|
|
3015
|
+
context).ToChecked()));
|
|
3016
|
+
}
|
|
3124
3017
|
|
|
3125
3018
|
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
}
|
|
3019
|
+
canvas_native_webgl2_uniform_matrix2x3fv(
|
|
3020
|
+
location->GetUniformLocation(),
|
|
3021
|
+
transpose,
|
|
3022
|
+
buf.data(), buf.size(),
|
|
3023
|
+
ptr->GetState()
|
|
3024
|
+
);
|
|
3133
3025
|
}
|
|
3134
|
-
|
|
3135
3026
|
}
|
|
3136
3027
|
|
|
3137
3028
|
}
|
|
@@ -3146,59 +3037,49 @@ void WebGL2RenderingContext::UniformMatrix2x4fv(const v8::FunctionCallbackInfo<v
|
|
|
3146
3037
|
auto context = isolate->GetCurrentContext();
|
|
3147
3038
|
|
|
3148
3039
|
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
auto
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
auto transpose = args[1]->BooleanValue(isolate);
|
|
3156
|
-
auto data = args[2];
|
|
3157
|
-
|
|
3158
|
-
if (data->IsFloat32Array()) {
|
|
3159
|
-
auto buf = data.As<v8::Float32Array>();
|
|
3040
|
+
auto locationValue = args[0];
|
|
3041
|
+
auto type = GetNativeType(isolate, locationValue);
|
|
3042
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3043
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3044
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
3045
|
+
auto dataValue = args[2];
|
|
3160
3046
|
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
auto size = buf->Length();
|
|
3164
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
3165
|
-
auto data = static_cast<float *>((void*) data_ptr);
|
|
3047
|
+
if (dataValue->IsFloat32Array()) {
|
|
3048
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
3166
3049
|
|
|
3050
|
+
auto array = buf->Buffer();
|
|
3051
|
+
auto offset = buf->ByteOffset();
|
|
3052
|
+
auto size = buf->Length();
|
|
3053
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3054
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3167
3055
|
|
|
3168
|
-
canvas_native_webgl2_uniform_matrix2x4fv(
|
|
3169
|
-
location->GetUniformLocation(),
|
|
3170
|
-
transpose,
|
|
3171
|
-
data, size,
|
|
3172
|
-
ptr->GetState()
|
|
3173
|
-
);
|
|
3174
|
-
} else if (data->IsArray()) {
|
|
3175
|
-
std::vector<float> buf;
|
|
3176
|
-
auto array = data.As<v8::Array>();
|
|
3177
|
-
auto len = array->Length();
|
|
3178
|
-
for (int i = 0; i < len; i++) {
|
|
3179
|
-
auto item = array->Get(
|
|
3180
|
-
context, i).ToLocalChecked();
|
|
3181
|
-
if (item->IsNumber()) {
|
|
3182
|
-
buf.push_back(
|
|
3183
|
-
static_cast<float>(item->NumberValue(
|
|
3184
|
-
context).ToChecked()));
|
|
3185
|
-
} else {
|
|
3186
|
-
buf.push_back(
|
|
3187
|
-
std::nanf(""));
|
|
3188
|
-
}
|
|
3189
|
-
}
|
|
3190
3056
|
|
|
3057
|
+
canvas_native_webgl2_uniform_matrix2x4fv(
|
|
3058
|
+
location->GetUniformLocation(),
|
|
3059
|
+
transpose,
|
|
3060
|
+
data, size,
|
|
3061
|
+
ptr->GetState()
|
|
3062
|
+
);
|
|
3063
|
+
} else if (dataValue->IsArray()) {
|
|
3064
|
+
std::vector<float> buf;
|
|
3065
|
+
auto array = dataValue.As<v8::Array>();
|
|
3066
|
+
auto len = array->Length();
|
|
3067
|
+
for (int i = 0; i < len; i++) {
|
|
3068
|
+
auto item = array->Get(
|
|
3069
|
+
context, i).ToLocalChecked();
|
|
3070
|
+
buf.push_back(
|
|
3071
|
+
static_cast<float>(item->NumberValue(
|
|
3072
|
+
context).ToChecked()));
|
|
3073
|
+
}
|
|
3191
3074
|
|
|
3192
3075
|
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
}
|
|
3076
|
+
canvas_native_webgl2_uniform_matrix2x4fv(
|
|
3077
|
+
location->GetUniformLocation(),
|
|
3078
|
+
transpose,
|
|
3079
|
+
buf.data(), buf.size(),
|
|
3080
|
+
ptr->GetState()
|
|
3081
|
+
);
|
|
3200
3082
|
}
|
|
3201
|
-
|
|
3202
3083
|
}
|
|
3203
3084
|
|
|
3204
3085
|
}
|
|
@@ -3213,60 +3094,50 @@ void WebGL2RenderingContext::UniformMatrix3x2fv(const v8::FunctionCallbackInfo<v
|
|
|
3213
3094
|
auto context = isolate->GetCurrentContext();
|
|
3214
3095
|
|
|
3215
3096
|
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
auto
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
auto transpose = args[1]->BooleanValue(isolate);
|
|
3223
|
-
auto data = args[2];
|
|
3224
|
-
|
|
3225
|
-
if (data->IsFloat32Array()) {
|
|
3226
|
-
auto buf = data.As<v8::Float32Array>();
|
|
3097
|
+
auto locationValue = args[0];
|
|
3098
|
+
auto type = GetNativeType(isolate, locationValue);
|
|
3099
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3100
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3101
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
3102
|
+
auto dataValue = args[2];
|
|
3227
3103
|
|
|
3104
|
+
if (dataValue->IsFloat32Array()) {
|
|
3105
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
3228
3106
|
|
|
3229
|
-
auto array = buf->Buffer();
|
|
3230
|
-
auto offset = buf->ByteOffset();
|
|
3231
|
-
auto size = buf->Length();
|
|
3232
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
3233
|
-
auto data = static_cast<float *>((void*) data_ptr);
|
|
3234
3107
|
|
|
3108
|
+
auto array = buf->Buffer();
|
|
3109
|
+
auto offset = buf->ByteOffset();
|
|
3110
|
+
auto size = buf->Length();
|
|
3111
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3112
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3235
3113
|
|
|
3236
|
-
canvas_native_webgl2_uniform_matrix3x2fv(
|
|
3237
|
-
location->GetUniformLocation(),
|
|
3238
|
-
transpose,
|
|
3239
|
-
data, size,
|
|
3240
|
-
ptr->GetState()
|
|
3241
|
-
);
|
|
3242
|
-
} else if (data->IsArray()) {
|
|
3243
|
-
std::vector<float> buf;
|
|
3244
|
-
auto array = data.As<v8::Array>();
|
|
3245
|
-
auto len = array->Length();
|
|
3246
|
-
for (int i = 0; i < len; i++) {
|
|
3247
|
-
auto item = array->Get(
|
|
3248
|
-
context, i).ToLocalChecked();
|
|
3249
|
-
if (item->IsNumber()) {
|
|
3250
|
-
buf.push_back(
|
|
3251
|
-
static_cast<float>(item->NumberValue(
|
|
3252
|
-
context).ToChecked()));
|
|
3253
|
-
} else {
|
|
3254
|
-
buf.push_back(
|
|
3255
|
-
std::nanf(""));
|
|
3256
|
-
}
|
|
3257
|
-
}
|
|
3258
3114
|
|
|
3115
|
+
canvas_native_webgl2_uniform_matrix3x2fv(
|
|
3116
|
+
location->GetUniformLocation(),
|
|
3117
|
+
transpose,
|
|
3118
|
+
data, size,
|
|
3119
|
+
ptr->GetState()
|
|
3120
|
+
);
|
|
3121
|
+
} else if (dataValue->IsArray()) {
|
|
3122
|
+
std::vector<float> buf;
|
|
3123
|
+
auto array = dataValue.As<v8::Array>();
|
|
3124
|
+
auto len = array->Length();
|
|
3125
|
+
for (int i = 0; i < len; i++) {
|
|
3126
|
+
auto item = array->Get(
|
|
3127
|
+
context, i).ToLocalChecked();
|
|
3128
|
+
buf.push_back(
|
|
3129
|
+
static_cast<float>(item->NumberValue(
|
|
3130
|
+
context).ToChecked()));
|
|
3131
|
+
}
|
|
3259
3132
|
|
|
3260
3133
|
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
}
|
|
3134
|
+
canvas_native_webgl2_uniform_matrix3x2fv(
|
|
3135
|
+
location->GetUniformLocation(),
|
|
3136
|
+
transpose,
|
|
3137
|
+
buf.data(), buf.size(),
|
|
3138
|
+
ptr->GetState()
|
|
3139
|
+
);
|
|
3268
3140
|
}
|
|
3269
|
-
|
|
3270
3141
|
}
|
|
3271
3142
|
|
|
3272
3143
|
}
|
|
@@ -3281,58 +3152,48 @@ void WebGL2RenderingContext::UniformMatrix3x4fv(const v8::FunctionCallbackInfo<v
|
|
|
3281
3152
|
auto context = isolate->GetCurrentContext();
|
|
3282
3153
|
|
|
3283
3154
|
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
auto
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
auto transpose = args[1]->BooleanValue(isolate);
|
|
3291
|
-
auto data = args[2];
|
|
3155
|
+
auto locationValue = args[0];
|
|
3156
|
+
auto type = GetNativeType(isolate, locationValue);
|
|
3157
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3158
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3159
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
3160
|
+
auto dataValue = args[2];
|
|
3292
3161
|
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3162
|
+
if (dataValue->IsFloat32Array()) {
|
|
3163
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
3164
|
+
auto array = buf->Buffer();
|
|
3165
|
+
auto offset = buf->ByteOffset();
|
|
3166
|
+
auto size = buf->Length();
|
|
3167
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3168
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3300
3169
|
|
|
3301
3170
|
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
} else {
|
|
3320
|
-
buf.push_back(
|
|
3321
|
-
std::nanf(""));
|
|
3322
|
-
}
|
|
3323
|
-
}
|
|
3324
|
-
|
|
3171
|
+
canvas_native_webgl2_uniform_matrix3x4fv(
|
|
3172
|
+
location->GetUniformLocation(),
|
|
3173
|
+
transpose,
|
|
3174
|
+
data, size,
|
|
3175
|
+
ptr->GetState()
|
|
3176
|
+
);
|
|
3177
|
+
} else if (dataValue->IsArray()) {
|
|
3178
|
+
std::vector<float> buf;
|
|
3179
|
+
auto array = dataValue.As<v8::Array>();
|
|
3180
|
+
auto len = array->Length();
|
|
3181
|
+
for (int i = 0; i < len; i++) {
|
|
3182
|
+
auto item = array->Get(
|
|
3183
|
+
context, i).ToLocalChecked();
|
|
3184
|
+
buf.push_back(
|
|
3185
|
+
static_cast<float>(item->NumberValue(
|
|
3186
|
+
context).ToChecked()));
|
|
3187
|
+
}
|
|
3325
3188
|
|
|
3326
3189
|
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
}
|
|
3190
|
+
canvas_native_webgl2_uniform_matrix3x4fv(
|
|
3191
|
+
location->GetUniformLocation(),
|
|
3192
|
+
transpose,
|
|
3193
|
+
buf.data(), buf.size(),
|
|
3194
|
+
ptr->GetState()
|
|
3195
|
+
);
|
|
3334
3196
|
}
|
|
3335
|
-
|
|
3336
3197
|
}
|
|
3337
3198
|
|
|
3338
3199
|
}
|
|
@@ -3347,58 +3208,48 @@ void WebGL2RenderingContext::UniformMatrix4x2fv(const v8::FunctionCallbackInfo<v
|
|
|
3347
3208
|
auto context = isolate->GetCurrentContext();
|
|
3348
3209
|
|
|
3349
3210
|
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
auto
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
auto transpose = args[1]->BooleanValue(isolate);
|
|
3357
|
-
auto data = args[2];
|
|
3211
|
+
auto locationValue = args[0];
|
|
3212
|
+
auto type = GetNativeType(isolate, locationValue);
|
|
3213
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3214
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3215
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
3216
|
+
auto dataValue = args[2];
|
|
3358
3217
|
|
|
3359
|
-
|
|
3360
|
-
|
|
3218
|
+
if (dataValue->IsFloat32Array()) {
|
|
3219
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
3361
3220
|
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
canvas_native_webgl2_uniform_matrix4x2fv(
|
|
3369
|
-
location->GetUniformLocation(),
|
|
3370
|
-
transpose,
|
|
3371
|
-
data, size,
|
|
3372
|
-
ptr->GetState()
|
|
3373
|
-
);
|
|
3374
|
-
} else if (data->IsArray()) {
|
|
3375
|
-
std::vector<float> buf;
|
|
3376
|
-
auto array = data.As<v8::Array>();
|
|
3377
|
-
auto len = array->Length();
|
|
3378
|
-
for (int i = 0; i < len; i++) {
|
|
3379
|
-
auto item = array->Get(
|
|
3380
|
-
context, i).ToLocalChecked();
|
|
3381
|
-
if (item->IsNumber()) {
|
|
3382
|
-
buf.push_back(
|
|
3383
|
-
static_cast<float>(item->NumberValue(
|
|
3384
|
-
context).ToChecked()));
|
|
3385
|
-
} else {
|
|
3386
|
-
buf.push_back(
|
|
3387
|
-
std::nanf(""));
|
|
3388
|
-
}
|
|
3389
|
-
}
|
|
3221
|
+
auto array = buf->Buffer();
|
|
3222
|
+
auto offset = buf->ByteOffset();
|
|
3223
|
+
auto size = buf->Length();
|
|
3224
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3225
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3390
3226
|
|
|
3227
|
+
canvas_native_webgl2_uniform_matrix4x2fv(
|
|
3228
|
+
location->GetUniformLocation(),
|
|
3229
|
+
transpose,
|
|
3230
|
+
data, size,
|
|
3231
|
+
ptr->GetState()
|
|
3232
|
+
);
|
|
3233
|
+
} else if (dataValue->IsArray()) {
|
|
3234
|
+
std::vector<float> buf;
|
|
3235
|
+
auto array = dataValue.As<v8::Array>();
|
|
3236
|
+
auto len = array->Length();
|
|
3237
|
+
for (int i = 0; i < len; i++) {
|
|
3238
|
+
auto item = array->Get(
|
|
3239
|
+
context, i).ToLocalChecked();
|
|
3240
|
+
buf.push_back(
|
|
3241
|
+
static_cast<float>(item->NumberValue(
|
|
3242
|
+
context).ToChecked()));
|
|
3243
|
+
}
|
|
3391
3244
|
|
|
3392
3245
|
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
}
|
|
3246
|
+
canvas_native_webgl2_uniform_matrix4x2fv(
|
|
3247
|
+
location->GetUniformLocation(),
|
|
3248
|
+
transpose,
|
|
3249
|
+
buf.data(), buf.size(),
|
|
3250
|
+
ptr->GetState()
|
|
3251
|
+
);
|
|
3400
3252
|
}
|
|
3401
|
-
|
|
3402
3253
|
}
|
|
3403
3254
|
|
|
3404
3255
|
}
|
|
@@ -3413,56 +3264,47 @@ void WebGL2RenderingContext::UniformMatrix4x3fv(const v8::FunctionCallbackInfo<v
|
|
|
3413
3264
|
auto context = isolate->GetCurrentContext();
|
|
3414
3265
|
|
|
3415
3266
|
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
auto
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
auto transpose = args[1]->BooleanValue(isolate);
|
|
3423
|
-
auto data = args[2];
|
|
3424
|
-
|
|
3425
|
-
if (data->IsFloat32Array()) {
|
|
3426
|
-
auto buf = data.As<v8::Float32Array>();
|
|
3427
|
-
auto array = buf->Buffer();
|
|
3428
|
-
auto offset = buf->ByteOffset();
|
|
3429
|
-
auto size = buf->Length();
|
|
3430
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
3431
|
-
auto data = static_cast<float *>((void*) data_ptr);
|
|
3432
|
-
|
|
3433
|
-
canvas_native_webgl2_uniform_matrix4x3fv(
|
|
3434
|
-
location->GetUniformLocation(),
|
|
3435
|
-
transpose,
|
|
3436
|
-
data, size,
|
|
3437
|
-
ptr->GetState()
|
|
3438
|
-
);
|
|
3439
|
-
} else if (data->IsArray()) {
|
|
3440
|
-
std::vector<float> buf;
|
|
3441
|
-
auto array = data.As<v8::Array>();
|
|
3442
|
-
auto len = array->Length();
|
|
3443
|
-
for (int i = 0; i < len; i++) {
|
|
3444
|
-
auto item = array->Get(
|
|
3445
|
-
context, i).ToLocalChecked();
|
|
3446
|
-
if (item->IsNumber()) {
|
|
3447
|
-
buf.push_back(
|
|
3448
|
-
static_cast<float>(item->NumberValue(
|
|
3449
|
-
context).ToChecked()));
|
|
3450
|
-
} else {
|
|
3451
|
-
buf.push_back(
|
|
3452
|
-
std::nanf(""));
|
|
3453
|
-
}
|
|
3454
|
-
}
|
|
3267
|
+
auto locationValue = args[0];
|
|
3268
|
+
auto type = GetNativeType(isolate, locationValue);
|
|
3269
|
+
if (type == NativeType::WebGLUniformLocation) {
|
|
3270
|
+
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
3271
|
+
auto transpose = args[1]->BooleanValue(isolate);
|
|
3272
|
+
auto dataValue = args[2];
|
|
3455
3273
|
|
|
3274
|
+
if (dataValue->IsFloat32Array()) {
|
|
3275
|
+
auto buf = dataValue.As<v8::Float32Array>();
|
|
3276
|
+
auto array = buf->Buffer();
|
|
3277
|
+
auto offset = buf->ByteOffset();
|
|
3278
|
+
auto size = buf->Length();
|
|
3279
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3280
|
+
auto data = static_cast<float *>((void *) data_ptr);
|
|
3456
3281
|
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3282
|
+
canvas_native_webgl2_uniform_matrix4x3fv(
|
|
3283
|
+
location->GetUniformLocation(),
|
|
3284
|
+
transpose,
|
|
3285
|
+
data, size,
|
|
3286
|
+
ptr->GetState()
|
|
3287
|
+
);
|
|
3288
|
+
} else if (dataValue->IsArray()) {
|
|
3289
|
+
std::vector<float> buf;
|
|
3290
|
+
auto array = dataValue.As<v8::Array>();
|
|
3291
|
+
auto len = array->Length();
|
|
3292
|
+
for (int i = 0; i < len; i++) {
|
|
3293
|
+
auto item = array->Get(
|
|
3294
|
+
context, i).ToLocalChecked();
|
|
3295
|
+
buf.push_back(
|
|
3296
|
+
static_cast<float>(item->NumberValue(
|
|
3297
|
+
context).ToChecked()));
|
|
3463
3298
|
}
|
|
3464
|
-
}
|
|
3465
3299
|
|
|
3300
|
+
|
|
3301
|
+
canvas_native_webgl2_uniform_matrix4x3fv(
|
|
3302
|
+
location->GetUniformLocation(),
|
|
3303
|
+
transpose,
|
|
3304
|
+
buf.data(), buf.size(),
|
|
3305
|
+
ptr->GetState()
|
|
3306
|
+
);
|
|
3307
|
+
}
|
|
3466
3308
|
}
|
|
3467
3309
|
|
|
3468
3310
|
}
|
|
@@ -3477,17 +3319,15 @@ void WebGL2RenderingContext::VertexAttribDivisor(const v8::FunctionCallbackInfo<
|
|
|
3477
3319
|
auto context = isolate->GetCurrentContext();
|
|
3478
3320
|
|
|
3479
3321
|
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
);
|
|
3490
|
-
}
|
|
3322
|
+
auto index = args[0]->Uint32Value(
|
|
3323
|
+
context).ToChecked();
|
|
3324
|
+
auto divisor = args[1]->Uint32Value(
|
|
3325
|
+
context).ToChecked();
|
|
3326
|
+
canvas_native_webgl2_vertex_attrib_divisor(
|
|
3327
|
+
index,
|
|
3328
|
+
divisor,
|
|
3329
|
+
ptr->GetState()
|
|
3330
|
+
);
|
|
3491
3331
|
|
|
3492
3332
|
}
|
|
3493
3333
|
|
|
@@ -3501,26 +3341,24 @@ void WebGL2RenderingContext::VertexAttribI4i(const v8::FunctionCallbackInfo<v8::
|
|
|
3501
3341
|
auto context = isolate->GetCurrentContext();
|
|
3502
3342
|
|
|
3503
3343
|
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
);
|
|
3523
|
-
}
|
|
3344
|
+
auto index = args[0]->Int32Value(
|
|
3345
|
+
context).ToChecked();
|
|
3346
|
+
auto v0 = args[1]->Int32Value(
|
|
3347
|
+
context).ToChecked();
|
|
3348
|
+
auto v1 = args[2]->Int32Value(
|
|
3349
|
+
context).ToChecked();
|
|
3350
|
+
auto v2 = args[3]->Int32Value(
|
|
3351
|
+
context).ToChecked();
|
|
3352
|
+
auto v3 = args[4]->Int32Value(
|
|
3353
|
+
context).ToChecked();
|
|
3354
|
+
canvas_native_webgl2_vertex_attrib_i4i(
|
|
3355
|
+
index,
|
|
3356
|
+
v0,
|
|
3357
|
+
v1,
|
|
3358
|
+
v2,
|
|
3359
|
+
v3,
|
|
3360
|
+
ptr->GetState()
|
|
3361
|
+
);
|
|
3524
3362
|
|
|
3525
3363
|
}
|
|
3526
3364
|
|
|
@@ -3534,46 +3372,43 @@ void WebGL2RenderingContext::VertexAttribI4iv(const v8::FunctionCallbackInfo<v8:
|
|
|
3534
3372
|
auto context = isolate->GetCurrentContext();
|
|
3535
3373
|
|
|
3536
3374
|
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
auto
|
|
3542
|
-
if (value->IsInt32Array()) {
|
|
3543
|
-
auto buf = value.As<v8::Int32Array>();
|
|
3375
|
+
auto index = args[0]->Uint32Value(
|
|
3376
|
+
context).ToChecked();
|
|
3377
|
+
auto value = args[1];
|
|
3378
|
+
if (value->IsInt32Array()) {
|
|
3379
|
+
auto buf = value.As<v8::Int32Array>();
|
|
3544
3380
|
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3381
|
+
auto array = buf->Buffer();
|
|
3382
|
+
auto offset = buf->ByteOffset();
|
|
3383
|
+
auto size = buf->Length();
|
|
3384
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3385
|
+
auto data = static_cast<int32_t *>((void *) data_ptr);
|
|
3550
3386
|
|
|
3551
3387
|
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3388
|
+
canvas_native_webgl2_vertex_attrib_i4iv(
|
|
3389
|
+
index,
|
|
3390
|
+
data, size,
|
|
3391
|
+
ptr->GetState()
|
|
3392
|
+
);
|
|
3393
|
+
} else if (value->IsArray()) {
|
|
3394
|
+
auto array = value.As<v8::Array>();
|
|
3395
|
+
auto len = array->Length();
|
|
3396
|
+
std::vector<int32_t> buf;
|
|
3397
|
+
buf.reserve(len);
|
|
3398
|
+
for (int i = 0; i < len; i++) {
|
|
3399
|
+
auto item = array->Get(
|
|
3400
|
+
context,
|
|
3401
|
+
i).ToLocalChecked()->Int32Value(
|
|
3402
|
+
context).ToChecked();
|
|
3403
|
+
buf.push_back(item);
|
|
3404
|
+
}
|
|
3569
3405
|
|
|
3570
3406
|
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
}
|
|
3407
|
+
canvas_native_webgl2_vertex_attrib_i4iv(
|
|
3408
|
+
index,
|
|
3409
|
+
buf.data(), buf.size(),
|
|
3410
|
+
ptr->GetState()
|
|
3411
|
+
);
|
|
3577
3412
|
}
|
|
3578
3413
|
|
|
3579
3414
|
}
|
|
@@ -3588,27 +3423,25 @@ void WebGL2RenderingContext::VertexAttribI4ui(const v8::FunctionCallbackInfo<v8:
|
|
|
3588
3423
|
auto context = isolate->GetCurrentContext();
|
|
3589
3424
|
|
|
3590
3425
|
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
);
|
|
3611
|
-
}
|
|
3426
|
+
auto index = args[0]->Uint32Value(
|
|
3427
|
+
context).ToChecked();
|
|
3428
|
+
auto v0 = args[1]->Uint32Value(
|
|
3429
|
+
context).ToChecked();
|
|
3430
|
+
auto v1 = args[2]->Uint32Value(
|
|
3431
|
+
context).ToChecked();
|
|
3432
|
+
auto v2 = args[3]->Uint32Value(
|
|
3433
|
+
context).ToChecked();
|
|
3434
|
+
auto v3 = args[4]->Uint32Value(
|
|
3435
|
+
context).ToChecked();
|
|
3436
|
+
|
|
3437
|
+
canvas_native_webgl2_vertex_attrib_i4ui(
|
|
3438
|
+
index,
|
|
3439
|
+
v0,
|
|
3440
|
+
v1,
|
|
3441
|
+
v2,
|
|
3442
|
+
v3,
|
|
3443
|
+
ptr->GetState()
|
|
3444
|
+
);
|
|
3612
3445
|
|
|
3613
3446
|
}
|
|
3614
3447
|
|
|
@@ -3621,46 +3454,42 @@ void WebGL2RenderingContext::VertexAttribI4uiv(const v8::FunctionCallbackInfo<v8
|
|
|
3621
3454
|
auto isolate = args.GetIsolate();
|
|
3622
3455
|
auto context = isolate->GetCurrentContext();
|
|
3623
3456
|
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
auto
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
auto size = buf->Length();
|
|
3635
|
-
auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
|
|
3636
|
-
auto data = static_cast<uint32_t *>((void*) data_ptr);
|
|
3457
|
+
auto index = args[0]->Uint32Value(
|
|
3458
|
+
context).ToChecked();
|
|
3459
|
+
auto value = args[1];
|
|
3460
|
+
if (value->IsUint32Array()) {
|
|
3461
|
+
auto buf = value.As<v8::Uint32Array>();
|
|
3462
|
+
auto array = buf->Buffer();
|
|
3463
|
+
auto offset = buf->ByteOffset();
|
|
3464
|
+
auto size = buf->Length();
|
|
3465
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
3466
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
3637
3467
|
|
|
3638
3468
|
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3469
|
+
canvas_native_webgl2_vertex_attrib_i4uiv(
|
|
3470
|
+
index,
|
|
3471
|
+
data, size,
|
|
3472
|
+
ptr->GetState()
|
|
3473
|
+
);
|
|
3474
|
+
} else if (value->IsArray()) {
|
|
3475
|
+
auto array = value.As<v8::Array>();
|
|
3476
|
+
auto len = array->Length();
|
|
3477
|
+
std::vector<uint32_t> buf;
|
|
3478
|
+
buf.reserve(len);
|
|
3479
|
+
for (int i = 0; i < len; i++) {
|
|
3480
|
+
auto item = array->Get(
|
|
3481
|
+
context,
|
|
3482
|
+
i).ToLocalChecked()->Uint32Value(
|
|
3483
|
+
context).ToChecked();
|
|
3484
|
+
buf.push_back(item);
|
|
3485
|
+
}
|
|
3656
3486
|
|
|
3657
3487
|
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
}
|
|
3488
|
+
canvas_native_webgl2_vertex_attrib_i4uiv(
|
|
3489
|
+
index,
|
|
3490
|
+
buf.data(), buf.size(),
|
|
3491
|
+
ptr->GetState()
|
|
3492
|
+
);
|
|
3664
3493
|
}
|
|
3665
3494
|
|
|
3666
3495
|
}
|
|
@@ -3669,392 +3498,431 @@ void WebGL2RenderingContext::SetConstants(v8::Isolate *isolate,
|
|
|
3669
3498
|
const v8::Local<v8::ObjectTemplate> &tmpl) {
|
|
3670
3499
|
/* Getting GL parameter information */
|
|
3671
3500
|
|
|
3672
|
-
tmpl->Set(isolate, "READ_BUFFER", v8::
|
|
3673
|
-
|
|
3674
|
-
tmpl->Set(isolate, "UNPACK_ROW_LENGTH", v8::Uint32::New(isolate, 0x0CF2));
|
|
3675
|
-
|
|
3676
|
-
tmpl->Set(isolate, "UNPACK_SKIP_ROWS", v8::Uint32::New(isolate, 0x0CF3));
|
|
3501
|
+
tmpl->Set(isolate, "READ_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x0C02));
|
|
3677
3502
|
|
|
3678
|
-
tmpl->Set(isolate, "
|
|
3503
|
+
tmpl->Set(isolate, "UNPACK_ROW_LENGTH", v8::Integer::NewFromUnsigned(isolate, 0x0CF2));
|
|
3679
3504
|
|
|
3680
|
-
tmpl->Set(isolate, "
|
|
3505
|
+
tmpl->Set(isolate, "UNPACK_SKIP_ROWS", v8::Integer::NewFromUnsigned(isolate, 0x0CF3));
|
|
3681
3506
|
|
|
3682
|
-
tmpl->Set(isolate, "
|
|
3507
|
+
tmpl->Set(isolate, "UNPACK_SKIP_PIXELS", v8::Integer::NewFromUnsigned(isolate, 0x0CF4));
|
|
3683
3508
|
|
|
3684
|
-
tmpl->Set(isolate, "
|
|
3509
|
+
tmpl->Set(isolate, "PACK_ROW_LENGTH", v8::Integer::NewFromUnsigned(isolate, 0x0D02));
|
|
3685
3510
|
|
|
3686
|
-
tmpl->Set(isolate, "
|
|
3511
|
+
tmpl->Set(isolate, "PACK_SKIP_ROWS", v8::Integer::NewFromUnsigned(isolate, 0x0D03));
|
|
3687
3512
|
|
|
3688
|
-
tmpl->Set(isolate, "
|
|
3513
|
+
tmpl->Set(isolate, "PACK_SKIP_PIXELS", v8::Integer::NewFromUnsigned(isolate, 0x0D04));
|
|
3689
3514
|
|
|
3690
|
-
tmpl->Set(isolate, "
|
|
3515
|
+
tmpl->Set(isolate, "TEXTURE_BINDING_3D", v8::Integer::NewFromUnsigned(isolate, 0x806A));
|
|
3691
3516
|
|
|
3692
|
-
tmpl->Set(isolate, "
|
|
3517
|
+
tmpl->Set(isolate, "UNPACK_SKIP_IMAGES", v8::Integer::NewFromUnsigned(isolate, 0x806D));
|
|
3693
3518
|
|
|
3694
|
-
tmpl->Set(isolate, "
|
|
3519
|
+
tmpl->Set(isolate, "UNPACK_IMAGE_HEIGHT", v8::Integer::NewFromUnsigned(isolate, 0x806E));
|
|
3695
3520
|
|
|
3696
|
-
tmpl->Set(isolate, "
|
|
3521
|
+
tmpl->Set(isolate, "MAX_3D_TEXTURE_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8073));
|
|
3697
3522
|
|
|
3698
|
-
tmpl->Set(isolate, "
|
|
3523
|
+
tmpl->Set(isolate, "MAX_ELEMENTS_VERTICES", v8::Integer::NewFromUnsigned(isolate, 0x80E8));
|
|
3699
3524
|
|
|
3700
|
-
tmpl->Set(isolate, "
|
|
3525
|
+
tmpl->Set(isolate, "MAX_ELEMENTS_INDICES", v8::Integer::NewFromUnsigned(isolate, 0x80E9));
|
|
3701
3526
|
|
|
3702
|
-
tmpl->Set(isolate, "
|
|
3527
|
+
tmpl->Set(isolate, "MAX_TEXTURE_LOD_BIAS", v8::Integer::NewFromUnsigned(isolate, 0x84FD));
|
|
3703
3528
|
|
|
3704
|
-
tmpl->Set(isolate, "
|
|
3529
|
+
tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_COMPONENTS",
|
|
3530
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8B49));
|
|
3705
3531
|
|
|
3706
|
-
tmpl->Set(isolate, "
|
|
3532
|
+
tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_COMPONENTS",
|
|
3533
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8B4A));
|
|
3707
3534
|
|
|
3708
|
-
tmpl->Set(isolate, "
|
|
3535
|
+
tmpl->Set(isolate, "MAX_ARRAY_TEXTURE_LAYERS", v8::Integer::NewFromUnsigned(isolate, 0x88FF));
|
|
3709
3536
|
|
|
3710
|
-
tmpl->Set(isolate, "
|
|
3537
|
+
tmpl->Set(isolate, "MIN_PROGRAM_TEXEL_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8904));
|
|
3711
3538
|
|
|
3712
|
-
tmpl->Set(isolate, "
|
|
3539
|
+
tmpl->Set(isolate, "MAX_PROGRAM_TEXEL_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8905));
|
|
3713
3540
|
|
|
3714
|
-
tmpl->Set(isolate, "
|
|
3541
|
+
tmpl->Set(isolate, "MAX_VARYING_COMPONENTS", v8::Integer::NewFromUnsigned(isolate, 0x8B4B));
|
|
3715
3542
|
|
|
3716
|
-
tmpl->Set(isolate, "
|
|
3717
|
-
|
|
3718
|
-
tmpl->Set(isolate, "MAX_FRAGMENT_INPUT_COMPONENTS", v8::Uint32::New(isolate, 0x9125));
|
|
3719
|
-
tmpl->Set(isolate, "MAX_SERVER_WAIT_TIMEOUT", v8::Uint32::New(isolate, 0x9111));
|
|
3720
|
-
tmpl->Set(isolate, "MAX_ELEMENT_INDEX", v8::Uint32::New(isolate, 0x8D6B));
|
|
3543
|
+
tmpl->Set(isolate, "FRAGMENT_SHADER_DERIVATIVE_HINT",
|
|
3544
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8B8B));
|
|
3721
3545
|
|
|
3722
|
-
tmpl->Set(isolate, "
|
|
3723
|
-
tmpl->Set(isolate, "RGB8", v8::Uint32::New(isolate, 0x8051));
|
|
3724
|
-
tmpl->Set(isolate, "RGBA8", v8::Uint32::New(isolate, 0x8058));
|
|
3725
|
-
tmpl->Set(isolate, "RGB10_A2", v8::Uint32::New(isolate, 0x8059));
|
|
3726
|
-
tmpl->Set(isolate, "TEXTURE_3D", v8::Uint32::New(isolate, 0x806F));
|
|
3546
|
+
tmpl->Set(isolate, "RASTERIZER_DISCARD", v8::Integer::NewFromUnsigned(isolate, 0x8C89));
|
|
3727
3547
|
|
|
3728
|
-
tmpl->Set(isolate, "
|
|
3729
|
-
tmpl->Set(isolate, "
|
|
3730
|
-
|
|
3731
|
-
tmpl->Set(isolate, "
|
|
3732
|
-
|
|
3548
|
+
tmpl->Set(isolate, "VERTEX_ARRAY_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x85B5));
|
|
3549
|
+
tmpl->Set(isolate, "MAX_VERTEX_OUTPUT_COMPONENTS",
|
|
3550
|
+
v8::Integer::NewFromUnsigned(isolate, 0x9122));
|
|
3551
|
+
tmpl->Set(isolate, "MAX_FRAGMENT_INPUT_COMPONENTS",
|
|
3552
|
+
v8::Integer::NewFromUnsigned(isolate, 0x9125));
|
|
3553
|
+
tmpl->Set(isolate, "MAX_SERVER_WAIT_TIMEOUT", v8::Integer::NewFromUnsigned(isolate, 0x9111));
|
|
3554
|
+
tmpl->Set(isolate, "MAX_ELEMENT_INDEX", v8::Integer::NewFromUnsigned(isolate, 0x8D6B));
|
|
3733
3555
|
|
|
3556
|
+
tmpl->Set(isolate, "RED", v8::Integer::NewFromUnsigned(isolate, 0x1903));
|
|
3557
|
+
tmpl->Set(isolate, "RGB8", v8::Integer::NewFromUnsigned(isolate, 0x8051));
|
|
3558
|
+
tmpl->Set(isolate, "RGBA8", v8::Integer::NewFromUnsigned(isolate, 0x8058));
|
|
3559
|
+
tmpl->Set(isolate, "RGB10_A2", v8::Integer::NewFromUnsigned(isolate, 0x8059));
|
|
3560
|
+
tmpl->Set(isolate, "TEXTURE_3D", v8::Integer::NewFromUnsigned(isolate, 0x806F));
|
|
3734
3561
|
|
|
3735
|
-
tmpl->Set(isolate, "
|
|
3736
|
-
tmpl->Set(isolate, "
|
|
3737
|
-
tmpl->Set(isolate, "
|
|
3738
|
-
tmpl->Set(isolate, "
|
|
3739
|
-
tmpl->Set(isolate, "
|
|
3562
|
+
tmpl->Set(isolate, "TEXTURE_WRAP_R", v8::Integer::NewFromUnsigned(isolate, 0x8072));
|
|
3563
|
+
tmpl->Set(isolate, "TEXTURE_MIN_LOD", v8::Integer::NewFromUnsigned(isolate, 0x813A));
|
|
3564
|
+
tmpl->Set(isolate, "TEXTURE_MAX_LOD", v8::Integer::NewFromUnsigned(isolate, 0x813B));
|
|
3565
|
+
tmpl->Set(isolate, "TEXTURE_BASE_LEVEL", v8::Integer::NewFromUnsigned(isolate, 0x813C));
|
|
3566
|
+
tmpl->Set(isolate, "TEXTURE_MAX_LEVEL", v8::Integer::NewFromUnsigned(isolate, 0x813D));
|
|
3740
3567
|
|
|
3741
|
-
tmpl->Set(isolate, "COMPARE_REF_TO_TEXTURE", v8::Uint32::New(isolate, 0x884E));
|
|
3742
|
-
tmpl->Set(isolate, "RGBA32F", v8::Uint32::New(isolate, 0x8814));
|
|
3743
|
-
tmpl->Set(isolate, "RGB32F", v8::Uint32::New(isolate, 0x8815));
|
|
3744
|
-
tmpl->Set(isolate, "RGBA16F", v8::Uint32::New(isolate, 0x881A));
|
|
3745
|
-
tmpl->Set(isolate, "RGB16F", v8::Uint32::New(isolate, 0x881B));
|
|
3746
3568
|
|
|
3747
|
-
tmpl->Set(isolate, "
|
|
3748
|
-
tmpl->Set(isolate, "
|
|
3749
|
-
tmpl->Set(isolate, "
|
|
3750
|
-
tmpl->Set(isolate, "
|
|
3751
|
-
tmpl->Set(isolate, "
|
|
3569
|
+
tmpl->Set(isolate, "TEXTURE_COMPARE_MODE", v8::Integer::NewFromUnsigned(isolate, 0x884C));
|
|
3570
|
+
tmpl->Set(isolate, "TEXTURE_COMPARE_FUNC", v8::Integer::NewFromUnsigned(isolate, 0x884D));
|
|
3571
|
+
tmpl->Set(isolate, "SRGB", v8::Integer::NewFromUnsigned(isolate, 0x8C40));
|
|
3572
|
+
tmpl->Set(isolate, "SRGB8", v8::Integer::NewFromUnsigned(isolate, 0x8C41));
|
|
3573
|
+
tmpl->Set(isolate, "SRGB8_ALPHA8", v8::Integer::NewFromUnsigned(isolate, 0x8C43));
|
|
3752
3574
|
|
|
3575
|
+
tmpl->Set(isolate, "COMPARE_REF_TO_TEXTURE", v8::Integer::NewFromUnsigned(isolate, 0x884E));
|
|
3576
|
+
tmpl->Set(isolate, "RGBA32F", v8::Integer::NewFromUnsigned(isolate, 0x8814));
|
|
3577
|
+
tmpl->Set(isolate, "RGB32F", v8::Integer::NewFromUnsigned(isolate, 0x8815));
|
|
3578
|
+
tmpl->Set(isolate, "RGBA16F", v8::Integer::NewFromUnsigned(isolate, 0x881A));
|
|
3579
|
+
tmpl->Set(isolate, "RGB16F", v8::Integer::NewFromUnsigned(isolate, 0x881B));
|
|
3753
3580
|
|
|
3754
|
-
tmpl->Set(isolate, "
|
|
3755
|
-
tmpl->Set(isolate, "
|
|
3756
|
-
tmpl->Set(isolate, "
|
|
3757
|
-
tmpl->Set(isolate, "
|
|
3758
|
-
tmpl->Set(isolate, "
|
|
3581
|
+
tmpl->Set(isolate, "TEXTURE_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8C1A));
|
|
3582
|
+
tmpl->Set(isolate, "TEXTURE_BINDING_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8C1D));
|
|
3583
|
+
tmpl->Set(isolate, "R11F_G11F_B10F", v8::Integer::NewFromUnsigned(isolate, 0x8C3A));
|
|
3584
|
+
tmpl->Set(isolate, "RGB9_E5", v8::Integer::NewFromUnsigned(isolate, 0x8C3D));
|
|
3585
|
+
tmpl->Set(isolate, "RGBA32UI", v8::Integer::NewFromUnsigned(isolate, 0x8D70));
|
|
3759
3586
|
|
|
3760
3587
|
|
|
3761
|
-
tmpl->Set(isolate, "
|
|
3762
|
-
tmpl->Set(isolate, "
|
|
3763
|
-
tmpl->Set(isolate, "
|
|
3764
|
-
tmpl->Set(isolate, "
|
|
3765
|
-
tmpl->Set(isolate, "
|
|
3588
|
+
tmpl->Set(isolate, "RGB32UI", v8::Integer::NewFromUnsigned(isolate, 0x8D71));
|
|
3589
|
+
tmpl->Set(isolate, "RGBA16UI", v8::Integer::NewFromUnsigned(isolate, 0x8D76));
|
|
3590
|
+
tmpl->Set(isolate, "RGB16UI", v8::Integer::NewFromUnsigned(isolate, 0x8D77));
|
|
3591
|
+
tmpl->Set(isolate, "RGBA8UI", v8::Integer::NewFromUnsigned(isolate, 0x8D7C));
|
|
3592
|
+
tmpl->Set(isolate, "RGB8UI", v8::Integer::NewFromUnsigned(isolate, 0x8D7D));
|
|
3766
3593
|
|
|
3767
3594
|
|
|
3768
|
-
tmpl->Set(isolate, "
|
|
3769
|
-
tmpl->Set(isolate, "
|
|
3770
|
-
tmpl->Set(isolate, "
|
|
3771
|
-
tmpl->Set(isolate, "
|
|
3772
|
-
tmpl->Set(isolate, "
|
|
3595
|
+
tmpl->Set(isolate, "RGBA32I", v8::Integer::NewFromUnsigned(isolate, 0x8D82));
|
|
3596
|
+
tmpl->Set(isolate, "RGB32I", v8::Integer::NewFromUnsigned(isolate, 0x8D83));
|
|
3597
|
+
tmpl->Set(isolate, "RGBA16I", v8::Integer::NewFromUnsigned(isolate, 0x8D88));
|
|
3598
|
+
tmpl->Set(isolate, "RGB16I", v8::Integer::NewFromUnsigned(isolate, 0x8D89));
|
|
3599
|
+
tmpl->Set(isolate, "RGBA8I", v8::Integer::NewFromUnsigned(isolate, 0x8D8E));
|
|
3773
3600
|
|
|
3774
3601
|
|
|
3775
|
-
tmpl->Set(isolate, "
|
|
3776
|
-
tmpl->Set(isolate, "
|
|
3777
|
-
tmpl->Set(isolate, "
|
|
3778
|
-
tmpl->Set(isolate, "
|
|
3779
|
-
tmpl->Set(isolate, "
|
|
3602
|
+
tmpl->Set(isolate, "RGB8I", v8::Integer::NewFromUnsigned(isolate, 0x8D8F));
|
|
3603
|
+
tmpl->Set(isolate, "RED_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D94));
|
|
3604
|
+
tmpl->Set(isolate, "RGB_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D98));
|
|
3605
|
+
tmpl->Set(isolate, "RGBA_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D99));
|
|
3606
|
+
tmpl->Set(isolate, "R8", v8::Integer::NewFromUnsigned(isolate, 0x8229));
|
|
3780
3607
|
|
|
3781
3608
|
|
|
3782
|
-
tmpl->Set(isolate, "
|
|
3783
|
-
tmpl->Set(isolate, "
|
|
3784
|
-
tmpl->Set(isolate, "
|
|
3785
|
-
tmpl->Set(isolate, "
|
|
3786
|
-
tmpl->Set(isolate, "
|
|
3609
|
+
tmpl->Set(isolate, "RG8", v8::Integer::NewFromUnsigned(isolate, 0x822B));
|
|
3610
|
+
tmpl->Set(isolate, "R16F", v8::Integer::NewFromUnsigned(isolate, 0x822D));
|
|
3611
|
+
tmpl->Set(isolate, "R32F", v8::Integer::NewFromUnsigned(isolate, 0x822E));
|
|
3612
|
+
tmpl->Set(isolate, "RG16F", v8::Integer::NewFromUnsigned(isolate, 0x822F));
|
|
3613
|
+
tmpl->Set(isolate, "RG32F", v8::Integer::NewFromUnsigned(isolate, 0x8230));
|
|
3787
3614
|
|
|
3788
3615
|
|
|
3789
|
-
tmpl->Set(isolate, "
|
|
3790
|
-
tmpl->Set(isolate, "
|
|
3791
|
-
tmpl->Set(isolate, "
|
|
3792
|
-
tmpl->Set(isolate, "
|
|
3793
|
-
tmpl->Set(isolate, "
|
|
3616
|
+
tmpl->Set(isolate, "R8I", v8::Integer::NewFromUnsigned(isolate, 0x8231));
|
|
3617
|
+
tmpl->Set(isolate, "R8UI", v8::Integer::NewFromUnsigned(isolate, 0x8232));
|
|
3618
|
+
tmpl->Set(isolate, "R16I", v8::Integer::NewFromUnsigned(isolate, 0x8233));
|
|
3619
|
+
tmpl->Set(isolate, "R16UI", v8::Integer::NewFromUnsigned(isolate, 0x8234));
|
|
3620
|
+
tmpl->Set(isolate, "R32I", v8::Integer::NewFromUnsigned(isolate, 0x8235));
|
|
3794
3621
|
|
|
3795
|
-
tmpl->Set(isolate, "RG32I", v8::Uint32::New(isolate, 0x823B));
|
|
3796
|
-
tmpl->Set(isolate, "RG32UI", v8::Uint32::New(isolate, 0x823C));
|
|
3797
|
-
tmpl->Set(isolate, "R8_SNORM", v8::Uint32::New(isolate, 0x8F94));
|
|
3798
|
-
tmpl->Set(isolate, "RG8_SNORM", v8::Uint32::New(isolate, 0x8F95));
|
|
3799
|
-
tmpl->Set(isolate, "RGB8_SNORM", v8::Uint32::New(isolate, 0x8F96));
|
|
3800
3622
|
|
|
3623
|
+
tmpl->Set(isolate, "R32UI", v8::Integer::NewFromUnsigned(isolate, 0x8236));
|
|
3624
|
+
tmpl->Set(isolate, "RG8I", v8::Integer::NewFromUnsigned(isolate, 0x8237));
|
|
3625
|
+
tmpl->Set(isolate, "RG8UI", v8::Integer::NewFromUnsigned(isolate, 0x8238));
|
|
3626
|
+
tmpl->Set(isolate, "RG16I", v8::Integer::NewFromUnsigned(isolate, 0x8239));
|
|
3627
|
+
tmpl->Set(isolate, "RG16UI", v8::Integer::NewFromUnsigned(isolate, 0x823A));
|
|
3801
3628
|
|
|
3802
|
-
tmpl->Set(isolate, "
|
|
3803
|
-
tmpl->Set(isolate, "
|
|
3804
|
-
tmpl->Set(isolate, "
|
|
3805
|
-
tmpl->Set(isolate, "
|
|
3806
|
-
tmpl->Set(isolate, "
|
|
3629
|
+
tmpl->Set(isolate, "RG32I", v8::Integer::NewFromUnsigned(isolate, 0x823B));
|
|
3630
|
+
tmpl->Set(isolate, "RG32UI", v8::Integer::NewFromUnsigned(isolate, 0x823C));
|
|
3631
|
+
tmpl->Set(isolate, "R8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F94));
|
|
3632
|
+
tmpl->Set(isolate, "RG8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F95));
|
|
3633
|
+
tmpl->Set(isolate, "RGB8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F96));
|
|
3807
3634
|
|
|
3808
3635
|
|
|
3809
|
-
tmpl->Set(isolate, "
|
|
3810
|
-
tmpl->Set(isolate, "
|
|
3811
|
-
tmpl->Set(isolate, "
|
|
3812
|
-
tmpl->Set(isolate, "
|
|
3813
|
-
tmpl->Set(isolate, "
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
tmpl->Set(isolate, "
|
|
3818
|
-
|
|
3819
|
-
tmpl->Set(isolate, "
|
|
3820
|
-
tmpl->Set(isolate, "
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
tmpl->Set(isolate, "
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
tmpl->Set(isolate, "
|
|
3827
|
-
|
|
3828
|
-
tmpl->Set(isolate, "
|
|
3829
|
-
tmpl->Set(isolate, "
|
|
3830
|
-
tmpl->Set(isolate, "
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
tmpl->Set(isolate, "
|
|
3834
|
-
tmpl->Set(isolate, "
|
|
3835
|
-
tmpl->Set(isolate, "
|
|
3836
|
-
|
|
3837
|
-
tmpl->Set(isolate, "
|
|
3838
|
-
|
|
3636
|
+
tmpl->Set(isolate, "RGBA8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F97));
|
|
3637
|
+
tmpl->Set(isolate, "RGB10_A2UI", v8::Integer::NewFromUnsigned(isolate, 0x906F));
|
|
3638
|
+
tmpl->Set(isolate, "TEXTURE_IMMUTABLE_FORMAT", v8::Integer::NewFromUnsigned(isolate, 0x912F));
|
|
3639
|
+
tmpl->Set(isolate, "TEXTURE_IMMUTABLE_LEVELS", v8::Integer::NewFromUnsigned(isolate, 0x82DF));
|
|
3640
|
+
tmpl->Set(isolate, "UNSIGNED_INT_2_10_10_10_REV",
|
|
3641
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8368));
|
|
3642
|
+
|
|
3643
|
+
|
|
3644
|
+
tmpl->Set(isolate, "UNSIGNED_INT_10F_11F_11F_REV",
|
|
3645
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C3B));
|
|
3646
|
+
tmpl->Set(isolate, "UNSIGNED_INT_5_9_9_9_REV", v8::Integer::NewFromUnsigned(isolate, 0x8C3E));
|
|
3647
|
+
tmpl->Set(isolate, "FLOAT_32_UNSIGNED_INT_24_8_REV",
|
|
3648
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8DAD));
|
|
3649
|
+
tmpl->Set(isolate, "UNSIGNED_INT_24_8", v8::Integer::NewFromUnsigned(isolate, 0x84FA));
|
|
3650
|
+
tmpl->Set(isolate, "HALF_FLOAT", v8::Integer::NewFromUnsigned(isolate, 0x140B));
|
|
3651
|
+
|
|
3652
|
+
|
|
3653
|
+
tmpl->Set(isolate, "RG", v8::Integer::NewFromUnsigned(isolate, 0x8227));
|
|
3654
|
+
tmpl->Set(isolate, "RG_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8228));
|
|
3655
|
+
tmpl->Set(isolate, "INT_2_10_10_10_REV", v8::Integer::NewFromUnsigned(isolate, 0x8D9F));
|
|
3656
|
+
tmpl->Set(isolate, "QUERY_RESULT_AVAILABLE", v8::Integer::NewFromUnsigned(isolate, 0x8865));
|
|
3657
|
+
tmpl->Set(isolate, "QUERY_RESULT", v8::Integer::NewFromUnsigned(isolate, 0x8866));
|
|
3658
|
+
|
|
3659
|
+
|
|
3660
|
+
tmpl->Set(isolate, "CURRENT_QUERY", v8::Integer::NewFromUnsigned(isolate, 0x8867));
|
|
3661
|
+
tmpl->Set(isolate, "ANY_SAMPLES_PASSED", v8::Integer::NewFromUnsigned(isolate, 0x8C2F));
|
|
3662
|
+
tmpl->Set(isolate, "ANY_SAMPLES_PASSED_CONSERVATIVE",
|
|
3663
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8D6A));
|
|
3664
|
+
tmpl->Set(isolate, "MAX_DRAW_BUFFERS", v8::Integer::NewFromUnsigned(isolate, 0x8824));
|
|
3665
|
+
|
|
3666
|
+
tmpl->Set(isolate, "DRAW_BUFFER0", v8::Integer::NewFromUnsigned(isolate, 0x8825));
|
|
3667
|
+
tmpl->Set(isolate, "DRAW_BUFFER1", v8::Integer::NewFromUnsigned(isolate, 0x8826));
|
|
3668
|
+
tmpl->Set(isolate, "DRAW_BUFFER2", v8::Integer::NewFromUnsigned(isolate, 0x8827));
|
|
3669
|
+
tmpl->Set(isolate, "DRAW_BUFFER3", v8::Integer::NewFromUnsigned(isolate, 0x8828));
|
|
3670
|
+
tmpl->Set(isolate, "DRAW_BUFFER4", v8::Integer::NewFromUnsigned(isolate, 0x8829));
|
|
3671
|
+
tmpl->Set(isolate, "DRAW_BUFFER5", v8::Integer::NewFromUnsigned(isolate, 0x882A));
|
|
3672
|
+
tmpl->Set(isolate, "DRAW_BUFFER6", v8::Integer::NewFromUnsigned(isolate, 0x882B));
|
|
3673
|
+
tmpl->Set(isolate, "DRAW_BUFFER7", v8::Integer::NewFromUnsigned(isolate, 0x882C));
|
|
3674
|
+
tmpl->Set(isolate, "DRAW_BUFFER8", v8::Integer::NewFromUnsigned(isolate, 0x882D));
|
|
3675
|
+
tmpl->Set(isolate, "DRAW_BUFFER9", v8::Integer::NewFromUnsigned(isolate, 0x882E));
|
|
3676
|
+
tmpl->Set(isolate, "DRAW_BUFFER10", v8::Integer::NewFromUnsigned(isolate, 0x882F));
|
|
3839
3677
|
|
|
3840
3678
|
/* Getting GL parameter information */
|
|
3841
3679
|
|
|
3842
3680
|
/* Textures */
|
|
3843
3681
|
|
|
3844
|
-
tmpl->Set(isolate, "DRAW_BUFFER11", v8::
|
|
3845
|
-
tmpl->Set(isolate, "DRAW_BUFFER12", v8::
|
|
3846
|
-
tmpl->Set(isolate, "DRAW_BUFFER13", v8::
|
|
3847
|
-
tmpl->Set(isolate, "DRAW_BUFFER14", v8::
|
|
3848
|
-
tmpl->Set(isolate, "DRAW_BUFFER15", v8::
|
|
3849
|
-
|
|
3850
|
-
tmpl->Set(isolate, "MAX_COLOR_ATTACHMENTS", v8::
|
|
3851
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT1", v8::
|
|
3852
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT2", v8::
|
|
3853
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT3", v8::
|
|
3854
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT4", v8::
|
|
3855
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT5", v8::
|
|
3856
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT6", v8::
|
|
3857
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT7", v8::
|
|
3858
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT8", v8::
|
|
3859
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT9", v8::
|
|
3860
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT10", v8::
|
|
3861
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT11", v8::
|
|
3862
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT12", v8::
|
|
3863
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT13", v8::
|
|
3864
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT14", v8::
|
|
3865
|
-
tmpl->Set(isolate, "COLOR_ATTACHMENT15", v8::
|
|
3866
|
-
|
|
3867
|
-
tmpl->Set(isolate, "SAMPLER_3D", v8::
|
|
3868
|
-
tmpl->Set(isolate, "SAMPLER_2D_SHADOW", v8::
|
|
3869
|
-
tmpl->Set(isolate, "SAMPLER_2D_ARRAY", v8::
|
|
3870
|
-
tmpl->Set(isolate, "SAMPLER_2D_ARRAY_SHADOW", v8::
|
|
3871
|
-
tmpl->Set(isolate, "SAMPLER_CUBE_SHADOW", v8::
|
|
3872
|
-
|
|
3873
|
-
tmpl->Set(isolate, "INT_SAMPLER_2D", v8::
|
|
3874
|
-
tmpl->Set(isolate, "INT_SAMPLER_3D", v8::
|
|
3875
|
-
tmpl->Set(isolate, "INT_SAMPLER_CUBE", v8::
|
|
3876
|
-
tmpl->Set(isolate, "INT_SAMPLER_2D_ARRAY", v8::
|
|
3877
|
-
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D", v8::
|
|
3878
|
-
|
|
3879
|
-
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_3D", v8::
|
|
3880
|
-
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_CUBE", v8::
|
|
3881
|
-
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D_ARRAY",
|
|
3882
|
-
|
|
3883
|
-
tmpl->Set(isolate, "
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
tmpl->Set(isolate, "
|
|
3887
|
-
tmpl->Set(isolate, "
|
|
3888
|
-
tmpl->Set(isolate, "
|
|
3889
|
-
tmpl->Set(isolate, "
|
|
3890
|
-
|
|
3891
|
-
tmpl->Set(isolate, "
|
|
3892
|
-
|
|
3893
|
-
tmpl->Set(isolate, "
|
|
3894
|
-
tmpl->Set(isolate, "
|
|
3895
|
-
tmpl->Set(isolate, "
|
|
3896
|
-
|
|
3897
|
-
tmpl->Set(isolate, "
|
|
3898
|
-
|
|
3899
|
-
tmpl->Set(isolate, "
|
|
3900
|
-
tmpl->Set(isolate, "
|
|
3901
|
-
tmpl->Set(isolate, "
|
|
3902
|
-
|
|
3903
|
-
tmpl->Set(isolate, "
|
|
3904
|
-
|
|
3905
|
-
tmpl->Set(isolate, "
|
|
3906
|
-
tmpl->Set(isolate, "
|
|
3682
|
+
tmpl->Set(isolate, "DRAW_BUFFER11", v8::Integer::NewFromUnsigned(isolate, 0x8830));
|
|
3683
|
+
tmpl->Set(isolate, "DRAW_BUFFER12", v8::Integer::NewFromUnsigned(isolate, 0x8831));
|
|
3684
|
+
tmpl->Set(isolate, "DRAW_BUFFER13", v8::Integer::NewFromUnsigned(isolate, 0x8832));
|
|
3685
|
+
tmpl->Set(isolate, "DRAW_BUFFER14", v8::Integer::NewFromUnsigned(isolate, 0x8833));
|
|
3686
|
+
tmpl->Set(isolate, "DRAW_BUFFER15", v8::Integer::NewFromUnsigned(isolate, 0x8834));
|
|
3687
|
+
|
|
3688
|
+
tmpl->Set(isolate, "MAX_COLOR_ATTACHMENTS", v8::Integer::NewFromUnsigned(isolate, 0x8CDF));
|
|
3689
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT1", v8::Integer::NewFromUnsigned(isolate, 0x8CE1));
|
|
3690
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT2", v8::Integer::NewFromUnsigned(isolate, 0x8CE2));
|
|
3691
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT3", v8::Integer::NewFromUnsigned(isolate, 0x8CE3));
|
|
3692
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT4", v8::Integer::NewFromUnsigned(isolate, 0x8CE4));
|
|
3693
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT5", v8::Integer::NewFromUnsigned(isolate, 0x8CE5));
|
|
3694
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT6", v8::Integer::NewFromUnsigned(isolate, 0x8CE6));
|
|
3695
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT7", v8::Integer::NewFromUnsigned(isolate, 0x8CE7));
|
|
3696
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT8", v8::Integer::NewFromUnsigned(isolate, 0x8CE8));
|
|
3697
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT9", v8::Integer::NewFromUnsigned(isolate, 0x8CE9));
|
|
3698
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT10", v8::Integer::NewFromUnsigned(isolate, 0x8CEA));
|
|
3699
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT11", v8::Integer::NewFromUnsigned(isolate, 0x8CEB));
|
|
3700
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT12", v8::Integer::NewFromUnsigned(isolate, 0x8CEC));
|
|
3701
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT13", v8::Integer::NewFromUnsigned(isolate, 0x8CED));
|
|
3702
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT14", v8::Integer::NewFromUnsigned(isolate, 0x8CEE));
|
|
3703
|
+
tmpl->Set(isolate, "COLOR_ATTACHMENT15", v8::Integer::NewFromUnsigned(isolate, 0x8CEF));
|
|
3704
|
+
|
|
3705
|
+
tmpl->Set(isolate, "SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8B5F));
|
|
3706
|
+
tmpl->Set(isolate, "SAMPLER_2D_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8B62));
|
|
3707
|
+
tmpl->Set(isolate, "SAMPLER_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8DC1));
|
|
3708
|
+
tmpl->Set(isolate, "SAMPLER_2D_ARRAY_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8DC4));
|
|
3709
|
+
tmpl->Set(isolate, "SAMPLER_CUBE_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8DC5));
|
|
3710
|
+
|
|
3711
|
+
tmpl->Set(isolate, "INT_SAMPLER_2D", v8::Integer::NewFromUnsigned(isolate, 0x8DCA));
|
|
3712
|
+
tmpl->Set(isolate, "INT_SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8DCB));
|
|
3713
|
+
tmpl->Set(isolate, "INT_SAMPLER_CUBE", v8::Integer::NewFromUnsigned(isolate, 0x8DCC));
|
|
3714
|
+
tmpl->Set(isolate, "INT_SAMPLER_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8DCF));
|
|
3715
|
+
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D", v8::Integer::NewFromUnsigned(isolate, 0x8DD2));
|
|
3716
|
+
|
|
3717
|
+
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8DD3));
|
|
3718
|
+
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_CUBE", v8::Integer::NewFromUnsigned(isolate, 0x8DD4));
|
|
3719
|
+
tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D_ARRAY",
|
|
3720
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8DD7));
|
|
3721
|
+
tmpl->Set(isolate, "MAX_SAMPLES", v8::Integer::NewFromUnsigned(isolate, 0x8D57));
|
|
3722
|
+
tmpl->Set(isolate, "SAMPLER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8919));
|
|
3723
|
+
|
|
3724
|
+
tmpl->Set(isolate, "PIXEL_PACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x88EB));
|
|
3725
|
+
tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x88EC));
|
|
3726
|
+
tmpl->Set(isolate, "PIXEL_PACK_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x88ED));
|
|
3727
|
+
tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER_BINDING",
|
|
3728
|
+
v8::Integer::NewFromUnsigned(isolate, 0x88EF));
|
|
3729
|
+
tmpl->Set(isolate, "COPY_READ_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8F36));
|
|
3730
|
+
|
|
3731
|
+
tmpl->Set(isolate, "COPY_WRITE_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8F37));
|
|
3732
|
+
tmpl->Set(isolate, "COPY_READ_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8F36));
|
|
3733
|
+
tmpl->Set(isolate, "COPY_WRITE_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8F37));
|
|
3734
|
+
tmpl->Set(isolate, "FLOAT_MAT2x3", v8::Integer::NewFromUnsigned(isolate, 0x8B65));
|
|
3735
|
+
tmpl->Set(isolate, "FLOAT_MAT2x4", v8::Integer::NewFromUnsigned(isolate, 0x8B66));
|
|
3736
|
+
|
|
3737
|
+
tmpl->Set(isolate, "FLOAT_MAT3x2", v8::Integer::NewFromUnsigned(isolate, 0x8B67));
|
|
3738
|
+
tmpl->Set(isolate, "FLOAT_MAT3x4", v8::Integer::NewFromUnsigned(isolate, 0x8B68));
|
|
3739
|
+
tmpl->Set(isolate, "FLOAT_MAT4x2", v8::Integer::NewFromUnsigned(isolate, 0x8B69));
|
|
3740
|
+
tmpl->Set(isolate, "FLOAT_MAT4x3", v8::Integer::NewFromUnsigned(isolate, 0x8B6A));
|
|
3741
|
+
tmpl->Set(isolate, "UNSIGNED_INT_VEC2", v8::Integer::NewFromUnsigned(isolate, 0x8DC6));
|
|
3742
|
+
|
|
3743
|
+
tmpl->Set(isolate, "UNSIGNED_INT_VEC3", v8::Integer::NewFromUnsigned(isolate, 0x8DC7));
|
|
3744
|
+
tmpl->Set(isolate, "UNSIGNED_INT_VEC4", v8::Integer::NewFromUnsigned(isolate, 0x8DC8));
|
|
3745
|
+
tmpl->Set(isolate, "UNSIGNED_NORMALIZED", v8::Integer::NewFromUnsigned(isolate, 0x8C17));
|
|
3746
|
+
tmpl->Set(isolate, "SIGNED_NORMALIZED", v8::Integer::NewFromUnsigned(isolate, 0x8F9C));
|
|
3907
3747
|
|
|
3908
3748
|
/* Vertex attributes */
|
|
3909
3749
|
|
|
3910
|
-
tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_INTEGER",
|
|
3911
|
-
|
|
3912
|
-
tmpl->Set(isolate, "
|
|
3750
|
+
tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_INTEGER",
|
|
3751
|
+
v8::Integer::NewFromUnsigned(isolate, 0x88FD));
|
|
3752
|
+
tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_DIVISOR",
|
|
3753
|
+
v8::Integer::NewFromUnsigned(isolate, 0x88FE));
|
|
3754
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_MODE",
|
|
3755
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C7F));
|
|
3913
3756
|
tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",
|
|
3914
|
-
v8::
|
|
3915
|
-
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_VARYINGS",
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
tmpl->Set(isolate, "
|
|
3919
|
-
|
|
3757
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C80));
|
|
3758
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_VARYINGS",
|
|
3759
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C83));
|
|
3760
|
+
|
|
3761
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_START",
|
|
3762
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C84));
|
|
3763
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_SIZE",
|
|
3764
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C85));
|
|
3765
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",
|
|
3766
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C88));
|
|
3920
3767
|
tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",
|
|
3921
|
-
v8::
|
|
3768
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C8A));
|
|
3922
3769
|
|
|
3923
3770
|
/* Textures */
|
|
3924
3771
|
|
|
3925
3772
|
/* Pixel types */
|
|
3926
3773
|
|
|
3927
|
-
tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",
|
|
3928
|
-
|
|
3929
|
-
tmpl->Set(isolate, "
|
|
3930
|
-
tmpl->Set(isolate, "
|
|
3931
|
-
tmpl->Set(isolate, "
|
|
3774
|
+
tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",
|
|
3775
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C8B));
|
|
3776
|
+
tmpl->Set(isolate, "INTERLEAVED_ATTRIBS", v8::Integer::NewFromUnsigned(isolate, 0x8C8C));
|
|
3777
|
+
tmpl->Set(isolate, "SEPARATE_ATTRIBS", v8::Integer::NewFromUnsigned(isolate, 0x8C8D));
|
|
3778
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8C8E));
|
|
3779
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_BINDING",
|
|
3780
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8C8F));
|
|
3932
3781
|
|
|
3933
|
-
tmpl->Set(isolate, "TRANSFORM_FEEDBACK", v8::
|
|
3934
|
-
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PAUSED", v8::
|
|
3935
|
-
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_ACTIVE", v8::
|
|
3936
|
-
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BINDING", v8::
|
|
3782
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK", v8::Integer::NewFromUnsigned(isolate, 0x8E22));
|
|
3783
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PAUSED", v8::Integer::NewFromUnsigned(isolate, 0x8E23));
|
|
3784
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_ACTIVE", v8::Integer::NewFromUnsigned(isolate, 0x8E24));
|
|
3785
|
+
tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8E25));
|
|
3937
3786
|
|
|
3938
3787
|
/* Pixel types */
|
|
3939
3788
|
|
|
3940
3789
|
/* Queries */
|
|
3941
3790
|
|
|
3942
|
-
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",
|
|
3943
|
-
|
|
3944
|
-
tmpl->Set(isolate, "
|
|
3945
|
-
|
|
3946
|
-
tmpl->Set(isolate, "
|
|
3791
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",
|
|
3792
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8210));
|
|
3793
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",
|
|
3794
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8211));
|
|
3795
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_RED_SIZE",
|
|
3796
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8212));
|
|
3797
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",
|
|
3798
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8213));
|
|
3799
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",
|
|
3800
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8214));
|
|
3947
3801
|
|
|
3948
3802
|
/* Queries */
|
|
3949
3803
|
|
|
3950
3804
|
/* Draw buffers */
|
|
3951
3805
|
|
|
3952
|
-
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",
|
|
3953
|
-
|
|
3954
|
-
tmpl->Set(isolate, "
|
|
3955
|
-
|
|
3956
|
-
tmpl->Set(isolate, "
|
|
3957
|
-
|
|
3958
|
-
tmpl->Set(isolate, "
|
|
3959
|
-
tmpl->Set(isolate, "
|
|
3960
|
-
|
|
3961
|
-
tmpl->Set(isolate, "
|
|
3962
|
-
tmpl->Set(isolate, "
|
|
3963
|
-
|
|
3964
|
-
tmpl->Set(isolate, "
|
|
3965
|
-
tmpl->Set(isolate, "
|
|
3966
|
-
|
|
3967
|
-
tmpl->Set(isolate, "
|
|
3968
|
-
tmpl->Set(isolate, "
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
tmpl->Set(isolate, "
|
|
3972
|
-
|
|
3973
|
-
tmpl->Set(isolate, "
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
tmpl->Set(isolate, "
|
|
3977
|
-
tmpl->Set(isolate, "
|
|
3978
|
-
tmpl->Set(isolate, "
|
|
3979
|
-
tmpl->Set(isolate, "
|
|
3806
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",
|
|
3807
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8215));
|
|
3808
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",
|
|
3809
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8216));
|
|
3810
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",
|
|
3811
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8217));
|
|
3812
|
+
tmpl->Set(isolate, "FRAMEBUFFER_DEFAULT", v8::Integer::NewFromUnsigned(isolate, 0x8218));
|
|
3813
|
+
tmpl->Set(isolate, "DEPTH_STENCIL_ATTACHMENT", v8::Integer::NewFromUnsigned(isolate, 0x821A));
|
|
3814
|
+
|
|
3815
|
+
tmpl->Set(isolate, "DEPTH_STENCIL", v8::Integer::NewFromUnsigned(isolate, 0x84F9));
|
|
3816
|
+
tmpl->Set(isolate, "DEPTH24_STENCIL8", v8::Integer::NewFromUnsigned(isolate, 0x88F0));
|
|
3817
|
+
tmpl->Set(isolate, "DRAW_FRAMEBUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8CA6));
|
|
3818
|
+
tmpl->Set(isolate, "READ_FRAMEBUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8CA8));
|
|
3819
|
+
tmpl->Set(isolate, "DRAW_FRAMEBUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8CA9));
|
|
3820
|
+
|
|
3821
|
+
tmpl->Set(isolate, "READ_FRAMEBUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8CAA));
|
|
3822
|
+
tmpl->Set(isolate, "RENDERBUFFER_SAMPLES", v8::Integer::NewFromUnsigned(isolate, 0x8CAB));
|
|
3823
|
+
tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",
|
|
3824
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8CD4));
|
|
3825
|
+
tmpl->Set(isolate, "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",
|
|
3826
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8D56));
|
|
3827
|
+
tmpl->Set(isolate, "UNIFORM_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8A11));
|
|
3828
|
+
|
|
3829
|
+
tmpl->Set(isolate, "UNIFORM_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8A28));
|
|
3830
|
+
tmpl->Set(isolate, "UNIFORM_BUFFER_START", v8::Integer::NewFromUnsigned(isolate, 0x8A29));
|
|
3831
|
+
tmpl->Set(isolate, "UNIFORM_BUFFER_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A2A));
|
|
3832
|
+
tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_BLOCKS", v8::Integer::NewFromUnsigned(isolate, 0x8A2B));
|
|
3833
|
+
tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_BLOCKS",
|
|
3834
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A2D));
|
|
3835
|
+
|
|
3836
|
+
tmpl->Set(isolate, "MAX_COMBINED_UNIFORM_BLOCKS",
|
|
3837
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A2E));
|
|
3838
|
+
tmpl->Set(isolate, "MAX_UNIFORM_BUFFER_BINDINGS",
|
|
3839
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A2F));
|
|
3840
|
+
tmpl->Set(isolate, "MAX_UNIFORM_BLOCK_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A30));
|
|
3841
|
+
tmpl->Set(isolate, "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",
|
|
3842
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A31));
|
|
3980
3843
|
tmpl->Set(isolate, "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",
|
|
3981
|
-
v8::
|
|
3844
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A33));
|
|
3982
3845
|
|
|
3983
|
-
tmpl->Set(isolate, "UNIFORM_BUFFER_OFFSET_ALIGNMENT",
|
|
3984
|
-
|
|
3985
|
-
tmpl->Set(isolate, "
|
|
3986
|
-
tmpl->Set(isolate, "
|
|
3987
|
-
tmpl->Set(isolate, "
|
|
3846
|
+
tmpl->Set(isolate, "UNIFORM_BUFFER_OFFSET_ALIGNMENT",
|
|
3847
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A34));
|
|
3848
|
+
tmpl->Set(isolate, "ACTIVE_UNIFORM_BLOCKS", v8::Integer::NewFromUnsigned(isolate, 0x8A36));
|
|
3849
|
+
tmpl->Set(isolate, "UNIFORM_TYPE", v8::Integer::NewFromUnsigned(isolate, 0x8A37));
|
|
3850
|
+
tmpl->Set(isolate, "UNIFORM_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A38));
|
|
3851
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_INDEX", v8::Integer::NewFromUnsigned(isolate, 0x8A3A));
|
|
3988
3852
|
|
|
3989
|
-
tmpl->Set(isolate, "UNIFORM_OFFSET", v8::
|
|
3990
|
-
tmpl->Set(isolate, "UNIFORM_ARRAY_STRIDE", v8::
|
|
3991
|
-
tmpl->Set(isolate, "UNIFORM_MATRIX_STRIDE", v8::
|
|
3853
|
+
tmpl->Set(isolate, "UNIFORM_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8A3B));
|
|
3854
|
+
tmpl->Set(isolate, "UNIFORM_ARRAY_STRIDE", v8::Integer::NewFromUnsigned(isolate, 0x8A3C));
|
|
3855
|
+
tmpl->Set(isolate, "UNIFORM_MATRIX_STRIDE", v8::Integer::NewFromUnsigned(isolate, 0x8A3D));
|
|
3992
3856
|
|
|
3993
3857
|
/* Draw buffers */
|
|
3994
3858
|
|
|
3995
3859
|
/* Samplers */
|
|
3996
3860
|
|
|
3997
|
-
tmpl->Set(isolate, "UNIFORM_IS_ROW_MAJOR", v8::
|
|
3998
|
-
tmpl->Set(isolate, "UNIFORM_BLOCK_BINDING", v8::
|
|
3999
|
-
tmpl->Set(isolate, "UNIFORM_BLOCK_DATA_SIZE", v8::
|
|
4000
|
-
tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORMS",
|
|
4001
|
-
|
|
3861
|
+
tmpl->Set(isolate, "UNIFORM_IS_ROW_MAJOR", v8::Integer::NewFromUnsigned(isolate, 0x8A3E));
|
|
3862
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8A3F));
|
|
3863
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_DATA_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A40));
|
|
3864
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORMS",
|
|
3865
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A42));
|
|
3866
|
+
tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",
|
|
3867
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A43));
|
|
4002
3868
|
|
|
4003
3869
|
tmpl->Set(isolate, "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",
|
|
4004
|
-
v8::
|
|
3870
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A44));
|
|
4005
3871
|
tmpl->Set(isolate, "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",
|
|
4006
|
-
v8::
|
|
4007
|
-
tmpl->Set(isolate, "OBJECT_TYPE", v8::
|
|
4008
|
-
tmpl->Set(isolate, "SYNC_CONDITION", v8::
|
|
4009
|
-
tmpl->Set(isolate, "SYNC_STATUS", v8::
|
|
3872
|
+
v8::Integer::NewFromUnsigned(isolate, 0x8A46));
|
|
3873
|
+
tmpl->Set(isolate, "OBJECT_TYPE", v8::Integer::NewFromUnsigned(isolate, 0x9112));
|
|
3874
|
+
tmpl->Set(isolate, "SYNC_CONDITION", v8::Integer::NewFromUnsigned(isolate, 0x9113));
|
|
3875
|
+
tmpl->Set(isolate, "SYNC_STATUS", v8::Integer::NewFromUnsigned(isolate, 0x9114));
|
|
4010
3876
|
|
|
4011
|
-
tmpl->Set(isolate, "SYNC_FLAGS", v8::
|
|
4012
|
-
tmpl->Set(isolate, "SYNC_FENCE", v8::
|
|
4013
|
-
tmpl->Set(isolate, "SYNC_GPU_COMMANDS_COMPLETE", v8::
|
|
4014
|
-
tmpl->Set(isolate, "UNSIGNALED", v8::
|
|
4015
|
-
tmpl->Set(isolate, "SIGNALED", v8::
|
|
3877
|
+
tmpl->Set(isolate, "SYNC_FLAGS", v8::Integer::NewFromUnsigned(isolate, 0x9115));
|
|
3878
|
+
tmpl->Set(isolate, "SYNC_FENCE", v8::Integer::NewFromUnsigned(isolate, 0x9116));
|
|
3879
|
+
tmpl->Set(isolate, "SYNC_GPU_COMMANDS_COMPLETE", v8::Integer::NewFromUnsigned(isolate, 0x9117));
|
|
3880
|
+
tmpl->Set(isolate, "UNSIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x9118));
|
|
3881
|
+
tmpl->Set(isolate, "SIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x9119));
|
|
4016
3882
|
|
|
4017
3883
|
/* Samplers */
|
|
4018
3884
|
|
|
4019
3885
|
/* Buffers */
|
|
4020
3886
|
|
|
4021
|
-
tmpl->Set(isolate, "ALREADY_SIGNALED", v8::
|
|
4022
|
-
tmpl->Set(isolate, "TIMEOUT_EXPIRED", v8::
|
|
4023
|
-
tmpl->Set(isolate, "CONDITION_SATISFIED", v8::
|
|
4024
|
-
tmpl->Set(isolate, "WAIT_FAILED", v8::
|
|
4025
|
-
tmpl->Set(isolate, "SYNC_FLUSH_COMMANDS_BIT",
|
|
3887
|
+
tmpl->Set(isolate, "ALREADY_SIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x911A));
|
|
3888
|
+
tmpl->Set(isolate, "TIMEOUT_EXPIRED", v8::Integer::NewFromUnsigned(isolate, 0x911B));
|
|
3889
|
+
tmpl->Set(isolate, "CONDITION_SATISFIED", v8::Integer::NewFromUnsigned(isolate, 0x911C));
|
|
3890
|
+
tmpl->Set(isolate, "WAIT_FAILED", v8::Integer::NewFromUnsigned(isolate, 0x911D));
|
|
3891
|
+
tmpl->Set(isolate, "SYNC_FLUSH_COMMANDS_BIT",
|
|
3892
|
+
v8::Integer::NewFromUnsigned(isolate, 0x00000001));
|
|
4026
3893
|
|
|
4027
|
-
tmpl->Set(isolate, "COLOR", v8::
|
|
4028
|
-
tmpl->Set(isolate, "DEPTH", v8::
|
|
4029
|
-
tmpl->Set(isolate, "STENCIL", v8::
|
|
3894
|
+
tmpl->Set(isolate, "COLOR", v8::Integer::NewFromUnsigned(isolate, 0x1800));
|
|
3895
|
+
tmpl->Set(isolate, "DEPTH", v8::Integer::NewFromUnsigned(isolate, 0x1801));
|
|
3896
|
+
tmpl->Set(isolate, "STENCIL", v8::Integer::NewFromUnsigned(isolate, 0x1802));
|
|
4030
3897
|
|
|
4031
3898
|
/* Buffers */
|
|
4032
3899
|
|
|
4033
3900
|
/* Data types */
|
|
4034
3901
|
|
|
4035
|
-
tmpl->Set(isolate, "MIN", v8::
|
|
4036
|
-
tmpl->Set(isolate, "MAX", v8::
|
|
4037
|
-
tmpl->Set(isolate, "DEPTH_COMPONENT24", v8::
|
|
4038
|
-
tmpl->Set(isolate, "STREAM_READ", v8::
|
|
4039
|
-
tmpl->Set(isolate, "STREAM_COPY", v8::
|
|
3902
|
+
tmpl->Set(isolate, "MIN", v8::Integer::NewFromUnsigned(isolate, 0x8007));
|
|
3903
|
+
tmpl->Set(isolate, "MAX", v8::Integer::NewFromUnsigned(isolate, 0x8008));
|
|
3904
|
+
tmpl->Set(isolate, "DEPTH_COMPONENT24", v8::Integer::NewFromUnsigned(isolate, 0x81A6));
|
|
3905
|
+
tmpl->Set(isolate, "STREAM_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E1));
|
|
3906
|
+
tmpl->Set(isolate, "STREAM_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88E2));
|
|
4040
3907
|
|
|
4041
|
-
tmpl->Set(isolate, "STATIC_READ", v8::
|
|
4042
|
-
tmpl->Set(isolate, "STATIC_COPY", v8::
|
|
4043
|
-
tmpl->Set(isolate, "DYNAMIC_READ", v8::
|
|
4044
|
-
tmpl->Set(isolate, "DYNAMIC_COPY", v8::
|
|
4045
|
-
tmpl->Set(isolate, "DEPTH_COMPONENT32F", v8::
|
|
4046
|
-
tmpl->Set(isolate, "DEPTH32F_STENCIL8", v8::
|
|
3908
|
+
tmpl->Set(isolate, "STATIC_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E5));
|
|
3909
|
+
tmpl->Set(isolate, "STATIC_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88E6));
|
|
3910
|
+
tmpl->Set(isolate, "DYNAMIC_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E9));
|
|
3911
|
+
tmpl->Set(isolate, "DYNAMIC_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88EA));
|
|
3912
|
+
tmpl->Set(isolate, "DEPTH_COMPONENT32F", v8::Integer::NewFromUnsigned(isolate, 0x8CAC));
|
|
3913
|
+
tmpl->Set(isolate, "DEPTH32F_STENCIL8", v8::Integer::NewFromUnsigned(isolate, 0x8CAD));
|
|
4047
3914
|
|
|
4048
3915
|
/* Data types */
|
|
4049
3916
|
|
|
4050
|
-
tmpl->Set(isolate, "INVALID_INDEX", v8::
|
|
3917
|
+
tmpl->Set(isolate, "INVALID_INDEX", v8::Integer::NewFromUnsigned(isolate, 0xFFFFFFFF));
|
|
4051
3918
|
tmpl->Set(isolate, "TIMEOUT_IGNORED", v8::Int32::New(isolate, -1));
|
|
4052
3919
|
|
|
4053
3920
|
/* Vertex attributes */
|
|
4054
3921
|
|
|
4055
3922
|
/* Transform feedback */
|
|
4056
3923
|
|
|
4057
|
-
tmpl->Set(isolate, "MAX_CLIENT_WAIT_TIMEOUT_WEBGL",
|
|
3924
|
+
tmpl->Set(isolate, "MAX_CLIENT_WAIT_TIMEOUT_WEBGL",
|
|
3925
|
+
v8::Integer::NewFromUnsigned(isolate, 0x9247));
|
|
4058
3926
|
|
|
4059
3927
|
/* Transform feedback */
|
|
4060
3928
|
|