mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 21:21:17 +01:00
chore(webgpu): Replace JS bindings with Wagyu (#9986) c05ef4daaa
Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
This commit is contained in:
@@ -1 +1 @@
|
||||
de384615b2652731e266865534830d670fe4ae38
|
||||
c05ef4daaaaa9bda718cf748d5233f39ac9a93f2
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright 2023 Rive
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rive/rive_types.hpp"
|
||||
|
||||
#ifdef RIVE_DAWN
|
||||
#include <dawn/webgpu_cpp.h>
|
||||
#endif
|
||||
|
||||
#ifdef RIVE_WEBGPU
|
||||
#include <webgpu/webgpu_cpp.h>
|
||||
#include <emscripten.h>
|
||||
#include <emscripten/html5_webgpu.h>
|
||||
#endif
|
||||
|
||||
// RAII object that stores and releases a handle to a WebGPU object passed from
|
||||
// Javascript. Original source:
|
||||
// https://github.com/emscripten-core/emscripten/blob/08cca043d8ba313d774bec8153fab66b70a6fe60/test/webgpu_jsvalstore.cpp
|
||||
class EmJsHandle
|
||||
{
|
||||
public:
|
||||
EmJsHandle() : m_handle(0) {}
|
||||
explicit EmJsHandle(int handle) : m_handle(handle) {}
|
||||
~EmJsHandle();
|
||||
|
||||
EmJsHandle(const EmJsHandle&) = delete;
|
||||
EmJsHandle& operator=(const EmJsHandle&) = delete;
|
||||
|
||||
EmJsHandle(EmJsHandle&& rhs) : m_handle(rhs.m_handle) { rhs.m_handle = 0; }
|
||||
EmJsHandle& operator=(EmJsHandle&& rhs);
|
||||
|
||||
int get() const { return m_handle; }
|
||||
|
||||
wgpu::ShaderModule compileSPIRVShaderModule(wgpu::Device device,
|
||||
const uint32_t* code,
|
||||
uint32_t codeSize);
|
||||
|
||||
wgpu::ShaderModule compileShaderModule(wgpu::Device device,
|
||||
const char* language,
|
||||
const char* source);
|
||||
|
||||
private:
|
||||
int m_handle;
|
||||
};
|
||||
@@ -5,11 +5,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "rive/renderer/render_context_helper_impl.hpp"
|
||||
#include "rive/renderer/webgpu/em_js_handle.hpp"
|
||||
#include "rive/renderer/gl/load_store_actions_ext.hpp"
|
||||
#include <map>
|
||||
#include <webgpu/webgpu_cpp.h>
|
||||
|
||||
#ifdef RIVE_WAGYU
|
||||
#include "rive/renderer/gl/load_store_actions_ext.hpp"
|
||||
#endif
|
||||
|
||||
namespace rive::gpu
|
||||
{
|
||||
class RenderContextWebGPUVulkan;
|
||||
@@ -24,6 +26,7 @@ public:
|
||||
// effort to draw shapes.
|
||||
none,
|
||||
|
||||
#ifdef RIVE_WAGYU
|
||||
// Backend is OpenGL ES 3.1+ and has GL_EXT_shader_pixel_local_storage.
|
||||
// Use "raw-glsl" shaders that take advantage of the extension.
|
||||
EXT_shader_pixel_local_storage,
|
||||
@@ -32,12 +35,15 @@ public:
|
||||
// Use nonstandard WebGPU APIs to set up vulkan input attachments and
|
||||
// subpassLoad() in shaders.
|
||||
subpassLoad,
|
||||
#endif
|
||||
};
|
||||
|
||||
struct ContextOptions
|
||||
{
|
||||
PixelLocalStorageType plsType = PixelLocalStorageType::none;
|
||||
#ifdef RIVE_WAGYU
|
||||
bool disableStorageBuffers = false;
|
||||
#endif
|
||||
// Invert Y when drawing to client-provided RenderTargets.
|
||||
// TODO: We may need to eventually make this configurable
|
||||
// per-RenderTarget.
|
||||
@@ -70,29 +76,17 @@ protected:
|
||||
wgpu::Queue queue,
|
||||
const ContextOptions&);
|
||||
|
||||
// Create the BindGroupLayout that binds the PLS attachments as textures.
|
||||
// This is not necessary on all implementations.
|
||||
virtual wgpu::BindGroupLayout initTextureBindGroup()
|
||||
{
|
||||
// Only supported by RenderContextWebGPUVulkan for now.
|
||||
RIVE_UNREACHABLE();
|
||||
}
|
||||
|
||||
// Create a standard PLS "draw" pipeline for the current implementation.
|
||||
virtual wgpu::RenderPipeline makeDrawPipeline(
|
||||
rive::gpu::DrawType drawType,
|
||||
wgpu::TextureFormat framebufferFormat,
|
||||
wgpu::ShaderModule vertexShader,
|
||||
wgpu::ShaderModule fragmentShader,
|
||||
EmJsHandle* pipelineJSHandleIfNeeded);
|
||||
wgpu::RenderPipeline makeDrawPipeline(rive::gpu::DrawType drawType,
|
||||
wgpu::TextureFormat framebufferFormat,
|
||||
wgpu::ShaderModule vertexShader,
|
||||
wgpu::ShaderModule fragmentShader);
|
||||
|
||||
// Create a standard PLS "draw" render pass for the current implementation.
|
||||
virtual wgpu::RenderPassEncoder makePLSRenderPass(
|
||||
wgpu::CommandEncoder,
|
||||
const RenderTargetWebGPU*,
|
||||
wgpu::LoadOp,
|
||||
const wgpu::Color& clearColor,
|
||||
EmJsHandle* renderPassJSHandleIfNeeded);
|
||||
wgpu::RenderPassEncoder makePLSRenderPass(wgpu::CommandEncoder,
|
||||
const RenderTargetWebGPU*,
|
||||
wgpu::LoadOp,
|
||||
const wgpu::Color& clearColor);
|
||||
|
||||
wgpu::Device device() const { return m_device; }
|
||||
const ContextOptions& contextOptions() const { return m_contextOptions; }
|
||||
@@ -142,13 +136,14 @@ private:
|
||||
std::array<wgpu::BindGroupLayoutEntry, DRAW_BINDINGS_COUNT>
|
||||
m_perFlushBindingLayouts;
|
||||
|
||||
#ifdef RIVE_WAGYU
|
||||
// Draws emulated render-pass load/store actions for
|
||||
// EXT_shader_pixel_local_storage.
|
||||
class LoadStoreEXTPipeline;
|
||||
std::map<LoadStoreActionsEXT, LoadStoreEXTPipeline> m_loadStoreEXTPipelines;
|
||||
EmJsHandle m_loadStoreEXTVertexShaderHandle;
|
||||
wgpu::ShaderModule m_loadStoreEXTVertexShader;
|
||||
std::unique_ptr<BufferRing> m_loadStoreEXTUniforms;
|
||||
#endif
|
||||
|
||||
// Blits texture-to-texture using a draw command.
|
||||
class BlitTextureAsDrawPipeline;
|
||||
@@ -212,8 +207,7 @@ private:
|
||||
const RenderContextWebGPUImpl::ContextOptions&,
|
||||
wgpu::TextureFormat framebufferFormat,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
wgpu::TextureUsage additionalTextureFlags);
|
||||
uint32_t height);
|
||||
|
||||
const wgpu::TextureFormat m_framebufferFormat;
|
||||
|
||||
|
||||
@@ -195,34 +195,6 @@ if _OPTIONS['with-webgpu'] or _OPTIONS['with-dawn'] then
|
||||
files({
|
||||
'webgpu_player/webgpu_player.cpp',
|
||||
'webgpu_player/index.html',
|
||||
'webgpu_player/icons.html',
|
||||
'webgpu_player/rive.js',
|
||||
'webgpu_player/rivs/Santa_Claus.riv',
|
||||
'webgpu_player/rivs/Coffee_Cup.riv',
|
||||
'webgpu_player/rivs/skull_404.riv',
|
||||
'webgpu_player/rivs/octopus_loop.riv',
|
||||
'webgpu_player/rivs/planets.riv',
|
||||
'webgpu_player/rivs/Timer.riv',
|
||||
'webgpu_player/rivs/adventuretime_marceline-pb.riv',
|
||||
'webgpu_player/rivs/towersDemo.riv',
|
||||
'webgpu_player/rivs/skills_demov1.riv',
|
||||
'webgpu_player/rivs/car_demo.riv',
|
||||
'webgpu_player/rivs/cloud_icon.riv',
|
||||
'webgpu_player/rivs/coffee_loader.riv',
|
||||
'webgpu_player/rivs/documentation.riv',
|
||||
'webgpu_player/rivs/fire_button.riv',
|
||||
'webgpu_player/rivs/lumberjackfinal.riv',
|
||||
'webgpu_player/rivs/mail_box.riv',
|
||||
'webgpu_player/rivs/new_file.riv',
|
||||
'webgpu_player/rivs/poison_loader.riv',
|
||||
'webgpu_player/rivs/popsicle_loader.riv',
|
||||
'webgpu_player/rivs/radio_button_example.riv',
|
||||
'webgpu_player/rivs/avatar_demo.riv',
|
||||
'webgpu_player/rivs/stopwatch.riv',
|
||||
'webgpu_player/rivs/volume_bars.riv',
|
||||
'webgpu_player/rivs/travel_icons.riv',
|
||||
'webgpu_player/rivs/falling.riv',
|
||||
'webgpu_player/rivs/tape.riv',
|
||||
})
|
||||
|
||||
links({
|
||||
@@ -300,11 +272,12 @@ if _OPTIONS['with-webgpu'] or _OPTIONS['with-dawn'] then
|
||||
do
|
||||
targetname('webgpu_player.js')
|
||||
linkoptions({
|
||||
'-sEXPORTED_FUNCTIONS=_RiveInitialize,_RiveBeginRendering,_RiveFlushRendering,_RiveLoadFile,_File_artboardNamed,_File_artboardDefault,_File_destroy,_ArtboardInstance_width,_ArtboardInstance_height,_ArtboardInstance_stateMachineNamed,_ArtboardInstance_animationNamed,_ArtboardInstance_defaultStateMachine,_ArtboardInstance_align,_ArtboardInstance_destroy,_StateMachineInstance_setBool,_StateMachineInstance_setNumber,_StateMachineInstance_fireTrigger,_StateMachineInstance_pointerDown,_StateMachineInstance_pointerMove,_StateMachineInstance_pointerUp,_StateMachineInstance_advanceAndApply,_StateMachineInstance_draw,_StateMachineInstance_destroy,_LinearAnimationInstance_advanceAndApply,_LinearAnimationInstance_draw,_LinearAnimationInstance_destroy,_Renderer_save,_Renderer_restore,_Renderer_translate,_Renderer_transform,_malloc,_free',
|
||||
'-sEXPORTED_FUNCTIONS=_animationFrame,_main,_start,_malloc,_free',
|
||||
'-sEXPORTED_RUNTIME_METHODS=ccall,cwrap',
|
||||
'-sSINGLE_FILE',
|
||||
'-sUSE_WEBGPU',
|
||||
'-sENVIRONMENT=web,shell',
|
||||
'-sWARN_ON_UNDEFINED_SYMBOLS=0',
|
||||
'-sERROR_ON_UNDEFINED_SYMBOLS=0',
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
@@ -50,6 +50,15 @@ do
|
||||
defines({ 'RIVE_DAWN' })
|
||||
end
|
||||
|
||||
newoption({
|
||||
trigger = 'with_wagyu',
|
||||
description = 'compile in support for wagyu webgpu extensions',
|
||||
})
|
||||
filter({ 'options:with_wagyu' })
|
||||
do
|
||||
defines({ 'RIVE_WAGYU' })
|
||||
end
|
||||
|
||||
newoption({
|
||||
trigger = 'with-webgpu',
|
||||
description = 'compile in native support for webgpu',
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* Copyright 2023 Rive
|
||||
*/
|
||||
|
||||
#include "rive/renderer/webgpu/em_js_handle.hpp"
|
||||
|
||||
EmJsHandle& EmJsHandle::operator=(EmJsHandle&& rhs)
|
||||
{
|
||||
int tmp = rhs.m_handle;
|
||||
rhs.m_handle = this->m_handle;
|
||||
this->m_handle = tmp;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifdef RIVE_DAWN
|
||||
EmJsHandle::~EmJsHandle() { assert(m_handle == 0); }
|
||||
|
||||
wgpu::ShaderModule EmJsHandle::compileShaderModule(wgpu::Device device,
|
||||
const char* language,
|
||||
const char* source)
|
||||
{
|
||||
RIVE_UNREACHABLE();
|
||||
}
|
||||
|
||||
wgpu::ShaderModule EmJsHandle::compileSPIRVShaderModule(wgpu::Device device,
|
||||
const uint32_t* code,
|
||||
uint32_t codeSize)
|
||||
{
|
||||
wgpu::ShaderModuleSPIRVDescriptor spirvDesc;
|
||||
spirvDesc.code = code;
|
||||
spirvDesc.codeSize = codeSize;
|
||||
wgpu::ShaderModuleDescriptor descriptor;
|
||||
descriptor.nextInChain = &spirvDesc;
|
||||
return device.CreateShaderModule(&descriptor);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef RIVE_WEBGPU
|
||||
EmJsHandle::~EmJsHandle()
|
||||
{
|
||||
if (m_handle != 0)
|
||||
{
|
||||
emscripten_webgpu_release_js_handle(m_handle);
|
||||
}
|
||||
}
|
||||
|
||||
EM_JS(int,
|
||||
compile_glsl_shader_module_js,
|
||||
(int device, const char* language, const char* source),
|
||||
{
|
||||
device = JsValStore.get(device);
|
||||
language = UTF8ToString(language);
|
||||
source = UTF8ToString(source);
|
||||
const shader = device.createShaderModule({
|
||||
language : language,
|
||||
code : source,
|
||||
});
|
||||
return JsValStore.add(shader);
|
||||
});
|
||||
|
||||
wgpu::ShaderModule EmJsHandle::compileShaderModule(wgpu::Device device,
|
||||
const char* language,
|
||||
const char* source)
|
||||
{
|
||||
m_handle = compile_glsl_shader_module_js(
|
||||
emscripten_webgpu_export_device(device.Get()),
|
||||
source,
|
||||
language);
|
||||
return wgpu::ShaderModule::Acquire(
|
||||
emscripten_webgpu_import_shader_module(m_handle));
|
||||
}
|
||||
|
||||
EM_JS(int,
|
||||
compile_spirv_shader_module_js,
|
||||
(int device, uintptr_t indexU32, uint32_t codeSize),
|
||||
{
|
||||
device = JsValStore.get(device);
|
||||
// Copy data off the WASM heap before sending it to WebGPU bindings.
|
||||
const code = new Uint32Array(codeSize);
|
||||
code.set(Module.HEAPU32.subarray(indexU32, indexU32 + codeSize));
|
||||
const shader = device.createShaderModule({
|
||||
language : "spirv",
|
||||
code : code,
|
||||
});
|
||||
return JsValStore.add(shader);
|
||||
});
|
||||
|
||||
wgpu::ShaderModule EmJsHandle::compileSPIRVShaderModule(wgpu::Device device,
|
||||
const uint32_t* code,
|
||||
uint32_t codeSize)
|
||||
{
|
||||
assert(reinterpret_cast<uintptr_t>(code) % sizeof(uint32_t) == 0);
|
||||
m_handle = compile_spirv_shader_module_js(
|
||||
emscripten_webgpu_export_device(device.Get()),
|
||||
reinterpret_cast<uintptr_t>(code) / sizeof(uint32_t),
|
||||
codeSize);
|
||||
return wgpu::ShaderModule::Acquire(
|
||||
emscripten_webgpu_import_shader_module(m_handle));
|
||||
}
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,344 +0,0 @@
|
||||
/*
|
||||
* Copyright 2023 Rive
|
||||
*/
|
||||
|
||||
#ifdef RIVE_WEBGPU
|
||||
|
||||
#include "render_context_webgpu_vulkan.hpp"
|
||||
|
||||
#include "shaders/constants.glsl"
|
||||
|
||||
#include <webgpu/webgpu_cpp.h>
|
||||
#include <emscripten.h>
|
||||
#include <emscripten/html5_webgpu.h>
|
||||
|
||||
namespace rive::gpu
|
||||
{
|
||||
// Create a group for binding PLS textures as Vulkan input attachments. The
|
||||
// "inputTexture" property is nonstandard WebGPU.
|
||||
EM_JS(int, make_pls_input_attachment_texture_bind_group, (int device), {
|
||||
device = JsValStore.get(device);
|
||||
const plsBindBroupLayout = device.createBindGroupLayout({
|
||||
entries : [
|
||||
{
|
||||
binding : 0,
|
||||
visibility : GPUShaderStage.FRAGMENT,
|
||||
inputTexture : {viewDimension : "2d"},
|
||||
},
|
||||
{
|
||||
binding : 1,
|
||||
visibility : GPUShaderStage.FRAGMENT,
|
||||
inputTexture : {viewDimension : "2d"},
|
||||
},
|
||||
{
|
||||
binding : 2,
|
||||
visibility : GPUShaderStage.FRAGMENT,
|
||||
inputTexture : {viewDimension : "2d"},
|
||||
},
|
||||
{
|
||||
binding : 3,
|
||||
visibility : GPUShaderStage.FRAGMENT,
|
||||
inputTexture : {viewDimension : "2d"},
|
||||
},
|
||||
]
|
||||
});
|
||||
return JsValStore.add(plsBindBroupLayout);
|
||||
});
|
||||
|
||||
wgpu::BindGroupLayout RenderContextWebGPUVulkan::initTextureBindGroup()
|
||||
{
|
||||
m_plsTextureBindGroupJSHandle =
|
||||
EmJsHandle(make_pls_input_attachment_texture_bind_group(
|
||||
emscripten_webgpu_export_device(device().Get())));
|
||||
return wgpu::BindGroupLayout::Acquire(
|
||||
emscripten_webgpu_import_bind_group_layout(
|
||||
m_plsTextureBindGroupJSHandle.get()));
|
||||
}
|
||||
|
||||
// The "TRANSIENT_ATTACHMENT" and "INPUT_ATTACHMENT" flags are nonstandard
|
||||
// WebGPU.
|
||||
EM_JS(int, texture_usage_transient_input_attachment, (), {
|
||||
return GPUTextureUsage.TRANSIENT_ATTACHMENT |
|
||||
GPUTextureUsage.INPUT_ATTACHMENT;
|
||||
});
|
||||
|
||||
rcp<RenderTargetWebGPU> RenderContextWebGPUVulkan::makeRenderTarget(
|
||||
wgpu::TextureFormat framebufferFormat,
|
||||
uint32_t width,
|
||||
uint32_t height)
|
||||
{
|
||||
return rcp(new RenderTargetWebGPU(
|
||||
device(),
|
||||
contextOptions(),
|
||||
framebufferFormat,
|
||||
width,
|
||||
height,
|
||||
static_cast<wgpu::TextureUsage>(
|
||||
texture_usage_transient_input_attachment())));
|
||||
}
|
||||
|
||||
// Create a standard PLS "draw" pipeline that uses Vulkan input attachments and
|
||||
// VK_EXT_rasterization_order_attachment_access for pixel local storage. The
|
||||
// "inputs" and "features" properties on GPUFragmentState, and the "usedAsInput"
|
||||
// property on GPUColorTargetState are nonstandard WebGPU.
|
||||
EM_JS(int,
|
||||
make_pls_draw_pipeline,
|
||||
(int device,
|
||||
rive::gpu::DrawType drawType,
|
||||
wgpu::TextureFormat framebufferFormat,
|
||||
int vertexShader,
|
||||
int fragmentShader,
|
||||
int pipelineLayout,
|
||||
bool clockwiseFrontFace),
|
||||
{
|
||||
device = JsValStore.get(device);
|
||||
vertexShader = JsValStore.get(vertexShader);
|
||||
fragmentShader = JsValStore.get(fragmentShader);
|
||||
pipelineLayout = JsValStore.get(pipelineLayout);
|
||||
|
||||
const RGBA8_UNORM = 0x00000012;
|
||||
const BGRA8_UNORM = 0x00000017;
|
||||
switch (framebufferFormat)
|
||||
{
|
||||
case RGBA8_UNORM:
|
||||
framebufferFormat = "rgba8unorm";
|
||||
break;
|
||||
case BGRA8_UNORM:
|
||||
framebufferFormat = "bgra8unorm";
|
||||
break;
|
||||
default:
|
||||
throw "unsupported framebuffer format " + framebufferFormat;
|
||||
}
|
||||
|
||||
let vertexBufferLayout;
|
||||
switch (drawType)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
attrs = [
|
||||
{
|
||||
format : "float32x4",
|
||||
offset : 0,
|
||||
shaderLocation : 0,
|
||||
},
|
||||
{
|
||||
format : "float32x4",
|
||||
offset : 4 * 4,
|
||||
shaderLocation : 1,
|
||||
},
|
||||
];
|
||||
vertexBufferLayouts = [
|
||||
{
|
||||
arrayStride : 4 * 8,
|
||||
stepMode : "vertex",
|
||||
attributes : attrs,
|
||||
},
|
||||
];
|
||||
break;
|
||||
case 2:
|
||||
attrs = [
|
||||
{
|
||||
format : "float32x3",
|
||||
offset : 0,
|
||||
shaderLocation : 0,
|
||||
},
|
||||
];
|
||||
|
||||
vertexBufferLayouts = [
|
||||
{
|
||||
arrayStride : 4 * 3,
|
||||
stepMode : "vertex",
|
||||
attributes : attrs,
|
||||
},
|
||||
];
|
||||
break;
|
||||
case 3:
|
||||
attrs = [
|
||||
{
|
||||
format : "float32x2",
|
||||
offset : 0,
|
||||
shaderLocation : 0,
|
||||
},
|
||||
{
|
||||
format : "float32x2",
|
||||
offset : 0,
|
||||
shaderLocation : 1,
|
||||
},
|
||||
];
|
||||
|
||||
vertexBufferLayouts = [
|
||||
{
|
||||
arrayStride : 4 * 2,
|
||||
stepMode : "vertex",
|
||||
attributes : [attrs[0]],
|
||||
},
|
||||
{
|
||||
arrayStride : 4 * 2,
|
||||
stepMode : "vertex",
|
||||
attributes : [attrs[1]],
|
||||
},
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
const pipelineDesc = {
|
||||
vertex : {
|
||||
module : vertexShader,
|
||||
entryPoint : "main",
|
||||
buffers : vertexBufferLayouts,
|
||||
},
|
||||
fragment : {
|
||||
module : fragmentShader,
|
||||
entryPoint : "main",
|
||||
inputs : [
|
||||
{format : framebufferFormat, usedAsColor : true},
|
||||
{format : "r32uint", usedAsColor : true},
|
||||
{format : framebufferFormat, usedAsColor : true},
|
||||
{format : "r32uint", usedAsColor : true},
|
||||
],
|
||||
targets : [
|
||||
{format : framebufferFormat, usedAsInput : true},
|
||||
{format : "r32uint", usedAsInput : true},
|
||||
{format : framebufferFormat, usedAsInput : true},
|
||||
{format : "r32uint", usedAsInput : true},
|
||||
],
|
||||
features : GPUFragmentStateFeatures
|
||||
.RASTERIZATION_ORDER_ATTACHMENT_ACCESS,
|
||||
},
|
||||
primitive : {
|
||||
topology : "triangle-list",
|
||||
frontFace : clockwiseFrontFace ? "cw" : "ccw",
|
||||
cullMode : drawType != 3 ? "back" : "none"
|
||||
},
|
||||
layout : pipelineLayout
|
||||
};
|
||||
|
||||
const pipeline = device.createRenderPipeline(pipelineDesc);
|
||||
return JsValStore.add(pipeline);
|
||||
});
|
||||
|
||||
wgpu::RenderPipeline RenderContextWebGPUVulkan::makeDrawPipeline(
|
||||
rive::gpu::DrawType drawType,
|
||||
wgpu::TextureFormat framebufferFormat,
|
||||
wgpu::ShaderModule vertexShader,
|
||||
wgpu::ShaderModule fragmentShader,
|
||||
EmJsHandle* pipelineJSHandleIfNeeded)
|
||||
{
|
||||
*pipelineJSHandleIfNeeded = EmJsHandle(make_pls_draw_pipeline(
|
||||
emscripten_webgpu_export_device(device().Get()),
|
||||
drawType,
|
||||
framebufferFormat,
|
||||
emscripten_webgpu_export_shader_module(vertexShader.Get()),
|
||||
emscripten_webgpu_export_shader_module(fragmentShader.Get()),
|
||||
emscripten_webgpu_export_pipeline_layout(drawPipelineLayout().Get()),
|
||||
frontFaceForRenderTargetDraws() == wgpu::FrontFace::CW));
|
||||
static_assert(COLOR_PLANE_IDX == 0);
|
||||
static_assert(CLIP_PLANE_IDX == 1);
|
||||
static_assert(SCRATCH_COLOR_PLANE_IDX == 2);
|
||||
static_assert(COVERAGE_PLANE_IDX == 3);
|
||||
return wgpu::RenderPipeline::Acquire(
|
||||
emscripten_webgpu_import_render_pipeline(
|
||||
pipelineJSHandleIfNeeded->get()));
|
||||
}
|
||||
|
||||
// Create a standard PLS "draw" render pass that uses Vulkan input attachments
|
||||
// for pixel local storage. The "inputAttachments" property on
|
||||
// GPURenderPassDescriptor is nonstandard WebGPU.
|
||||
EM_JS(int,
|
||||
make_pls_render_pass,
|
||||
(int encoder,
|
||||
int tex0,
|
||||
int tex1,
|
||||
int tex2,
|
||||
int tex3,
|
||||
wgpu::LoadOp loadOp,
|
||||
double r,
|
||||
double g,
|
||||
double b,
|
||||
double a),
|
||||
{
|
||||
encoder = JsValStore.get(encoder);
|
||||
tex0 = JsValStore.get(tex0);
|
||||
tex1 = JsValStore.get(tex1);
|
||||
tex2 = JsValStore.get(tex2);
|
||||
tex3 = JsValStore.get(tex3);
|
||||
|
||||
const CLEAR = 1;
|
||||
const LOAD = 2;
|
||||
switch (loadOp)
|
||||
{
|
||||
case CLEAR:
|
||||
loadOp = "clear";
|
||||
break;
|
||||
case LOAD:
|
||||
loadOp = "load";
|
||||
break;
|
||||
default:
|
||||
throw "unsupported framebuffer format " + framebufferFormat;
|
||||
}
|
||||
|
||||
const zero = {r : 0, g : 0, b : 0, a : 0};
|
||||
const plsAttachments = [
|
||||
{
|
||||
view : tex0,
|
||||
loadOp : loadOp,
|
||||
storeOp : "store",
|
||||
clearValue : {r : r, g : g, b : b, a : a},
|
||||
},
|
||||
{
|
||||
view : tex1,
|
||||
loadOp : "clear",
|
||||
storeOp : "discard",
|
||||
clearValue : zero,
|
||||
},
|
||||
{
|
||||
view : tex2,
|
||||
loadOp : "clear",
|
||||
storeOp : "discard",
|
||||
clearValue : zero,
|
||||
},
|
||||
{
|
||||
view : tex3,
|
||||
loadOp : "clear",
|
||||
storeOp : "discard",
|
||||
clearValue : zero,
|
||||
},
|
||||
];
|
||||
|
||||
const renderPass = encoder.beginRenderPass({
|
||||
inputAttachments : plsAttachments,
|
||||
colorAttachments : plsAttachments,
|
||||
});
|
||||
|
||||
return JsValStore.add(renderPass);
|
||||
});
|
||||
|
||||
wgpu::RenderPassEncoder RenderContextWebGPUVulkan::makePLSRenderPass(
|
||||
wgpu::CommandEncoder encoder,
|
||||
const RenderTargetWebGPU* renderTarget,
|
||||
wgpu::LoadOp loadOp,
|
||||
const wgpu::Color& clearColor,
|
||||
EmJsHandle* renderPassJSHandleIfNeeded)
|
||||
{
|
||||
*renderPassJSHandleIfNeeded = EmJsHandle(make_pls_render_pass(
|
||||
emscripten_webgpu_export_command_encoder(encoder.Get()),
|
||||
emscripten_webgpu_export_texture_view(
|
||||
renderTarget->m_targetTextureView.Get()),
|
||||
emscripten_webgpu_export_texture_view(
|
||||
renderTarget->m_coverageTextureView.Get()),
|
||||
emscripten_webgpu_export_texture_view(
|
||||
renderTarget->m_clipTextureView.Get()),
|
||||
emscripten_webgpu_export_texture_view(
|
||||
renderTarget->m_scratchColorTextureView.Get()),
|
||||
loadOp,
|
||||
clearColor.r,
|
||||
clearColor.g,
|
||||
clearColor.b,
|
||||
clearColor.a));
|
||||
return wgpu::RenderPassEncoder::Acquire(
|
||||
emscripten_webgpu_import_render_pass_encoder(
|
||||
renderPassJSHandleIfNeeded->get()));
|
||||
}
|
||||
} // namespace rive::gpu
|
||||
|
||||
#endif
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright 2023 Rive
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef RIVE_WEBGPU
|
||||
|
||||
#include "rive/renderer/webgpu/render_context_webgpu_impl.hpp"
|
||||
|
||||
namespace rive::gpu
|
||||
{
|
||||
// WebGPU implementation that uses Vulkan input attachments,
|
||||
// VK_EXT_rasterization_order_attachment_access, and subpassLoad() for pixel
|
||||
// local storage. These Vulkan features are accessed via nonstandard WebGPU
|
||||
// APIs.
|
||||
class RenderContextWebGPUVulkan : public RenderContextWebGPUImpl
|
||||
{
|
||||
public:
|
||||
rcp<RenderTargetWebGPU> makeRenderTarget(wgpu::TextureFormat,
|
||||
uint32_t width,
|
||||
uint32_t height) override;
|
||||
|
||||
protected:
|
||||
wgpu::BindGroupLayout initTextureBindGroup() override;
|
||||
|
||||
wgpu::RenderPipeline makeDrawPipeline(
|
||||
rive::gpu::DrawType drawType,
|
||||
wgpu::TextureFormat framebufferFormat,
|
||||
wgpu::ShaderModule vertexShader,
|
||||
wgpu::ShaderModule fragmentShader,
|
||||
EmJsHandle* pipelineJSHandleIfNeeded) override;
|
||||
|
||||
wgpu::RenderPassEncoder makePLSRenderPass(
|
||||
wgpu::CommandEncoder,
|
||||
const RenderTargetWebGPU*,
|
||||
wgpu::LoadOp,
|
||||
const wgpu::Color& clearColor,
|
||||
EmJsHandle* renderPassJSHandleIfNeeded) override;
|
||||
|
||||
private:
|
||||
friend class RenderContextWebGPUImpl;
|
||||
|
||||
RenderContextWebGPUVulkan(wgpu::Device device,
|
||||
wgpu::Queue queue,
|
||||
const ContextOptions& contextOptions) :
|
||||
RenderContextWebGPUImpl(device, queue, contextOptions)
|
||||
{
|
||||
assert(contextOptions.plsType == PixelLocalStorageType::subpassLoad);
|
||||
m_platformFeatures.supportsRasterOrdering = true;
|
||||
}
|
||||
|
||||
EmJsHandle m_plsTextureBindGroupJSHandle;
|
||||
};
|
||||
} // namespace rive::gpu
|
||||
|
||||
#endif
|
||||
818
renderer/src/webgpu/wagyu_extensions.h
Normal file
818
renderer/src/webgpu/wagyu_extensions.h
Normal file
@@ -0,0 +1,818 @@
|
||||
#ifndef WAGYU_EXTENSIONS_H
|
||||
#define WAGYU_EXTENSIONS_H
|
||||
|
||||
#include "webgpu/webgpu.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if __cplusplus >= 201103L
|
||||
#define WAGYU_MAKE_INIT_STRUCT(type, value) (type value)
|
||||
#else
|
||||
#define WAGYU_MAKE_INIT_STRUCT(type, value) value
|
||||
#endif
|
||||
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#define WAGYU_MAKE_INIT_STRUCT(type, value) ((type)value)
|
||||
#else
|
||||
#define WAGYU_MAKE_INIT_STRUCT(type, value) value
|
||||
#endif
|
||||
|
||||
#define WAGYU_CHAIN_INIT(sType) \
|
||||
WAGYU_MAKE_INIT_STRUCT(WGPUChainedStruct, \
|
||||
{/*.next = */ NULL WGPU_COMMA /*.sType = */ ( \
|
||||
WGPUSType) sType WGPU_COMMA})
|
||||
|
||||
// this should be equivalent to the type of the same name in the new webgpu.h
|
||||
#if !defined(WGPUOptionalBool)
|
||||
#define WGPUOptionalBool int32_t
|
||||
#define WGPUOptionalBool_False 0x00000000
|
||||
#define WGPUOptionalBool_True 0x00000001
|
||||
#define WGPUOptionalBool_Undefined 0x00000002
|
||||
#define WGPUOptionalBool_Force32 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
#define WAGYU_STRLEN SIZE_MAX
|
||||
|
||||
#if defined(USE_WAGYU_NAMESPACE) || defined(__cppcheck)
|
||||
namespace wagyu1
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef struct WagyuRelaxedComplianceImpl* WagyuRelaxedCompliance
|
||||
WGPU_OBJECT_ATTRIBUTE;
|
||||
typedef struct WagyuExternalTextureImpl* WagyuExternalTexture
|
||||
WGPU_OBJECT_ATTRIBUTE;
|
||||
|
||||
typedef enum WagyuDeviceFlushStatus
|
||||
{
|
||||
WagyuDeviceFlushStatus_Success = 0x00000000,
|
||||
WagyuDeviceFlushStatus_Error = 0x00000001,
|
||||
WagyuDeviceFlushStatus_Force32 = 0x7FFFFFFF
|
||||
} WagyuDeviceFlushStatus WGPU_ENUM_ATTRIBUTE;
|
||||
|
||||
typedef enum WagyuSType
|
||||
{
|
||||
// reserved range for wagyu (Netflix) starts at 0x00060000
|
||||
WagyuSType_ExternalTextureBindingEntry = 0x00060000,
|
||||
WagyuSType_ExternalTextureBindingLayout = 0x00060001,
|
||||
WagyuSType_InputTextureBindingLayout = 0x00060002, // FIX - is this needed?
|
||||
WagyuSType_ColorTargetState = 0x00060003,
|
||||
WagyuSType_FragmentState = 0x00060004,
|
||||
WagyuSType_TextureDescriptor = 0x00060005,
|
||||
WagyuSType_ShaderModuleDescriptor = 0x00060006,
|
||||
WagyuSType_CommandEncoderDescriptor = 0x00060007,
|
||||
WagyuSType_ComputePipelineDescriptor = 0x00060008,
|
||||
WagyuSType_DeviceDescriptor = 0x00060009,
|
||||
WagyuSType_RenderPipelineDescriptor = 0x0006000A,
|
||||
WagyuSType_RenderPassDescriptor = 0x0006000B,
|
||||
WagyuSType_SurfaceConfiguration = 0x0006000C,
|
||||
WagyuSType_Force32 = 0x7FFFFFFF
|
||||
} WagyuSType WGPU_ENUM_ATTRIBUTE;
|
||||
|
||||
typedef enum WagyuPredefinedColorSpace
|
||||
{
|
||||
WagyuPredefinedColorSpace_SRGB = 0x00000001,
|
||||
WagyuPredefinedColorSpace_DisplayP3 = 0x00000002,
|
||||
WagyuPredefinedColorSpace_Force32 = 0x7FFFFFFF
|
||||
} WagyuPredefinedColorSpace WGPU_ENUM_ATTRIBUTE;
|
||||
|
||||
typedef enum WagyuShaderLanguage
|
||||
{
|
||||
WagyuShaderLanguage_Detect = 0x00000000,
|
||||
WagyuShaderLanguage_GLSL = 0x00000001,
|
||||
WagyuShaderLanguage_GLSLRAW = 0x00000002,
|
||||
WagyuShaderLanguage_WGSL = 0x00000003,
|
||||
WagyuShaderLanguage_SPIRV = 0x00000004,
|
||||
WagyuShaderLanguage_Force32 = 0x7FFFFFFF
|
||||
} WagyuShaderLanguage WGPU_ENUM_ATTRIBUTE;
|
||||
|
||||
typedef enum WagyuWGSLFeatureType
|
||||
{
|
||||
WagyuWGSLFeatureType_Testing = 0x00000000,
|
||||
WagyuWGSLFeatureType_UnsafeExperimental = 0x00000001,
|
||||
WagyuWGSLFeatureType_Experimental = 0x00000002,
|
||||
WagyuWGSLFeatureType_All = 0x00000003,
|
||||
WagyuWGSLFeatureType_Force32 = 0x7FFFFFFF
|
||||
} WagyuWGSLFeatureType WGPU_ENUM_ATTRIBUTE;
|
||||
|
||||
typedef WGPUFlags WagyuFragmentStateFeaturesFlags;
|
||||
static const WagyuFragmentStateFeaturesFlags
|
||||
WagyuFragmentStateFeaturesFlags_None = 0x00000000;
|
||||
static const WagyuFragmentStateFeaturesFlags
|
||||
WagyuFragmentStateFeaturesFlags_RasterizationOrderAttachmentAccess =
|
||||
0x00000001;
|
||||
|
||||
static const WGPUTextureUsage WagyuTextureUsage_InputAttachment =
|
||||
(WGPUTextureUsage)(0x10000);
|
||||
static const WGPUTextureUsage WagyuTextureUsage_TransientAttachment =
|
||||
(WGPUTextureUsage)(0x20000);
|
||||
|
||||
typedef void (*WagyuDeviceFlushCallback)(WGPUDevice device,
|
||||
WagyuDeviceFlushStatus status,
|
||||
void* userdata)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
typedef struct WagyuStringView
|
||||
{
|
||||
WGPU_NULLABLE const char* data;
|
||||
size_t length;
|
||||
} WagyuStringView WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_STRING_VIEW_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuStringView, \
|
||||
{/*.data = */ NULL WGPU_COMMA /*.length = */ 0 WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuColorTargetState
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
WGPUOptionalBool usedAsInput;
|
||||
} WagyuColorTargetState WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_COLOR_TARGET_STATE_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuColorTargetState, \
|
||||
{/*.chain*/ WAGYU_CHAIN_INIT(WagyuSType_ColorTargetState) \
|
||||
WGPU_COMMA /*.usedAsInput*/ WGPUOptionalBool_Undefined \
|
||||
WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuCommandEncoderDescriptor
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
WGPUOptionalBool measureExecutionTime;
|
||||
} WagyuCommandEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_COMMAND_ENCODER_DESCRIPTOR_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuCommandEncoderDescriptor, \
|
||||
{/*.chain*/ WAGYU_CHAIN_INIT(WagyuSType_CommandEncoderDescriptor) \
|
||||
WGPU_COMMA /*.measureExecutionTime*/ WGPUOptionalBool_Undefined \
|
||||
WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuComputePipelineDescriptor
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
WagyuStringView cacheKey;
|
||||
} WagyuComputePipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_COMPUTE_PIPELINE_DESCRIPTOR_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuComputePipelineDescriptor, \
|
||||
{/*.chain*/ WAGYU_CHAIN_INIT(WagyuSType_ComputePipelineDescriptor) \
|
||||
WGPU_COMMA /*.cacheKey*/ WAGYU_STRING_VIEW_INIT WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuDeviceDescriptor
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
WGPUBool dataBufferNeedsDetach;
|
||||
} WagyuDeviceDescriptor WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_DEVICE_DESCRIPTOR_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuDeviceDescriptor, \
|
||||
{/*.chain*/ WAGYU_CHAIN_INIT(WagyuSType_DeviceDescriptor) \
|
||||
WGPU_COMMA /*.dataBufferNeedsDetach*/ false WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuDeviceFlushCallbackInfo
|
||||
{
|
||||
WGPUChainedStruct* nextInChain;
|
||||
WGPUCallbackMode mode;
|
||||
WagyuDeviceFlushCallback callback;
|
||||
void* userdata;
|
||||
} WagyuDeviceFlushCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_DEVICE_FLUSHCALLBACK_INFO_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuDeviceFlushCallbackInfo, \
|
||||
{/*.nextInChain = */ NULL WGPU_COMMA /*.mode = */ \
|
||||
WGPUCallbackMode_AllowSpontaneous WGPU_COMMA /*.callback = */ \
|
||||
NULL WGPU_COMMA /*.userdata1 = */ NULL \
|
||||
WGPU_COMMA /*.userdata2 = */ NULL WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuDevicePipelineBinary
|
||||
{
|
||||
size_t binarySize;
|
||||
void* binary;
|
||||
size_t blobKeySize;
|
||||
void* blobKey;
|
||||
} WagyuDevicePipelineBinary WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_DEVICE_PIPELINE_BINARY_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuDevicePipelineBinary, \
|
||||
{/*.binarySize*/ 0 WGPU_COMMA /*.binary*/ NULL \
|
||||
WGPU_COMMA /*.blobKeySize*/ 0 WGPU_COMMA /*.blobKey*/ NULL \
|
||||
WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuDevicePipelineBinaryBlobKey
|
||||
{
|
||||
size_t size;
|
||||
const void* data;
|
||||
} WagyuDevicePipelineBinaryBlobKey WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_DEVICE_PIPELINE_BINARY_BLOB_KEY_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT(WagyuDevicePipelineBinaryBlobKey, \
|
||||
{/*.size*/ 0 WGPU_COMMA /*.data*/ NULL WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuDevicePipelineBinaryCacheKey
|
||||
{
|
||||
WagyuStringView cacheKey;
|
||||
size_t blobKeysLength;
|
||||
WagyuDevicePipelineBinaryBlobKey* blobKeys;
|
||||
} WagyuDevicePipelineBinaryCacheKey WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_DEVICE_PIPELINE_BINARY_CACHE_KEY_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT(WagyuDevicePipelineBinaryCacheKey, \
|
||||
{/*.cacheKey*/ WAGYU_STRING_VIEW_INIT \
|
||||
WGPU_COMMA /*.blobKeysLength*/ 0 WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuDevicePipelineBinaryData
|
||||
{
|
||||
size_t binariesLength;
|
||||
WagyuDevicePipelineBinary* binaries;
|
||||
size_t cacheKeysLength;
|
||||
WagyuDevicePipelineBinaryCacheKey* cacheKeys;
|
||||
} WagyuDevicePipelineBinaryData WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_DEVICE_PIPELINE_BINARY_DATA_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuDevicePipelineBinaryData, \
|
||||
{/*.binariesLength*/ 0 WGPU_COMMA /*.binaries*/ NULL \
|
||||
WGPU_COMMA /*.cacheKeysLength*/ 0 WGPU_COMMA /*.cacheKeys*/ NULL \
|
||||
WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuExternalTextureDescriptor
|
||||
{
|
||||
const WGPUChainedStruct* nextInChain;
|
||||
WagyuStringView label;
|
||||
WagyuStringView source;
|
||||
WagyuPredefinedColorSpace colorSpace;
|
||||
} WagyuExternalTextureDescriptor WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_EXTERNAL_TEXTURE_DESCRIPTOR_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuExternalTextureDescriptor, \
|
||||
{/*nextInChain = */ NULL WGPU_COMMA /*label = */ \
|
||||
WAGYU_STRING_VIEW_INIT WGPU_COMMA /*source = */ \
|
||||
WAGYU_STRING_VIEW_INIT WGPU_COMMA /*colorSpace = */ \
|
||||
WagyuPredefinedColorSpace_SRGB WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuExternalTextureBindingEntry
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
WagyuExternalTexture externalTexture;
|
||||
} WagyuExternalTextureBindingEntry WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_EXTERNAL_TEXTURE_BINDING_ENTRY_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuExternalTextureBindingEntry, \
|
||||
{/*.chain = */ WAGYU_CHAIN_INIT( \
|
||||
WagyuSType_ExternalTextureBindingEntry) \
|
||||
WGPU_COMMA /*.externalTexture = */ NULL WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuExternalTextureBindingLayout
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
} WagyuExternalTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_EXTERNAL_TEXTURE_BINDING_LAYOUT_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuExternalTextureBindingLayout, \
|
||||
{/*.chain*/ WAGYU_CHAIN_INIT(WagyuSType_ExternalTextureBindingLayout) \
|
||||
WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuFragmentState
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
WagyuFragmentStateFeaturesFlags featureFlags;
|
||||
} WagyuFragmentState WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_FRAGMENT_STATE_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuFragmentState, \
|
||||
{/*.chain*/ WAGYU_CHAIN_INIT(WagyuSType_FragmentState) \
|
||||
WGPU_COMMA /*.featureFlags*/ WagyuFragmentStateFeaturesFlags_None \
|
||||
WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuInputTextureBindingLayout
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
WGPUTextureViewDimension viewDimension;
|
||||
} WagyuInputTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_INPUT_TEXTURE_BINDING_LAYOUT_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuInputTextureBindingLayout, \
|
||||
{/*.chain*/ WAGYU_CHAIN_INIT(WagyuSType_InputTextureBindingLayout) \
|
||||
WGPU_COMMA /*.viewDimension*/ WGPUTextureViewDimension_2D \
|
||||
WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuRect
|
||||
{
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
} WagyuRect WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_RECT_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuRect, \
|
||||
{/* .x */ 0 WGPU_COMMA /* .y */ 0 WGPU_COMMA /* .width */ \
|
||||
0 WGPU_COMMA /* .height */ 0 WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuRenderPassInputAttachment
|
||||
{
|
||||
WGPUTextureView view;
|
||||
WGPU_NULLABLE WGPUColor* clearValue;
|
||||
WGPULoadOp loadOp;
|
||||
WGPUStoreOp storeOp;
|
||||
} WagyuRenderPassInputAttachment WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_RENDER_PASS_INPUT_ATTACHMENT_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuRenderPassInputAttachment, \
|
||||
{/* .view */ NULL WGPU_COMMA /* .clearValue */ NULL \
|
||||
WGPU_COMMA /* .loadOp */ WGPULoadOp_Clear \
|
||||
WGPU_COMMA /* .storeOp */ WGPUStoreOp_Store WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuRenderPassDescriptor
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
size_t inputAttachmentCount;
|
||||
WGPU_NULLABLE WagyuRenderPassInputAttachment* inputAttachments;
|
||||
} WagyuRenderPassDescriptor WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_RENDER_PASS_DESCRIPTOR_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuRenderPassDescriptor, \
|
||||
{/* .chain */ WAGYU_CHAIN_INIT(WagyuSType_RenderPassDescriptor) \
|
||||
WGPU_COMMA /* .inputAttachmentCount */ \
|
||||
0 WGPU_COMMA /* .inputAttachments */ NULL WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuRenderPipelineDescriptor
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
WagyuStringView cacheKey;
|
||||
} WagyuRenderPipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_RENDER_PIPELINE_DESCRIPTOR_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuRenderPipelineDescriptor, \
|
||||
{/* .chain */ WAGYU_CHAIN_INIT(WagyuSType_RenderPipelineDescriptor) \
|
||||
WGPU_COMMA /* .cacheKey */ WAGYU_STRING_VIEW_INIT WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuShaderReflectionStructMember
|
||||
{
|
||||
WagyuStringView name;
|
||||
uint32_t group;
|
||||
uint32_t binding;
|
||||
uint32_t offset;
|
||||
uint32_t size;
|
||||
uint32_t type;
|
||||
WGPUBool imageMultisampled;
|
||||
WGPUTextureViewDimension imageDimension;
|
||||
WGPUTextureFormat imageFormat;
|
||||
} WagyuShaderReflectionStructMember WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_SHADER_REFLECTION_STRUCT_MEMBER_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuShaderReflectionStructMember, \
|
||||
{/* .name */ WAGYU_STRING_VIEW_INIT \
|
||||
WGPU_COMMA /* .group */ 0 WGPU_COMMA /* .binding */ \
|
||||
0 WGPU_COMMA /* .offset */ 0 WGPU_COMMA /* .size */ \
|
||||
0 WGPU_COMMA /* .type */ 0 WGPU_COMMA /* .imageMultisampled */ \
|
||||
false WGPU_COMMA /* .imageDimension */ \
|
||||
WGPUTextureViewDimension_Undefined WGPU_COMMA /* .imageFormat */ \
|
||||
WGPUTextureFormat_Undefined WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuShaderReflectionLocation
|
||||
{
|
||||
WagyuStringView name;
|
||||
uint32_t location;
|
||||
uint32_t size;
|
||||
uint32_t type;
|
||||
} WagyuShaderReflectionLocation WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_SHADER_REFLECTION_LOCATION_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuShaderReflectionLocation, \
|
||||
{/* .name */ WAGYU_STRING_VIEW_INIT WGPU_COMMA /* .location */ \
|
||||
0 WGPU_COMMA /* .size */ 0 WGPU_COMMA /* .type */ 0 WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuShaderReflectionResource
|
||||
{
|
||||
WagyuStringView name;
|
||||
uint32_t group;
|
||||
uint32_t binding;
|
||||
uint32_t bindingType;
|
||||
WGPUBool multisampled;
|
||||
WGPUTextureViewDimension dimension;
|
||||
WGPUTextureFormat format;
|
||||
uint64_t bufferSize;
|
||||
} WagyuShaderReflectionResource WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_SHADER_REFLECTION_RESOURCE_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuShaderReflectionResource, \
|
||||
{/* .name */ WAGYU_STRING_VIEW_INIT WGPU_COMMA /* .group */ \
|
||||
0 WGPU_COMMA /* .binding */ 0 WGPU_COMMA /* .bindingType */ \
|
||||
0 WGPU_COMMA /* .multisampled */ false WGPU_COMMA /* .dimension */ \
|
||||
WGPUTextureViewDimension_Undefined \
|
||||
WGPU_COMMA /* .format */ WGPUTextureFormat_Undefined \
|
||||
WGPU_COMMA /* .bufferSize */ 0 WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuShaderReflectionSpecializationConstant
|
||||
{
|
||||
uint32_t id;
|
||||
uint32_t internalId;
|
||||
uint32_t type;
|
||||
WagyuStringView name;
|
||||
} WagyuShaderReflectionSpecializationConstant WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_SHADER_REFLECTION_SPECIALIZATION_CONSTANT_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuShaderReflectionSpecializationConstant, \
|
||||
{/* .id */ 0 WGPU_COMMA /* .internalId */ 0 WGPU_COMMA /* .type */ \
|
||||
0 WGPU_COMMA /* .name */ WAGYU_STRING_VIEW_INIT WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuShaderReflectionData
|
||||
{
|
||||
size_t resourcesCount;
|
||||
WagyuShaderReflectionResource* resources;
|
||||
size_t constantsCount;
|
||||
WagyuShaderReflectionSpecializationConstant* constants;
|
||||
size_t uniformsCount;
|
||||
WagyuShaderReflectionStructMember* uniforms;
|
||||
size_t attributesCount;
|
||||
WagyuShaderReflectionLocation* attributes;
|
||||
WagyuStringView wgsl;
|
||||
} WagyuShaderReflectionData WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_SHADER_REFLECTION_DATA_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuShaderReflectionData, \
|
||||
{/* .resourcesCount */ 0 WGPU_COMMA /* .resources */ NULL \
|
||||
WGPU_COMMA /* .constantsCount */ 0 WGPU_COMMA /* .constants */ \
|
||||
NULL WGPU_COMMA /* .uniformsCount */ \
|
||||
0 WGPU_COMMA /* .uniforms */ NULL \
|
||||
WGPU_COMMA /* .attributesCount */ 0 WGPU_COMMA /* .attributes */ \
|
||||
NULL WGPU_COMMA /* .wgsl */ WAGYU_STRING_VIEW_INIT \
|
||||
WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuShaderEntryPoint
|
||||
{
|
||||
WagyuStringView entryPoint;
|
||||
WGPUShaderStage stage;
|
||||
WagyuShaderReflectionData reflection;
|
||||
} WagyuShaderEntryPoint WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_SHADER_ENTRY_POINT_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuShaderEntryPoint, \
|
||||
{/* .entryPoint */ WAGYU_STRING_VIEW_INIT WGPU_COMMA /* .stage */ \
|
||||
WGPUShaderStage_NONE WGPU_COMMA /* .reflection */ \
|
||||
WAGYU_SHADER_REFLECTION_DATA_INIT WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuShaderEntryPointArray
|
||||
{
|
||||
size_t entryPointsCount;
|
||||
WagyuShaderEntryPoint* entryPoints;
|
||||
} WagyuShaderEntryPointArray WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_SHADER_ENTRY_POINT_ARRAY_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuShaderEntryPointArray, \
|
||||
{/* .entryPointsCount */ 0 WGPU_COMMA /* .entryPoints */ NULL \
|
||||
WGPU_COMMA})
|
||||
|
||||
struct WagyuShaderModuleCompilationHint
|
||||
{
|
||||
WGPUChainedStruct* nextInChain;
|
||||
WagyuStringView entryPoint;
|
||||
/**
|
||||
* If set to NULL, it will be treated as "auto"
|
||||
*/
|
||||
WGPUPipelineLayout layout;
|
||||
};
|
||||
|
||||
#define WAGYU_SHADER_MODULE_COMPILATION_HINT_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuShaderModuleCompilationHint, \
|
||||
{/* .nextInChain */ NULL WGPU_COMMA /* .entryPoint */ \
|
||||
WAGYU_STRING_VIEW_INIT WGPU_COMMA /* .layout */ NULL WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuShaderModuleDescriptor
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
size_t codeSize; // bytes
|
||||
const void* code;
|
||||
WagyuShaderLanguage language;
|
||||
size_t compilationHintCount;
|
||||
const struct WagyuShaderModuleCompilationHint* compilationHints;
|
||||
} WagyuShaderModuleDescriptor WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_SHADER_MODULE_DESCRIPTOR_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuShaderModuleDescriptor, \
|
||||
{/*.chain=*/WAGYU_CHAIN_INIT(WagyuSType_ShaderModuleDescriptor) \
|
||||
WGPU_COMMA /*.codeSize*/ 0 WGPU_COMMA /*.code*/ NULL \
|
||||
WGPU_COMMA /*.language*/ WagyuShaderLanguage_Detect \
|
||||
WGPU_COMMA /*.compilationHintCount*/ \
|
||||
0 WGPU_COMMA /*.compilationHints*/ NULL WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuStringArray
|
||||
{
|
||||
size_t stringCount;
|
||||
WGPU_NULLABLE WagyuStringView* strings;
|
||||
} WagyuStringArray WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_STRING_ARRAY_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuStringArray, \
|
||||
{/* .stringCount */ 0 WGPU_COMMA /* .strings */ NULL WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuSurfaceConfiguration
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
int32_t* indirectRenderTargets;
|
||||
} WagyuSurfaceConfiguration WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_SURFACE_CONFIGURATION_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuSurfaceConfiguration, \
|
||||
{/*.chain=*/WAGYU_CHAIN_INIT(WagyuSType_SurfaceConfiguration) \
|
||||
WGPU_COMMA /*.indirectRenderTargets*/ NULL WGPU_COMMA})
|
||||
|
||||
typedef struct WagyuTextureDescriptor
|
||||
{
|
||||
WGPUChainedStruct chain;
|
||||
WGPUBool useSurfaceCache;
|
||||
} WagyuTextureDescriptor WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_TEXTURE_DESCRIPTPR_INIT \
|
||||
WagyuTextureDescriptor \
|
||||
{ \
|
||||
.chain = WAGYU_CHAIN_INIT(WagyuSType_TextureDescriptor), \
|
||||
.useSurfaceCache = 1, \
|
||||
}
|
||||
|
||||
typedef struct WagyuWGSLFeatureTypeArray
|
||||
{
|
||||
size_t featuresCount;
|
||||
WGPU_NULLABLE WagyuWGSLFeatureType* features;
|
||||
} WagyuWGSLFeatureTypeArray WGPU_STRUCTURE_ATTRIBUTE;
|
||||
|
||||
#define WAGYU_WGSL_FEATURE_TYPE_ARRAY_INIT \
|
||||
WAGYU_MAKE_INIT_STRUCT( \
|
||||
WagyuWGSLFeatureTypeArray, \
|
||||
{/* .featuresCount */ 0 WGPU_COMMA /* .features */ NULL WGPU_COMMA})
|
||||
|
||||
#if defined(__cplusplus) && !defined(USE_WAGYU_NAMESPACE) && \
|
||||
!defined(__cppcheck)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
WGPU_EXPORT WGPUBackendType wagyuAdapterGetBackend(WGPUAdapter adapter)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuAdapterGetExtensions(WGPUAdapter adapter,
|
||||
WagyuStringArray* extensions)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuAdapterGetGraphicsReport(
|
||||
WGPUAdapter adapter,
|
||||
WagyuStringView* graphicsReport) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuAdapterGetName(WGPUAdapter adapter,
|
||||
WagyuStringView* name)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT WGPUDevice wagyuAdapterRequestDeviceSync(
|
||||
WGPUAdapter adapter,
|
||||
WGPU_NULLABLE const WGPUDeviceDescriptor* options)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuCommandEncoderBlit(
|
||||
WGPUCommandEncoder commandEncoder,
|
||||
const WGPUImageCopyTexture* source,
|
||||
const WGPUExtent3D* sourceExtent,
|
||||
const WGPUImageCopyTexture* destination,
|
||||
const WGPUExtent3D* destinationExtent,
|
||||
WGPUFilterMode filter) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuCommandEncoderGenerateMipmap(
|
||||
WGPUCommandEncoder commandEncoder,
|
||||
WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuDeviceClearPipelineBinaryCache(WGPUDevice device)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuDeviceEnableImaginationWorkarounds(WGPUDevice device,
|
||||
WGPUBool enable)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuDeviceGetExtensions(WGPUDevice device,
|
||||
WagyuStringArray* extensions)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuDeviceFlush(WGPUDevice device,
|
||||
WagyuDeviceFlushCallback callback,
|
||||
void* userdata) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT WagyuExternalTexture wagyuDeviceImportExternalTexture(
|
||||
WGPUDevice device,
|
||||
const WagyuExternalTextureDescriptor* descriptor)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuDeviceIntrospectShaderCode(
|
||||
WGPUDevice device,
|
||||
WGPUShaderStage stages,
|
||||
const WGPUShaderModuleDescriptor* descriptor,
|
||||
WagyuShaderEntryPointArray* entryPoints) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuDevicePopulatePipelineBinaryCache(
|
||||
WGPUDevice device,
|
||||
const WagyuDevicePipelineBinaryData* data) WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuExternalTextureAddRef(
|
||||
WagyuExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuExternalTextureRelease(
|
||||
WagyuExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuExternalTextureSetLabel(
|
||||
WagyuExternalTexture externalTexture,
|
||||
const char* label) WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuInstanceEnableImaginationWorkarounds(
|
||||
WGPUInstance instance,
|
||||
WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT uint32_t wagyuInstanceGetApiVersion(WGPUInstance instance)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT WGPUBackendType wagyuInstanceGetBackend(WGPUInstance instance)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuInstanceGetExposeWGSLFeatures(
|
||||
WGPUInstance instance,
|
||||
WagyuWGSLFeatureTypeArray* wgslFeatures) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT WagyuRelaxedCompliance wagyuInstanceGetRelaxedCompliance(
|
||||
WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT WGPUTextureFormat wagyuInstanceGetScreenDirectFormat(
|
||||
WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT WGPUTextureFormat wagyuInstanceGetScreenIndirectFormat(
|
||||
WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT WGPUBool wagyuInstanceGetSync(WGPUInstance instance)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT WGPUAdapter wagyuInstanceRequestAdapterSync(
|
||||
WGPUInstance instance,
|
||||
WGPU_NULLABLE const WGPURequestAdapterOptions* options)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuInstanceSetCommandBufferLimit(WGPUInstance instance,
|
||||
uint32_t limit)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuInstanceSetExposeWGSLFeatures(
|
||||
WGPUInstance instance,
|
||||
const WagyuWGSLFeatureTypeArray* wgslFeatures) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuInstanceSetImmediate(WGPUInstance instance,
|
||||
WGPUBool enabled)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuInstanceSetRunBarriersOnIncoherent(
|
||||
WGPUInstance instance,
|
||||
WGPUBool run) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuInstanceSetStagingBufferCacheSize(
|
||||
WGPUInstance instance,
|
||||
uint32_t size) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuInstanceSetSync(WGPUInstance instance, WGPUBool sync)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT WGPUBool wagyuRelaxedComplianceGetBufferClear(
|
||||
WagyuRelaxedCompliance relaxedCompliance) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT WGPUBool wagyuRelaxedComplianceGetTextureClear(
|
||||
WagyuRelaxedCompliance relaxedCompliance) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRelaxedComplianceSetAll(
|
||||
WagyuRelaxedCompliance relaxedCompliance,
|
||||
WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRelaxedComplianceSetBufferClear(
|
||||
WagyuRelaxedCompliance relaxedCompliance,
|
||||
WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRelaxedComplianceSetTextureClear(
|
||||
WagyuRelaxedCompliance relaxedCompliance,
|
||||
WGPUBool enable) WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuRenderBundleEncoderClearColorAttachments(
|
||||
WGPURenderBundleEncoder renderBundleEncoder,
|
||||
const WagyuRect* rect,
|
||||
uint32_t baseAttachment,
|
||||
uint32_t numAttachments,
|
||||
const WGPUColor* color,
|
||||
uint32_t baseArrayLayer,
|
||||
uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRenderBundleEncoderClearDepthAttachment(
|
||||
WGPURenderBundleEncoder renderBundleEncoder,
|
||||
const WagyuRect* rect,
|
||||
float depth,
|
||||
uint32_t baseArrayLayer,
|
||||
uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRenderBundleEncoderClearStencilAttachment(
|
||||
WGPURenderBundleEncoder renderBundleEncoder,
|
||||
const WagyuRect* rect,
|
||||
uint32_t stencil,
|
||||
uint32_t baseArrayLayer,
|
||||
uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRenderBundleEncoderSetScissorRect(
|
||||
WGPURenderBundleEncoder renderBundleEncoder,
|
||||
uint32_t x,
|
||||
uint32_t y,
|
||||
uint32_t width,
|
||||
uint32_t height) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRenderBundleEncoderSetScissorRectIndirect(
|
||||
WGPURenderBundleEncoder renderBundleEncoder,
|
||||
uint64_t indirectOffset,
|
||||
const uint32_t* indirectBuffer,
|
||||
size_t indirectBufferCount) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRenderBundleEncoderSetViewport(
|
||||
WGPURenderBundleEncoder renderBundleEncoder,
|
||||
float x,
|
||||
float y,
|
||||
float width,
|
||||
float height,
|
||||
float minDepth,
|
||||
float maxDepth) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRenderBundleEncoderSetViewportWithDepthIndirect(
|
||||
WGPURenderBundleEncoder renderBundleEncoder,
|
||||
uint64_t indirectOffset,
|
||||
const float* indirectBuffer,
|
||||
size_t indirectBufferCount) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRenderBundleEncoderSetViewportWithoutDepthIndirect(
|
||||
WGPURenderBundleEncoder renderBundleEncoder,
|
||||
uint64_t indirectOffset,
|
||||
const float* indirectBuffer,
|
||||
size_t indirectBufferCount) WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuRenderPassEncoderClearColorAttachments(
|
||||
WGPURenderPassEncoder renderPassEncoder,
|
||||
const WagyuRect* rect,
|
||||
uint32_t baseAttachment,
|
||||
uint32_t numAttachments,
|
||||
const WGPUColor* color,
|
||||
uint32_t baseArrayLayer,
|
||||
uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRenderPassEncoderClearDepthAttachment(
|
||||
WGPURenderPassEncoder renderPassEncoder,
|
||||
const WagyuRect* rect,
|
||||
float depth,
|
||||
uint32_t baseArrayLayer,
|
||||
uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRenderPassEncoderClearStencilAttachment(
|
||||
WGPURenderPassEncoder renderPassEncoder,
|
||||
const WagyuRect* rect,
|
||||
uint32_t stencil,
|
||||
uint32_t baseArrayLayer,
|
||||
uint32_t layerCount) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRenderPassEncoderSetShaderPixelLocalStorageEnabled(
|
||||
WGPURenderPassEncoder renderPassEncoder,
|
||||
WGPUBool enabled) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuRenderPassEncoderExecuteBundle(
|
||||
WGPURenderPassEncoder renderPassEncoder,
|
||||
WGPURenderBundle bundle) WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuShaderEntryPointArrayFreeMembers(
|
||||
WagyuShaderEntryPointArray value) WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuShaderModuleDestroy(WGPUShaderModule shaderModule)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuShaderModuleIntrospect(
|
||||
WGPUShaderModule shaderModule,
|
||||
WGPUShaderStage stages,
|
||||
WagyuShaderEntryPointArray* shaderEntryPointArray)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuStringArrayFreeMembers(WagyuStringArray value)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuStringViewFreeMembers(WagyuStringView value)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuSurfaceDestroy(WGPUSurface surface)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT WGPUTexture wagyuSurfaceGetCurrentDepthStencilTexture(
|
||||
WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT float wagyuSurfaceGetHeight(WGPUSurface surface)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT float wagyuSurfaceGetWidth(WGPUSurface surface)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT float wagyuSurfaceGetX(WGPUSurface surface)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT float wagyuSurfaceGetY(WGPUSurface surface)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuSurfacePresent(
|
||||
WGPUSurface surface,
|
||||
WGPUTexture target /**| nrdp.gibbon.Surface*/) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuSurfaceSetHeight(WGPUSurface surface, float height)
|
||||
WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuSurfaceSetWidth(WGPUSurface surface,
|
||||
float width) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuSurfaceSetX(WGPUSurface surface,
|
||||
float x) WGPU_FUNCTION_ATTRIBUTE;
|
||||
WGPU_EXPORT void wagyuSurfaceSetY(WGPUSurface surface,
|
||||
float y) WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
WGPU_EXPORT void wagyuWGSLFeatureTypeArrayFreeMembers(
|
||||
WagyuWGSLFeatureTypeArray value) WGPU_FUNCTION_ATTRIBUTE;
|
||||
|
||||
#if defined(__cplusplus) && !defined(USE_WAGYU_NAMESPACE) && \
|
||||
!defined(__cppcheck)
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(USE_WAGYU_NAMESPACE) || defined(__cppcheck)
|
||||
} // namespace wagyu1
|
||||
#endif
|
||||
|
||||
#endif /* WAGYU_EXTENSIONS_H */
|
||||
619
renderer/src/webgpu/webgpu_compat.h
Normal file
619
renderer/src/webgpu/webgpu_compat.h
Normal file
@@ -0,0 +1,619 @@
|
||||
#ifndef WEBGPU_COMPAT_H
|
||||
#define WEBGPU_COMPAT_H
|
||||
|
||||
#define WGPUTexelCopyBufferInfo WGPUImageCopyBuffer
|
||||
#define WGPUTexelCopyTextureInfo WGPUImageCopyTexture
|
||||
#define WGPUInstanceCapabilities WGPUInstanceFeatures
|
||||
|
||||
#if !defined(WGPUOptionalBool)
|
||||
#define WGPUOptionalBool int32_t
|
||||
#define WGPUOptionalBool_False 0x00000000
|
||||
#define WGPUOptionalBool_True 0x00000001
|
||||
#define WGPUOptionalBool_Undefined 0x00000002
|
||||
#define WGPUOptionalBool_Force32 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
#define WGPUMapAsyncStatus_Success WGPUBufferMapAsyncStatus_Success
|
||||
#define WGPUMapAsyncStatus_Force32 WGPUBufferMapAsyncStatus_Force32
|
||||
|
||||
#define WGPUSType_ShaderSourceWGSL WGPUSType_ShaderModuleWGSLDescriptor
|
||||
#define WGPUStatus int
|
||||
|
||||
#define WGPUStatus_Success 1
|
||||
|
||||
#define wgpuGetInstanceCapabilities wgpuGetInstanceFeatures
|
||||
|
||||
#define WGPUMapAsyncStatus WGPUBufferMapAsyncStatus
|
||||
#define WGPUShaderSourceWGSL WGPUShaderModuleWGSLDescriptor
|
||||
#define WGPURenderPassMaxDrawCount WGPURenderPassDescriptorMaxDrawCount
|
||||
#define WGPUWGSLLanguageFeatureName WGPUWGSLFeatureName
|
||||
|
||||
#define WGPUEmscriptenSurfaceSourceCanvasHTMLSelector \
|
||||
WGPUSurfaceDescriptorFromCanvasHTMLSelector
|
||||
#define WGPUWGSLLanguageFeatureName_Force32 WGPUWGSLFeatureName_Force32
|
||||
#define WGPUSType_EmscriptenSurfaceSourceCanvasHTMLSelector \
|
||||
WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector
|
||||
#define WGPUSType_RenderPassMaxDrawCount \
|
||||
WGPUSType_RenderPassDescriptorMaxDrawCount
|
||||
#define WGPUSType_ShaderSourceWGSL WGPUSType_ShaderModuleWGSLDescriptor
|
||||
#define WGPUWGSLLanguageFeatureName_Packed4x8IntegerDotProduct \
|
||||
WGPUWGSLFeatureName_Packed4x8IntegerDotProduct
|
||||
#define WGPUWGSLLanguageFeatureName_PointerCompositeAccess \
|
||||
WGPUWGSLFeatureName_PointerCompositeAccess
|
||||
#define WGPUWGSLLanguageFeatureName_ReadonlyAndReadwriteStorageTextures \
|
||||
WGPUWGSLFeatureName_ReadonlyAndReadwriteStorageTextures
|
||||
// #define WGPUWGSLLanguageFeatureName_Undefined WGPUWGSLFeatureName_Undefined
|
||||
#define WGPUWGSLLanguageFeatureName_UnrestrictedPointerParameters \
|
||||
WGPUWGSLFeatureName_UnrestrictedPointerParameters
|
||||
|
||||
#define WGPU_STRING_VIEW(s) s
|
||||
#define WGPU_STRING_VIEW_INIT NULL
|
||||
#define WGPU_STRING_VIEW_TO_STRING(s) std::string(s)
|
||||
#define WGPU_STRING_VIEW_TO_CSTR(s) s
|
||||
#define WGPU_STRING_VIEW_FROM_STRING(s) strdup(s.c_str())
|
||||
#define WGPU_STRING_VIEW_FREE(s) free(const_cast<char*>(s))
|
||||
#define WGPUStringView const char*
|
||||
|
||||
#define WGPU_ADDREF(d, o) wgpu##d##Reference(o)
|
||||
|
||||
#define WGPU_CHECK_STATUS(s) s
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if __cplusplus >= 201103L
|
||||
#define WGPU_MAKE_INIT_STRUCT(type, value) (type value)
|
||||
#else
|
||||
#define WGPU_MAKE_INIT_STRUCT(type, value) value
|
||||
#endif
|
||||
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#define WGPU_MAKE_INIT_STRUCT(type, value) ((type)value)
|
||||
#else
|
||||
#define WGPU_MAKE_INIT_STRUCT(type, value) value
|
||||
#endif
|
||||
|
||||
#define WGPU_COMMA ,
|
||||
|
||||
#define WGPU_ADAPTER_INFO_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUAdapterInfo, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.vendor=*/NULL \
|
||||
WGPU_COMMA /*.architecture=*/NULL WGPU_COMMA /*.device=*/NULL \
|
||||
WGPU_COMMA /*.description=*/NULL WGPU_COMMA /*.backendType=*/ \
|
||||
{} WGPU_COMMA /*.adapterType=*/{} WGPU_COMMA /*.vendorID=*/ \
|
||||
{} WGPU_COMMA /*.deviceID=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_BIND_GROUP_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUBindGroupDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.layout=*/{} WGPU_COMMA /*.entryCount=*/ \
|
||||
{} WGPU_COMMA /*.entries=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_BIND_GROUP_ENTRY_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUBindGroupEntry, \
|
||||
{/*.nextInChain=*/NULL \
|
||||
WGPU_COMMA /*.binding=*/{} WGPU_COMMA /*.buffer=*/NULL \
|
||||
WGPU_COMMA /*.offset=*/0 WGPU_COMMA /*.size=*/WGPU_WHOLE_SIZE \
|
||||
WGPU_COMMA /*.sampler=*/NULL \
|
||||
WGPU_COMMA /*.textureView=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_BIND_GROUP_LAYOUT_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUBindGroupLayoutDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.entryCount=*/ \
|
||||
{} WGPU_COMMA /*.entries=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_BIND_GROUP_LAYOUT_ENTRY_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUBindGroupLayoutEntry, \
|
||||
{/*.nextInChain=*/NULL \
|
||||
WGPU_COMMA /*.binding=*/{} WGPU_COMMA /*.visibility=*/ \
|
||||
{} WGPU_COMMA /*.buffer=*/WGPU_BUFFER_BINDING_LAYOUT_INIT \
|
||||
WGPU_COMMA /*.sampler=*/WGPU_SAMPLER_BINDING_LAYOUT_INIT \
|
||||
WGPU_COMMA /*.texture=*/WGPU_TEXTURE_BINDING_LAYOUT_INIT \
|
||||
WGPU_COMMA /*.storageTexture=*/ \
|
||||
WGPU_STORAGE_TEXTURE_BINDING_LAYOUT_INIT WGPU_COMMA})
|
||||
|
||||
#define WGPU_BLEND_COMPONENT_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUBlendComponent, \
|
||||
{/*.operation=*/WGPUBlendOperation_Add WGPU_COMMA /*.srcFactor=*/ \
|
||||
WGPUBlendFactor_One \
|
||||
WGPU_COMMA /*.dstFactor=*/WGPUBlendFactor_Zero WGPU_COMMA})
|
||||
|
||||
#define WGPU_BLEND_STATE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUBlendState, \
|
||||
{/*.color=*/WGPU_BLEND_COMPONENT_INIT WGPU_COMMA /*.alpha=*/ \
|
||||
WGPU_BLEND_COMPONENT_INIT WGPU_COMMA})
|
||||
|
||||
#define WGPU_BUFFER_BINDING_LAYOUT_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUBufferBindingLayout, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.type=*/ \
|
||||
WGPUBufferBindingType_Uniform WGPU_COMMA /*.hasDynamicOffset=*/ \
|
||||
false WGPU_COMMA /*.minBindingSize=*/0 WGPU_COMMA})
|
||||
|
||||
#define WGPU_BUFFER_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUBufferDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.usage=*/{} WGPU_COMMA /*.size=*/ \
|
||||
{} WGPU_COMMA /*.mappedAtCreation=*/false WGPU_COMMA})
|
||||
|
||||
#define WGPU_BUFFER_MAP_CALLBACK_INFO_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUBufferMapCallbackInfo, \
|
||||
{/*.nextInChain=*/NULL \
|
||||
WGPU_COMMA /*.mode=*/{} WGPU_COMMA /*.callback=*/NULL \
|
||||
WGPU_COMMA /*.userdata1=*/NULL WGPU_COMMA /*.userdata2=*/NULL \
|
||||
WGPU_COMMA})
|
||||
|
||||
#define WGPU_COLOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUColor, \
|
||||
{/*.r=*/{} WGPU_COMMA /*.g=*/{} WGPU_COMMA /*.b=*/ \
|
||||
{} WGPU_COMMA /*.a=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_COLOR_TARGET_STATE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUColorTargetState, \
|
||||
{/*.nextInChain=*/NULL \
|
||||
WGPU_COMMA /*.format=*/{} WGPU_COMMA /*.blend=*/NULL \
|
||||
WGPU_COMMA /*.writeMask=*/WGPUColorWriteMask_All WGPU_COMMA})
|
||||
|
||||
#define WGPU_COMMAND_BUFFER_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUCommandBufferDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_COMMAND_ENCODER_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUCommandEncoderDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_COMPILATION_INFO_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUCompilationInfo, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.messageCount=*/ \
|
||||
{} WGPU_COMMA /*.messages=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_COMPILATION_MESSAGE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUCompilationMessage, \
|
||||
, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.message=*/NULL \
|
||||
WGPU_COMMA /*.type=*/{} WGPU_COMMA /*.lineNum=*/ \
|
||||
{} WGPU_COMMA /*.linePos=*/{} WGPU_COMMA /*.offset=*/ \
|
||||
{} WGPU_COMMA /*.length=*/{} WGPU_COMMA /*.utf16LinePos=*/ \
|
||||
{} WGPU_COMMA /*.utf16Offset=*/{} WGPU_COMMA /*.utf16Length=*/ \
|
||||
{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_COMPUTE_PASS_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUComputePassDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.timestampWrites=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_COMPUTE_PASS_TIMESTAMP_WRITES_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUComputePassTimestampWrites, \
|
||||
{/*.querySet=*/{} WGPU_COMMA /*.beginningOfPassWriteIndex=*/ \
|
||||
WGPU_QUERY_SET_INDEX_UNDEFINED \
|
||||
WGPU_COMMA /*.endOfPassWriteIndex=*/ \
|
||||
WGPU_QUERY_SET_INDEX_UNDEFINED WGPU_COMMA})
|
||||
|
||||
#define WGPU_COMPUTE_PIPELINE_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUComputePipelineDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.layout=*/NULL \
|
||||
WGPU_COMMA /*.compute=*/WGPU_COMPUTE_STATE_INIT WGPU_COMMA})
|
||||
|
||||
#define WGPU_COMPUTE_STATE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUProgrammableStageDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.module=*/NULL \
|
||||
WGPU_COMMA /*.entryPoint=*/NULL \
|
||||
WGPU_COMMA /*.constantCount=*/0 WGPU_COMMA /*.constants=*/ \
|
||||
NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_CONSTANT_ENTRY_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUConstantEntry, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.key=*/NULL \
|
||||
WGPU_COMMA /*.value=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_DEPTH_STENCIL_STATE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUDepthStencilState, \
|
||||
{/*.nextInChain=*/NULL \
|
||||
WGPU_COMMA /*.format=*/{} WGPU_COMMA /*.depthWriteEnabled=*/ \
|
||||
false WGPU_COMMA /*.depthCompare=*/WGPUCompareFunction_Undefined \
|
||||
WGPU_COMMA /*.stencilFront=*/WGPU_STENCIL_FACE_STATE_INIT \
|
||||
WGPU_COMMA /*.stencilBack=*/WGPU_STENCIL_FACE_STATE_INIT \
|
||||
WGPU_COMMA /*.stencilReadMask=*/ \
|
||||
0xFFFFFFFF WGPU_COMMA /*.stencilWriteMask=*/ \
|
||||
0xFFFFFFFF WGPU_COMMA /*.depthBias=*/ \
|
||||
0 WGPU_COMMA /*.depthBiasSlopeScale=*/ \
|
||||
0.0f WGPU_COMMA /*.depthBiasClamp=*/0.0f WGPU_COMMA})
|
||||
|
||||
#define WGPU_DEVICE_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUDeviceDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.requiredFeatureCount=*/ \
|
||||
0 WGPU_COMMA /*.requiredFeatures=*/NULL \
|
||||
WGPU_COMMA /*.requiredLimits=*/NULL \
|
||||
WGPU_COMMA /*.defaultQueue=*/WGPU_QUEUE_DESCRIPTOR_INIT \
|
||||
WGPU_COMMA /*.deviceLostCallback=*/NULL \
|
||||
WGPU_COMMA /*.deviceLostUserdata=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_EXTENT_3D_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUExtent3D, \
|
||||
{/*.width=*/0 WGPU_COMMA /*.height=*/ \
|
||||
1 WGPU_COMMA /*.depthOrArrayLayers=*/1 WGPU_COMMA})
|
||||
|
||||
#define WGPU_FRAGMENT_STATE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUFragmentState, \
|
||||
{/*.nextInChain=*/NULL \
|
||||
WGPU_COMMA /*.module=*/{} WGPU_COMMA /*.entryPoint=*/NULL \
|
||||
WGPU_COMMA /*.constantCount=*/0 WGPU_COMMA /*.constants=*/ \
|
||||
{} WGPU_COMMA /*.targetCount=*/{} WGPU_COMMA /*.targets=*/ \
|
||||
{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_TEXEL_COPY_BUFFER_INFO_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUTexelCopyBufferInfo, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.layout=*/ \
|
||||
WGPU_TEXTURE_DATA_LAYOUT_INIT \
|
||||
WGPU_COMMA /*.buffer=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_TEXEL_COPY_TEXTURE_INFO_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUTexelCopyTextureInfo, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.texture=*/ \
|
||||
{} WGPU_COMMA /*.mipLevel=*/0 WGPU_COMMA /*.origin=*/ \
|
||||
WGPU_ORIGIN_3D_INIT WGPU_COMMA /*.aspect=*/WGPUTextureAspect_All \
|
||||
WGPU_COMMA})
|
||||
|
||||
#define WGPU_INSTANCE_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUInstanceDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.features=*/ \
|
||||
WGPU_INSTANCE_CAPABILITIES_INIT WGPU_COMMA})
|
||||
|
||||
#define WGPU_INSTANCE_CAPABILITIES_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUInstanceCapabilities, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.timedWaitAnyEnable=*/ \
|
||||
false WGPU_COMMA /*.timedWaitAnyMaxCount=*/0 WGPU_COMMA})
|
||||
|
||||
#define WGPU_LIMITS_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPULimits, \
|
||||
{/*.maxTextureDimension1D=*/ \
|
||||
WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.maxTextureDimension2D=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxTextureDimension3D=*/WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.maxTextureArrayLayers=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxBindGroups=*/WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.maxBindGroupsPlusVertexBuffers=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxBindingsPerBindGroup=*/WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.maxDynamicUniformBuffersPerPipelineLayout=*/ \
|
||||
WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.maxDynamicStorageBuffersPerPipelineLayout=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxSampledTexturesPerShaderStage=*/WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.maxSamplersPerShaderStage=*/ \
|
||||
WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.maxStorageBuffersPerShaderStage=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxStorageTexturesPerShaderStage=*/WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.maxUniformBuffersPerShaderStage=*/ \
|
||||
WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.maxUniformBufferBindingSize=*/WGPU_LIMIT_U64_UNDEFINED \
|
||||
WGPU_COMMA /*.maxStorageBufferBindingSize=*/WGPU_LIMIT_U64_UNDEFINED WGPU_COMMA /*.minUniformBufferOffsetAlignment=*/ \
|
||||
WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.minStorageBufferOffsetAlignment=*/ \
|
||||
WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.maxVertexBuffers=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxBufferSize=*/WGPU_LIMIT_U64_UNDEFINED WGPU_COMMA /*.maxVertexAttributes=*/ \
|
||||
WGPU_LIMIT_U32_UNDEFINED WGPU_COMMA /*.maxVertexBufferArrayStride=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxInterStageShaderComponents=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxInterStageShaderVariables=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxColorAttachments=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxColorAttachmentBytesPerSample=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxComputeWorkgroupStorageSize=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxComputeInvocationsPerWorkgroup=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxComputeWorkgroupSizeX=*/WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxComputeWorkgroupSizeY=*/ \
|
||||
WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxComputeWorkgroupSizeZ=*/ \
|
||||
WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA /*.maxComputeWorkgroupsPerDimension=*/ \
|
||||
WGPU_LIMIT_U32_UNDEFINED \
|
||||
WGPU_COMMA})
|
||||
|
||||
#define WGPU_MULTISAMPLE_STATE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUMultisampleState, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.count=*/1 WGPU_COMMA /*.mask=*/ \
|
||||
0xFFFFFFFF WGPU_COMMA /*.alphaToCoverageEnabled=*/false WGPU_COMMA})
|
||||
|
||||
#define WGPU_ORIGIN_3D_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUOrigin3D, \
|
||||
{/*.x=*/0 WGPU_COMMA /*.y=*/0 WGPU_COMMA /*.z=*/0 WGPU_COMMA})
|
||||
|
||||
#define WGPU_PIPELINE_LAYOUT_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUPipelineLayoutDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.bindGroupLayoutCount=*/ \
|
||||
{} WGPU_COMMA /*.bindGroupLayouts=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_PRIMITIVE_STATE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUPrimitiveState, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.topology=*/ \
|
||||
WGPUPrimitiveTopology_TriangleList \
|
||||
WGPU_COMMA /*.stripIndexFormat=*/WGPUIndexFormat_Undefined \
|
||||
WGPU_COMMA /*.frontFace=*/WGPUFrontFace_CCW \
|
||||
WGPU_COMMA /*.cullMode=*/WGPUCullMode_None \
|
||||
WGPU_COMMA})
|
||||
|
||||
#define WGPU_QUERY_SET_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUQuerySetDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.type=*/{} WGPU_COMMA /*.count=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_QUEUE_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUQueueDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_RENDER_BUNDLE_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPURenderBundleDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_RENDER_BUNDLE_ENCODER_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPURenderBundleEncoderDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.colorFormatCount=*/{} WGPU_COMMA /*.colorFormats=*/ \
|
||||
{} WGPU_COMMA /*.depthStencilFormat=*/WGPUTextureFormat_Undefined \
|
||||
WGPU_COMMA /*.sampleCount=*/1 WGPU_COMMA /*.depthReadOnly=*/ \
|
||||
false WGPU_COMMA /*.stencilReadOnly=*/false WGPU_COMMA})
|
||||
|
||||
#define WGPU_RENDER_PASS_COLOR_ATTACHMENT_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPURenderPassColorAttachment, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.view=*/NULL \
|
||||
WGPU_COMMA /*.depthSlice=*/WGPU_DEPTH_SLICE_UNDEFINED \
|
||||
WGPU_COMMA /*.resolveTarget=*/NULL \
|
||||
WGPU_COMMA /*.loadOp=*/{} WGPU_COMMA /*.storeOp=*/ \
|
||||
{} WGPU_COMMA /*.clearValue=*/WGPU_COLOR_INIT WGPU_COMMA})
|
||||
|
||||
#define WGPU_RENDER_PASS_DEPTH_STENCIL_ATTACHMENT_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPURenderPassDepthStencilAttachment, \
|
||||
{/*.view=*/{} WGPU_COMMA /*.depthLoadOp=*/WGPULoadOp_Undefined \
|
||||
WGPU_COMMA /*.depthStoreOp=*/WGPUStoreOp_Undefined \
|
||||
WGPU_COMMA /*.depthClearValue=*/NAN \
|
||||
WGPU_COMMA /*.depthReadOnly=*/ \
|
||||
false WGPU_COMMA /*.stencilLoadOp=*/WGPULoadOp_Undefined \
|
||||
WGPU_COMMA /*.stencilStoreOp=*/WGPUStoreOp_Undefined \
|
||||
WGPU_COMMA /*.stencilClearValue=*/ \
|
||||
0 WGPU_COMMA /*.stencilReadOnly=*/false WGPU_COMMA})
|
||||
|
||||
#define WGPU_RENDER_PASS_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPURenderPassDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.colorAttachmentCount=*/ \
|
||||
{} WGPU_COMMA /*.colorAttachments=*/ \
|
||||
{} WGPU_COMMA /*.depthStencilAttachment=*/NULL \
|
||||
WGPU_COMMA /*.occlusionQuerySet=*/NULL \
|
||||
WGPU_COMMA /*.timestampWrites=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_RENDER_PASS_MAX_DRAW_COUNT_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPURenderPassMaxDrawCount, \
|
||||
{/*.chain= WGPUChainedStruct*/ { \
|
||||
/*.next=*/NULL WGPU_COMMA /*.sType=*/ \
|
||||
WGPUSType_RenderPassDescriptorMaxDrawCount \
|
||||
WGPU_COMMA} WGPU_COMMA /*.maxDrawCount=*/ \
|
||||
50000000 WGPU_COMMA})
|
||||
|
||||
#define WGPU_RENDER_PASS_TIMESTAMP_WRITES_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPURenderPassTimestampWrites, \
|
||||
{/*.querySet=*/{} WGPU_COMMA /*.beginningOfPassWriteIndex=*/ \
|
||||
WGPU_QUERY_SET_INDEX_UNDEFINED \
|
||||
WGPU_COMMA /*.endOfPassWriteIndex=*/ \
|
||||
WGPU_QUERY_SET_INDEX_UNDEFINED WGPU_COMMA})
|
||||
|
||||
#define WGPU_RENDER_PIPELINE_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPURenderPipelineDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.layout=*/NULL WGPU_COMMA /*.vertex=*/ \
|
||||
WGPU_VERTEX_STATE_INIT WGPU_COMMA /*.primitive=*/ \
|
||||
WGPU_PRIMITIVE_STATE_INIT WGPU_COMMA /*.depthStencil=*/ \
|
||||
NULL WGPU_COMMA /*.multisample=*/ \
|
||||
WGPU_MULTISAMPLE_STATE_INIT \
|
||||
WGPU_COMMA /*.fragment=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_REQUEST_ADAPTER_OPTIONS_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPURequestAdapterOptions, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.compatibleSurface=*/NULL \
|
||||
WGPU_COMMA /*.powerPreference=*/WGPUPowerPreference_Undefined \
|
||||
WGPU_COMMA /*.backendType=*/WGPUBackendType_Undefined \
|
||||
WGPU_COMMA /*.forceFallbackAdapter=*/ \
|
||||
false WGPU_COMMA /*.compatibilityMode=*/false WGPU_COMMA})
|
||||
|
||||
#define WGPU_REQUIRED_LIMITS_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPURequiredLimits, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.limits=*/WGPU_LIMITS_INIT \
|
||||
WGPU_COMMA})
|
||||
|
||||
#define WGPU_SAMPLER_BINDING_LAYOUT_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUSamplerBindingLayout, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.type=*/ \
|
||||
WGPUSamplerBindingType_Filtering WGPU_COMMA})
|
||||
|
||||
#define WGPU_SAMPLER_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUSamplerDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.addressModeU=*/WGPUAddressMode_ClampToEdge \
|
||||
WGPU_COMMA /*.addressModeV=*/WGPUAddressMode_ClampToEdge \
|
||||
WGPU_COMMA /*.addressModeW=*/WGPUAddressMode_ClampToEdge \
|
||||
WGPU_COMMA /*.magFilter=*/WGPUFilterMode_Nearest \
|
||||
WGPU_COMMA /*.minFilter=*/WGPUFilterMode_Nearest \
|
||||
WGPU_COMMA /*.mipmapFilter=*/ \
|
||||
WGPUMipmapFilterMode_Nearest \
|
||||
WGPU_COMMA /*.lodMinClamp=*/ \
|
||||
0.0f WGPU_COMMA /*.lodMaxClamp=*/32.0f WGPU_COMMA /*.compare=*/ \
|
||||
WGPUCompareFunction_Undefined \
|
||||
WGPU_COMMA /*.maxAnisotropy=*/1 WGPU_COMMA})
|
||||
|
||||
#define WGPU_SHADER_MODULE_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUShaderModuleDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_SHADER_SOURCE_SPIRV_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUShaderSourceSPIRV, \
|
||||
{/*.chain= WGPUChainedStruct*/ { \
|
||||
/*.next=*/NULL WGPU_COMMA /*.sType=*/WGPUSType_ShaderSourceSPIRV \
|
||||
WGPU_COMMA} WGPU_COMMA /*.codeSize=*/{}, \
|
||||
.code = {} WGPU_COMMA})
|
||||
|
||||
#define WGPU_SHADER_SOURCE_WGSL_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUShaderSourceWGSL, \
|
||||
{/*.chain= WGPUChainedStruct*/ { \
|
||||
/*.next=*/NULL WGPU_COMMA /*.sType=*/WGPUSType_ShaderSourceWGSL \
|
||||
WGPU_COMMA} WGPU_COMMA /*.code=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_STENCIL_FACE_STATE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUStencilFaceState, \
|
||||
{/*.compare=*/WGPUCompareFunction_Always WGPU_COMMA /*.failOp=*/ \
|
||||
WGPUStencilOperation_Keep \
|
||||
WGPU_COMMA /*.depthFailOp=*/WGPUStencilOperation_Keep \
|
||||
WGPU_COMMA /*.passOp=*/WGPUStencilOperation_Keep \
|
||||
WGPU_COMMA})
|
||||
|
||||
#define WGPU_STORAGE_TEXTURE_BINDING_LAYOUT_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUStorageTextureBindingLayout, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.access=*/ \
|
||||
WGPUStorageTextureAccess_WriteOnly \
|
||||
WGPU_COMMA /*.format=*/WGPUTextureFormat_Undefined \
|
||||
WGPU_COMMA /*.viewDimension=*/WGPUTextureViewDimension_2D \
|
||||
WGPU_COMMA})
|
||||
|
||||
#define WGPU_SUPPORTED_LIMITS_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUSupportedLimits, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.limits=*/WGPU_LIMITS_INIT \
|
||||
WGPU_COMMA})
|
||||
|
||||
#define WGPU_SURFACE_CAPABILITIES_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUSurfaceCapabilities, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.formatCount=*/ \
|
||||
{} WGPU_COMMA /*.formats=*/{} WGPU_COMMA /*.presentModeCount=*/ \
|
||||
{} WGPU_COMMA /*.presentModes=*/{} WGPU_COMMA /*.alphaModeCount=*/ \
|
||||
{} WGPU_COMMA /*.alphaModes=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_SURFACE_CONFIGURATION_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUSurfaceConfiguration, \
|
||||
{/*.nextInChain=*/NULL \
|
||||
WGPU_COMMA /*.device=*/{} WGPU_COMMA /*.format=*/ \
|
||||
{} WGPU_COMMA /*.usage=*/WGPUTextureUsage_RenderAttachment \
|
||||
WGPU_COMMA /*.viewFormatCount=*/0 WGPU_COMMA /*.viewFormats=*/ \
|
||||
NULL WGPU_COMMA /*.alphaMode=*/WGPUCompositeAlphaMode_Auto \
|
||||
WGPU_COMMA /*.width=*/{} WGPU_COMMA /*.height=*/ \
|
||||
{} WGPU_COMMA /*.presentMode=*/WGPUPresentMode_Fifo WGPU_COMMA})
|
||||
|
||||
#define WGPU_SURFACE_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUSurfaceDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WGPU_SURFACE_TEXTURE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUSurfaceTexture, \
|
||||
{/*.texture=*/{} WGPU_COMMA /*.suboptimal=*/ \
|
||||
{} WGPU_COMMA /*.status=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_TEXTURE_BINDING_LAYOUT_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUTextureBindingLayout, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.sampleType=*/ \
|
||||
WGPUTextureSampleType_Float \
|
||||
WGPU_COMMA /*.viewDimension=*/WGPUTextureViewDimension_2D \
|
||||
WGPU_COMMA /*.multisampled=*/false WGPU_COMMA})
|
||||
|
||||
#define WGPU_TEXTURE_BINDING_VIEW_DIMENSION_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUTextureBindingViewDimensionDescriptor, \
|
||||
{/*.chain= WGPUChainedStruct*/ { \
|
||||
/*.next=*/NULL WGPU_COMMA /*.sType=*/ \
|
||||
WGPUSType_TextureBindingViewDimensionDescriptor \
|
||||
WGPU_COMMA} WGPU_COMMA /*.textureBindingViewDimension=*/ \
|
||||
WGPUTextureViewDimension_Undefined WGPU_COMMA})
|
||||
|
||||
#define WGPU_TEXTURE_DATA_LAYOUT_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUTextureDataLayout, \
|
||||
{/*.nextInChain=*/NULL \
|
||||
WGPU_COMMA /*.offset=*/0 WGPU_COMMA /*.bytesPerRow=*/ \
|
||||
WGPU_COPY_STRIDE_UNDEFINED WGPU_COMMA /*.rowsPerImage=*/ \
|
||||
WGPU_COPY_STRIDE_UNDEFINED WGPU_COMMA})
|
||||
|
||||
#define WGPU_TEXTURE_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUTextureDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.usage=*/{} WGPU_COMMA /*.dimension=*/ \
|
||||
WGPUTextureDimension_2D WGPU_COMMA /*.size=*/ \
|
||||
WGPU_EXTENT_3D_INIT WGPU_COMMA /*.format=*/ \
|
||||
{} WGPU_COMMA /*.mipLevelCount=*/1 WGPU_COMMA /*.sampleCount=*/ \
|
||||
1 WGPU_COMMA /*.viewFormatCount=*/0 WGPU_COMMA /*.viewFormats=*/NULL \
|
||||
WGPU_COMMA})
|
||||
|
||||
#define WGPU_TEXTURE_VIEW_DESCRIPTOR_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUTextureViewDescriptor, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.label=*/NULL \
|
||||
WGPU_COMMA /*.format=*/WGPUTextureFormat_Undefined \
|
||||
WGPU_COMMA /*.dimension=*/WGPUTextureViewDimension_Undefined \
|
||||
WGPU_COMMA /*.baseMipLevel=*/ \
|
||||
0 WGPU_COMMA /*.mipLevelCount=*/WGPU_MIP_LEVEL_COUNT_UNDEFINED \
|
||||
WGPU_COMMA /*.baseArrayLayer=*/0 WGPU_COMMA /*.arrayLayerCount=*/ \
|
||||
WGPU_ARRAY_LAYER_COUNT_UNDEFINED \
|
||||
WGPU_COMMA /*.aspect=*/WGPUTextureAspect_All WGPU_COMMA})
|
||||
|
||||
#define WGPU_VERTEX_ATTRIBUTE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUVertexAttribute, \
|
||||
{/*.format=*/{} WGPU_COMMA /*.offset=*/ \
|
||||
{} WGPU_COMMA /*.shaderLocation=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_VERTEX_BUFFER_LAYOUT_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUVertexBufferLayout, \
|
||||
{/*.arrayStride=*/{} WGPU_COMMA /*.stepMode=*/ \
|
||||
{} WGPU_COMMA /*.attributeCount=*/ \
|
||||
{} WGPU_COMMA /*.attributes=*/{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_VERTEX_STATE_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT( \
|
||||
WGPUVertexState, \
|
||||
{/*.nextInChain=*/NULL \
|
||||
WGPU_COMMA /*.module=*/{} WGPU_COMMA /*.entryPoint=*/NULL \
|
||||
WGPU_COMMA /*.constantCount=*/0 WGPU_COMMA /*.constants=*/ \
|
||||
{} WGPU_COMMA /*.bufferCount=*/0 WGPU_COMMA /*.buffers=*/ \
|
||||
{} WGPU_COMMA})
|
||||
|
||||
#define WGPU_QUEUE_WORK_DONE_CALLBACK_INFO_INIT \
|
||||
WGPU_MAKE_INIT_STRUCT(WGPUQueueWorkDoneCallbackInfo, \
|
||||
{/*.nextInChain=*/NULL WGPU_COMMA /*.callback=*/NULL \
|
||||
WGPU_COMMA /*.userdata1=*/NULL \
|
||||
WGPU_COMMA /*.userdata2=*/NULL WGPU_COMMA})
|
||||
|
||||
#define WAGYU_STRING_VIEW(s) \
|
||||
WagyuStringView { s, (s != NULL) ? strlen(s) : 0 }
|
||||
|
||||
#endif // WEBGPU_COMPAT_H
|
||||
499
renderer/webgpu_player/egg_v2.h
Normal file
499
renderer/webgpu_player/egg_v2.h
Normal file
@@ -0,0 +1,499 @@
|
||||
unsigned char egg_v2[] = {
|
||||
0x52, 0x49, 0x56, 0x45, 0x07, 0x00, 0xd4, 0x9e, 0x50, 0xc4, 0x01, 0xea,
|
||||
0x04, 0xf2, 0x04, 0xe7, 0x04, 0xef, 0x05, 0xec, 0x04, 0xec, 0x01, 0xe9,
|
||||
0x04, 0xf1, 0x04, 0xe6, 0x04, 0x97, 0x03, 0xee, 0x05, 0xee, 0x03, 0xeb,
|
||||
0x04, 0xe8, 0x04, 0xf0, 0x05, 0xe5, 0x04, 0x96, 0x03, 0xed, 0x05, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x17, 0x00, 0x01, 0x0d,
|
||||
0x00, 0x40, 0x3e, 0x44, 0xc4, 0x01, 0x00, 0x07, 0x00, 0x80, 0xe6, 0x43,
|
||||
0x08, 0x00, 0x00, 0xcf, 0x43, 0xee, 0x03, 0x70, 0xec, 0x01, 0x00, 0x04,
|
||||
0x0a, 0x41, 0x72, 0x74, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x20, 0x33, 0x00,
|
||||
0x02, 0x05, 0x00, 0x0d, 0x00, 0x80, 0x6e, 0x43, 0x0e, 0x00, 0x00, 0x42,
|
||||
0x43, 0x00, 0x02, 0x05, 0x01, 0x00, 0x02, 0x05, 0x02, 0x0f, 0x43, 0xb1,
|
||||
0x1d, 0x40, 0x10, 0x3e, 0x36, 0xae, 0x3f, 0x0d, 0x00, 0x00, 0x81, 0x42,
|
||||
0x0e, 0x00, 0x00, 0x92, 0x42, 0x00, 0x29, 0x05, 0x03, 0x0f, 0xdb, 0x0f,
|
||||
0xc9, 0xbf, 0x59, 0x00, 0x00, 0x20, 0x41, 0x5a, 0x00, 0x10, 0x44, 0xbe,
|
||||
0x5b, 0x00, 0x20, 0x2a, 0x3e, 0x00, 0x02, 0x05, 0x02, 0x0f, 0x47, 0xd1,
|
||||
0x23, 0x3f, 0x0d, 0x00, 0x00, 0xe4, 0x41, 0x0e, 0x00, 0x00, 0x2a, 0xc2,
|
||||
0x00, 0x29, 0x05, 0x05, 0x0f, 0xdb, 0x0f, 0xc9, 0xbf, 0x59, 0x00, 0x00,
|
||||
0x20, 0x41, 0x5a, 0x00, 0x28, 0x07, 0xbe, 0x5b, 0x00, 0x00, 0x59, 0x3c,
|
||||
0x00, 0x02, 0x05, 0x02, 0x0f, 0x44, 0xb2, 0x86, 0xbf, 0x0d, 0x00, 0x00,
|
||||
0x98, 0xc2, 0x0e, 0x00, 0x00, 0x48, 0xc1, 0x00, 0x29, 0x05, 0x07, 0x0f,
|
||||
0xdb, 0x0f, 0xc9, 0xbf, 0x59, 0x00, 0x00, 0x20, 0x41, 0x5a, 0x00, 0x84,
|
||||
0x50, 0xbe, 0x5b, 0x00, 0xf8, 0x74, 0xbe, 0x00, 0x02, 0x05, 0x02, 0x0f,
|
||||
0x71, 0xe4, 0x2b, 0xc0, 0x10, 0xbf, 0xb3, 0x57, 0x3f, 0x11, 0xbf, 0xb3,
|
||||
0x57, 0x3f, 0x0d, 0x00, 0x00, 0x4e, 0xc2, 0x0e, 0x00, 0x00, 0xbd, 0x42,
|
||||
0x00, 0x29, 0x05, 0x09, 0x0f, 0xdb, 0x0f, 0xc9, 0xbf, 0x59, 0x00, 0x00,
|
||||
0x20, 0x41, 0x5a, 0x00, 0x3c, 0x4a, 0xbe, 0x5b, 0x00, 0xc8, 0x06, 0xbe,
|
||||
0x00, 0x02, 0x05, 0x02, 0x0d, 0x00, 0xdc, 0x30, 0x3e, 0x0e, 0x00, 0xb8,
|
||||
0x9b, 0x3e, 0x00, 0x29, 0x05, 0x0b, 0x0f, 0xdb, 0x0f, 0xc9, 0xbf, 0x59,
|
||||
0x88, 0x43, 0x4a, 0x41, 0x5a, 0x00, 0xdc, 0x30, 0xbe, 0x5b, 0x00, 0xb8,
|
||||
0x9b, 0xbe, 0x00, 0x02, 0x05, 0x0b, 0x0f, 0x93, 0x76, 0xfd, 0x3f, 0x0d,
|
||||
0x24, 0x4f, 0x1d, 0x42, 0x0e, 0x20, 0x91, 0xa1, 0x41, 0x00, 0x29, 0x05,
|
||||
0x0d, 0x0f, 0xdb, 0x0f, 0xc9, 0xbf, 0x59, 0x00, 0x00, 0x20, 0x41, 0x5a,
|
||||
0x00, 0xe0, 0x6f, 0xbe, 0x5b, 0x00, 0xa0, 0x74, 0xbd, 0x00, 0x02, 0x05,
|
||||
0x0b, 0x0f, 0x3c, 0x15, 0x9e, 0xbf, 0x0d, 0xdc, 0xb0, 0x36, 0xc2, 0x0e,
|
||||
0xc0, 0xdd, 0x04, 0xc1, 0x00, 0x29, 0x05, 0x0f, 0x0f, 0xdb, 0x0f, 0xc9,
|
||||
0xbf, 0x59, 0x00, 0x00, 0x20, 0x41, 0x5a, 0x00, 0x30, 0xdd, 0xbd, 0x5b,
|
||||
0x00, 0x80, 0x87, 0x3c, 0x00, 0x02, 0x05, 0x0b, 0x0f, 0x79, 0x03, 0xac,
|
||||
0x3e, 0x0d, 0x90, 0x3c, 0x0d, 0x41, 0x0e, 0xe0, 0x6e, 0xf6, 0xc1, 0x00,
|
||||
0x29, 0x05, 0x11, 0x0f, 0xdb, 0x0f, 0xc9, 0xbf, 0x59, 0x00, 0x00, 0x20,
|
||||
0x41, 0x5a, 0x00, 0x68, 0x49, 0xbe, 0x5b, 0x00, 0x80, 0x6b, 0x3e, 0x00,
|
||||
0x02, 0x05, 0x0b, 0x0f, 0x3f, 0xdc, 0x2d, 0xc0, 0x0d, 0x70, 0xc3, 0x72,
|
||||
0xc1, 0x0e, 0x90, 0xc8, 0x2a, 0x42, 0x00, 0x29, 0x05, 0x13, 0x0f, 0xdb,
|
||||
0x0f, 0xc9, 0xbf, 0x59, 0x00, 0x00, 0x20, 0x41, 0x5a, 0x00, 0xc0, 0x7e,
|
||||
0xbd, 0x5b, 0x00, 0x48, 0x5d, 0x3e, 0x00, 0x02, 0x05, 0x02, 0x0f, 0xf1,
|
||||
0xcf, 0x72, 0xbc, 0x0d, 0x00, 0x00, 0x80, 0x3f, 0x0e, 0x00, 0x00, 0xb8,
|
||||
0x41, 0x00, 0x02, 0x05, 0x15, 0x0d, 0xb6, 0xec, 0x7e, 0xc0, 0x0e, 0xe9,
|
||||
0x7f, 0x84, 0xc1, 0x00, 0x03, 0x05, 0x16, 0x12, 0x00, 0x00, 0x00, 0x3f,
|
||||
0x0f, 0xd1, 0xf3, 0xc6, 0x3e, 0x10, 0x42, 0x4b, 0x82, 0x3f, 0x11, 0x2d,
|
||||
0xf8, 0x52, 0x3f, 0x0d, 0xff, 0xff, 0xff, 0x40, 0x0e, 0x05, 0x00, 0x84,
|
||||
0xc1, 0x00, 0x10, 0x05, 0x17, 0x20, 0x01, 0x00, 0x06, 0x05, 0x18, 0x19,
|
||||
0x00, 0x00, 0xb8, 0xc1, 0x54, 0xdb, 0x0f, 0x49, 0x40, 0x55, 0x46, 0x96,
|
||||
0x6e, 0x41, 0x56, 0x00, 0x00, 0x00, 0x00, 0x57, 0x46, 0x96, 0x6e, 0x41,
|
||||
0x00, 0x2e, 0x05, 0x19, 0x66, 0x80, 0xff, 0x01, 0x67, 0x81, 0x0a, 0x6e,
|
||||
0x80, 0xff, 0x01, 0x6f, 0x81, 0x0a, 0x70, 0x80, 0xff, 0x01, 0x71, 0x81,
|
||||
0x0a, 0x00, 0x06, 0x05, 0x18, 0x18, 0x00, 0x00, 0xd8, 0x41, 0x54, 0xdb,
|
||||
0x0f, 0xc9, 0xbf, 0x55, 0xa4, 0x3d, 0x4b, 0x41, 0x56, 0xdb, 0x0f, 0xc9,
|
||||
0x3f, 0x57, 0xa4, 0x3d, 0x4b, 0x41, 0x00, 0x2e, 0x05, 0x1b, 0x67, 0x02,
|
||||
0x6f, 0x02, 0x71, 0x02, 0x00, 0x06, 0x05, 0x18, 0x19, 0x00, 0x00, 0xb8,
|
||||
0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x55, 0x46, 0x96, 0x6e, 0x41, 0x56,
|
||||
0xdb, 0x0f, 0x49, 0x40, 0x57, 0x46, 0x96, 0x6e, 0x41, 0x00, 0x2e, 0x05,
|
||||
0x1d, 0x66, 0x80, 0xff, 0x01, 0x67, 0x83, 0x0a, 0x6e, 0x80, 0xff, 0x01,
|
||||
0x6f, 0x83, 0x0a, 0x70, 0x80, 0xff, 0x01, 0x71, 0x83, 0x0a, 0x00, 0x06,
|
||||
0x05, 0x18, 0x18, 0x00, 0x00, 0xd8, 0xc1, 0x54, 0xdb, 0x0f, 0xc9, 0x3f,
|
||||
0x55, 0xa4, 0x3d, 0x4b, 0x41, 0x56, 0xdb, 0x0f, 0xc9, 0xbf, 0x57, 0xa4,
|
||||
0x3d, 0x4b, 0x41, 0x00, 0x2e, 0x05, 0x1f, 0x66, 0x80, 0xff, 0x01, 0x67,
|
||||
0x84, 0x0a, 0x6e, 0x80, 0xff, 0x01, 0x6f, 0x84, 0x0a, 0x70, 0x80, 0xff,
|
||||
0x01, 0x71, 0x84, 0x0a, 0x00, 0x2b, 0x05, 0x18, 0x68, 0xed, 0x98, 0x72,
|
||||
0x3f, 0x69, 0xa5, 0x0e, 0x9a, 0xbe, 0x6a, 0x55, 0x4a, 0xbe, 0x3e, 0x6b,
|
||||
0x89, 0x67, 0x44, 0x3f, 0x6c, 0x61, 0x43, 0x81, 0x43, 0x6d, 0xd9, 0x70,
|
||||
0x9a, 0x43, 0x00, 0x2c, 0x05, 0x21, 0x5f, 0x12, 0x60, 0xbd, 0xcb, 0xa8,
|
||||
0x3e, 0x61, 0x13, 0xb0, 0x71, 0x3f, 0x62, 0x13, 0xb0, 0x71, 0xbf, 0x63,
|
||||
0xbd, 0xcb, 0xa8, 0x3e, 0x64, 0x87, 0x5e, 0x83, 0x43, 0x65, 0x7e, 0x53,
|
||||
0x90, 0x43, 0x00, 0x2c, 0x05, 0x21, 0x5f, 0x0e, 0x60, 0x7e, 0xd8, 0x6a,
|
||||
0x3f, 0x61, 0x8d, 0xcc, 0xcb, 0xbe, 0x62, 0x8d, 0xcc, 0xcb, 0x3e, 0x63,
|
||||
0x7e, 0xd8, 0x6a, 0x3f, 0x64, 0xf3, 0xd2, 0x92, 0x43, 0x65, 0x89, 0xa7,
|
||||
0xa9, 0x43, 0x00, 0x2c, 0x05, 0x21, 0x5f, 0x14, 0x60, 0xae, 0x1e, 0xd3,
|
||||
0xbe, 0x61, 0x29, 0x39, 0x69, 0xbf, 0x62, 0x29, 0x39, 0x69, 0x3f, 0x63,
|
||||
0xae, 0x1e, 0xd3, 0xbe, 0x64, 0x51, 0x25, 0x6f, 0x43, 0x65, 0x15, 0xea,
|
||||
0xb4, 0x43, 0x00, 0x2c, 0x05, 0x21, 0x5f, 0x10, 0x60, 0x32, 0xb4, 0x71,
|
||||
0xbf, 0x61, 0x24, 0xb4, 0xa8, 0x3e, 0x62, 0x24, 0xb4, 0xa8, 0xbe, 0x63,
|
||||
0x32, 0xb4, 0x71, 0xbf, 0x64, 0xe3, 0x7a, 0x50, 0x43, 0x65, 0xc0, 0x8d,
|
||||
0x9b, 0x43, 0x00, 0x2c, 0x05, 0x21, 0x5f, 0x0c, 0x60, 0x2e, 0xbd, 0x3b,
|
||||
0xb3, 0x61, 0x00, 0x00, 0x80, 0x3f, 0x62, 0x00, 0x00, 0x80, 0xbf, 0x63,
|
||||
0x2e, 0xbd, 0x3b, 0xb3, 0x64, 0x00, 0x00, 0x7e, 0x43, 0x65, 0x00, 0x80,
|
||||
0x9f, 0x43, 0x00, 0x16, 0x05, 0x71, 0x2a, 0xd8, 0x9a, 0xdb, 0xc0, 0x21,
|
||||
0xe9, 0xf7, 0xf0, 0x41, 0x22, 0x2b, 0x58, 0x33, 0x40, 0x23, 0xcf, 0x8a,
|
||||
0x01, 0xc2, 0x00, 0x13, 0x05, 0x27, 0x26, 0xff, 0xff, 0xff, 0x43, 0x00,
|
||||
0x13, 0x05, 0x27, 0x26, 0xff, 0xff, 0xff, 0xee, 0x27, 0x00, 0x00, 0x80,
|
||||
0x3f, 0x00, 0x2a, 0x05, 0x17, 0x5c, 0x2b, 0x00, 0x03, 0x05, 0x16, 0x0f,
|
||||
0x33, 0xd5, 0xa9, 0x3e, 0x10, 0xe9, 0x7a, 0x62, 0x3f, 0x11, 0xa0, 0xa3,
|
||||
0x43, 0x3f, 0x0d, 0x77, 0xa2, 0xae, 0x36, 0x0e, 0x18, 0x92, 0x9a, 0x36,
|
||||
0x00, 0x10, 0x05, 0x2b, 0x20, 0x01, 0x00, 0x06, 0x05, 0x2c, 0x19, 0x00,
|
||||
0x00, 0x4a, 0xc2, 0x54, 0xdb, 0x0f, 0x49, 0x40, 0x55, 0x7f, 0x1f, 0xdf,
|
||||
0x41, 0x56, 0x00, 0x00, 0x00, 0x00, 0x57, 0x7f, 0x1f, 0xdf, 0x41, 0x00,
|
||||
0x2e, 0x05, 0x2d, 0x00, 0x06, 0x05, 0x2c, 0x18, 0x00, 0x00, 0x4a, 0x42,
|
||||
0x54, 0xdb, 0x0f, 0xc9, 0xbf, 0x55, 0x7f, 0x1f, 0xdf, 0x41, 0x56, 0xdb,
|
||||
0x0f, 0xc9, 0x3f, 0x57, 0x7f, 0x1f, 0xdf, 0x41, 0x00, 0x2e, 0x05, 0x2f,
|
||||
0x66, 0xfe, 0x03, 0x67, 0x82, 0x06, 0x6e, 0xfe, 0x03, 0x6f, 0x82, 0x06,
|
||||
0x70, 0xfe, 0x03, 0x71, 0x82, 0x06, 0x00, 0x06, 0x05, 0x2c, 0x19, 0x00,
|
||||
0x00, 0x4a, 0x42, 0x54, 0x00, 0x00, 0x00, 0x00, 0x55, 0x7f, 0x1f, 0xdf,
|
||||
0x41, 0x56, 0xdb, 0x0f, 0x49, 0x40, 0x57, 0x7f, 0x1f, 0xdf, 0x41, 0x00,
|
||||
0x2e, 0x05, 0x31, 0x67, 0x03, 0x6f, 0x03, 0x71, 0x03, 0x00, 0x06, 0x05,
|
||||
0x2c, 0x18, 0x00, 0x00, 0x4a, 0xc2, 0x54, 0xdb, 0x0f, 0xc9, 0x3f, 0x55,
|
||||
0x7f, 0x1f, 0xdf, 0x41, 0x56, 0xdb, 0x0f, 0xc9, 0xbf, 0x57, 0x7f, 0x1f,
|
||||
0xdf, 0x41, 0x00, 0x2e, 0x05, 0x33, 0x67, 0x04, 0x6f, 0x04, 0x71, 0x04,
|
||||
0x00, 0x2b, 0x05, 0x2c, 0x68, 0x31, 0x34, 0x57, 0x3f, 0x69, 0xcc, 0xd9,
|
||||
0x73, 0xbe, 0x6a, 0x5d, 0x25, 0x8d, 0x3e, 0x6b, 0x01, 0xe6, 0x39, 0x3f,
|
||||
0x6c, 0x94, 0xc5, 0x7a, 0x43, 0x6d, 0xcb, 0xbf, 0xa2, 0x43, 0x00, 0x2c,
|
||||
0x05, 0x35, 0x5f, 0x12, 0x60, 0xbd, 0xcb, 0xa8, 0x3e, 0x61, 0x13, 0xb0,
|
||||
0x71, 0x3f, 0x62, 0x13, 0xb0, 0x71, 0xbf, 0x63, 0xbd, 0xcb, 0xa8, 0x3e,
|
||||
0x64, 0x87, 0x5e, 0x83, 0x43, 0x65, 0x7e, 0x53, 0x90, 0x43, 0x00, 0x2c,
|
||||
0x05, 0x35, 0x5f, 0x0e, 0x60, 0x7e, 0xd8, 0x6a, 0x3f, 0x61, 0x8d, 0xcc,
|
||||
0xcb, 0xbe, 0x62, 0x8d, 0xcc, 0xcb, 0x3e, 0x63, 0x7e, 0xd8, 0x6a, 0x3f,
|
||||
0x64, 0xf3, 0xd2, 0x92, 0x43, 0x65, 0x89, 0xa7, 0xa9, 0x43, 0x00, 0x2c,
|
||||
0x05, 0x35, 0x5f, 0x14, 0x60, 0xae, 0x1e, 0xd3, 0xbe, 0x61, 0x29, 0x39,
|
||||
0x69, 0xbf, 0x62, 0x29, 0x39, 0x69, 0x3f, 0x63, 0xae, 0x1e, 0xd3, 0xbe,
|
||||
0x64, 0x51, 0x25, 0x6f, 0x43, 0x65, 0x15, 0xea, 0xb4, 0x43, 0x00, 0x2c,
|
||||
0x05, 0x35, 0x5f, 0x10, 0x60, 0x32, 0xb4, 0x71, 0xbf, 0x61, 0x24, 0xb4,
|
||||
0xa8, 0x3e, 0x62, 0x24, 0xb4, 0xa8, 0xbe, 0x63, 0x32, 0xb4, 0x71, 0xbf,
|
||||
0x64, 0xe3, 0x7a, 0x50, 0x43, 0x65, 0xc0, 0x8d, 0x9b, 0x43, 0x00, 0x12,
|
||||
0x05, 0x72, 0x25, 0x21, 0x21, 0xff, 0x4d, 0x00, 0x95, 0x04, 0x05, 0x72,
|
||||
0xed, 0x05, 0x00, 0x00, 0xc8, 0x41, 0xef, 0x05, 0x00, 0x00, 0x00, 0x41,
|
||||
0x00, 0x12, 0x05, 0x73, 0x25, 0x21, 0x21, 0xff, 0xff, 0x00, 0x95, 0x04,
|
||||
0x05, 0x73, 0xed, 0x05, 0x00, 0x00, 0xa0, 0x40, 0xef, 0x05, 0x00, 0x00,
|
||||
0x00, 0x40, 0x00, 0x12, 0x05, 0x74, 0x25, 0x00, 0x9e, 0xff, 0xff, 0x00,
|
||||
0x12, 0x05, 0x75, 0x25, 0x00, 0x5e, 0xff, 0xff, 0x00, 0x95, 0x04, 0x05,
|
||||
0x75, 0xed, 0x05, 0x00, 0x00, 0x98, 0x41, 0xee, 0x05, 0x00, 0x00, 0xa0,
|
||||
0x40, 0xef, 0x05, 0x00, 0x00, 0x40, 0xc1, 0xf0, 0x05, 0x01, 0x00, 0x12,
|
||||
0x05, 0x76, 0x25, 0x84, 0xea, 0xff, 0xff, 0x00, 0x95, 0x04, 0x05, 0x76,
|
||||
0xed, 0x05, 0x00, 0x00, 0xc0, 0x40, 0xee, 0x05, 0x00, 0x00, 0x80, 0xc0,
|
||||
0xef, 0x05, 0x00, 0x00, 0xc0, 0x40, 0xf0, 0x05, 0x01, 0x00, 0x12, 0x05,
|
||||
0x77, 0x25, 0x21, 0x21, 0xff, 0xff, 0x00, 0x95, 0x04, 0x05, 0x77, 0xed,
|
||||
0x05, 0x00, 0x00, 0xa0, 0x40, 0xef, 0x05, 0x00, 0x00, 0x80, 0xbf, 0xf0,
|
||||
0x05, 0x01, 0x00, 0x03, 0x05, 0x15, 0x10, 0x0e, 0x0c, 0x5d, 0x3f, 0x11,
|
||||
0x0e, 0x0c, 0x5d, 0x3f, 0x0d, 0x70, 0x22, 0xdc, 0x41, 0x0e, 0xf8, 0x3f,
|
||||
0x62, 0xc2, 0x00, 0x10, 0x05, 0x45, 0x20, 0x01, 0x00, 0x23, 0x05, 0x46,
|
||||
0x18, 0x7d, 0x11, 0x8a, 0xc0, 0x19, 0x95, 0x4e, 0x89, 0xc0, 0x52, 0xbe,
|
||||
0x61, 0x17, 0x3f, 0x53, 0x5c, 0x91, 0x61, 0x42, 0x00, 0x2e, 0x05, 0x47,
|
||||
0x00, 0x23, 0x05, 0x46, 0x18, 0x74, 0x51, 0x04, 0x42, 0x19, 0x03, 0x84,
|
||||
0xdb, 0x42, 0x52, 0xdf, 0xf7, 0x3a, 0x40, 0x53, 0x95, 0x8b, 0x6a, 0x42,
|
||||
0x00, 0x2e, 0x05, 0x49, 0x67, 0x02, 0x6f, 0x02, 0x71, 0x02, 0x00, 0x23,
|
||||
0x05, 0x46, 0x18, 0x38, 0x3b, 0xad, 0xc2, 0x19, 0xa3, 0xb0, 0x03, 0x43,
|
||||
0x52, 0xf6, 0x3c, 0x2d, 0xc0, 0x53, 0x3c, 0x2e, 0x69, 0x42, 0x00, 0x2e,
|
||||
0x05, 0x4b, 0x67, 0x03, 0x6f, 0x03, 0x71, 0x03, 0x00, 0x23, 0x05, 0x46,
|
||||
0x18, 0x38, 0x49, 0xda, 0xc2, 0x19, 0x00, 0x15, 0xc1, 0x41, 0x52, 0x8b,
|
||||
0x0a, 0x8c, 0xbf, 0x53, 0xd9, 0xb5, 0x1a, 0x42, 0x00, 0x2e, 0x05, 0x4d,
|
||||
0x67, 0x04, 0x6f, 0x04, 0x71, 0x04, 0x00, 0x2b, 0x05, 0x46, 0x68, 0xd7,
|
||||
0x05, 0x5d, 0x3f, 0x69, 0x22, 0xa7, 0x51, 0x3c, 0x6a, 0x22, 0xa7, 0x51,
|
||||
0xbc, 0x6b, 0xd7, 0x05, 0x5d, 0x3f, 0x6c, 0x79, 0xd6, 0x8c, 0x43, 0x6d,
|
||||
0x9a, 0x84, 0x8e, 0x43, 0x00, 0x2c, 0x05, 0x4f, 0x5f, 0x06, 0x60, 0x2d,
|
||||
0xdd, 0x18, 0x3f, 0x61, 0x97, 0x59, 0x4d, 0x3f, 0x62, 0x97, 0x59, 0x4d,
|
||||
0xbf, 0x63, 0x2d, 0xdd, 0x18, 0x3f, 0x64, 0x70, 0x31, 0x8d, 0x43, 0x65,
|
||||
0x46, 0x37, 0x8a, 0x43, 0x00, 0x2c, 0x05, 0x4f, 0x5f, 0x04, 0x60, 0xdb,
|
||||
0x62, 0xa4, 0x3e, 0x61, 0x4d, 0x72, 0x72, 0xbf, 0x62, 0x4d, 0x72, 0x72,
|
||||
0x3f, 0x63, 0xdb, 0x62, 0xa4, 0x3e, 0x64, 0x62, 0xd0, 0xa0, 0x43, 0x65,
|
||||
0xfe, 0xa3, 0xc2, 0x43, 0x00, 0x2c, 0x05, 0x4f, 0x5f, 0x0a, 0x60, 0x65,
|
||||
0x5c, 0xe1, 0xbe, 0x61, 0x1b, 0xde, 0x65, 0xbf, 0x62, 0x1b, 0xde, 0x65,
|
||||
0x3f, 0x63, 0x65, 0x5c, 0xe1, 0xbe, 0x64, 0x91, 0x9e, 0x4a, 0x43, 0x65,
|
||||
0x41, 0xda, 0xce, 0x43, 0x00, 0x2c, 0x05, 0x4f, 0x5f, 0x08, 0x60, 0xcb,
|
||||
0x5a, 0x5e, 0xbf, 0x61, 0x39, 0xba, 0xfd, 0x3e, 0x62, 0x39, 0xba, 0xfd,
|
||||
0xbe, 0x63, 0xcb, 0x5a, 0x5e, 0xbf, 0x64, 0xf9, 0xb0, 0x31, 0x43, 0x65,
|
||||
0x77, 0x47, 0x99, 0x43, 0x00, 0x95, 0x04, 0x05, 0x78, 0xed, 0x05, 0x00,
|
||||
0x00, 0x20, 0x41, 0x00, 0x16, 0x05, 0x78, 0x2a, 0x6d, 0xa2, 0x53, 0x41,
|
||||
0x21, 0x6d, 0x2c, 0xf9, 0x41, 0x22, 0xcc, 0x71, 0xaa, 0xc2, 0x23, 0x2d,
|
||||
0xd7, 0xfe, 0x42, 0x00, 0x13, 0x05, 0x55, 0x00, 0x13, 0x05, 0x55, 0x26,
|
||||
0xda, 0xe5, 0xfb, 0xff, 0x27, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x03, 0x05,
|
||||
0x15, 0x0d, 0xa8, 0x87, 0x02, 0x42, 0x0e, 0x94, 0xbd, 0x73, 0xc2, 0x00,
|
||||
0x10, 0x05, 0x58, 0x20, 0x01, 0x00, 0x23, 0x05, 0x59, 0x18, 0x7d, 0x11,
|
||||
0x8a, 0xc0, 0x19, 0x95, 0x4e, 0x89, 0xc0, 0x52, 0xbe, 0x61, 0x17, 0x3f,
|
||||
0x53, 0x5c, 0x91, 0x61, 0x42, 0x00, 0x2e, 0x05, 0x5a, 0x00, 0x23, 0x05,
|
||||
0x59, 0x18, 0x74, 0x51, 0x04, 0x42, 0x19, 0x03, 0x84, 0xdb, 0x42, 0x52,
|
||||
0xdf, 0xf7, 0x3a, 0x40, 0x53, 0x95, 0x8b, 0x6a, 0x42, 0x00, 0x2e, 0x05,
|
||||
0x5c, 0x67, 0x02, 0x6f, 0x02, 0x71, 0x02, 0x00, 0x23, 0x05, 0x59, 0x18,
|
||||
0x38, 0x3b, 0xad, 0xc2, 0x19, 0xa3, 0xb0, 0x03, 0x43, 0x52, 0xf6, 0x3c,
|
||||
0x2d, 0xc0, 0x53, 0x3c, 0x2e, 0x69, 0x42, 0x00, 0x2e, 0x05, 0x5e, 0x67,
|
||||
0x03, 0x6f, 0x03, 0x71, 0x03, 0x00, 0x23, 0x05, 0x59, 0x18, 0x38, 0x49,
|
||||
0xda, 0xc2, 0x19, 0x00, 0x15, 0xc1, 0x41, 0x52, 0x8b, 0x0a, 0x8c, 0xbf,
|
||||
0x53, 0xd9, 0xb5, 0x1a, 0x42, 0x00, 0x2e, 0x05, 0x60, 0x67, 0x04, 0x6f,
|
||||
0x04, 0x71, 0x04, 0x00, 0x2b, 0x05, 0x59, 0x68, 0xce, 0xf8, 0x7f, 0x3f,
|
||||
0x69, 0xd7, 0xcd, 0x72, 0x3c, 0x6a, 0xd7, 0xcd, 0x72, 0xbc, 0x6b, 0xce,
|
||||
0xf8, 0x7f, 0x3f, 0x6c, 0xe9, 0x5c, 0x8f, 0x43, 0x6d, 0x42, 0x4b, 0x8c,
|
||||
0x43, 0x00, 0x2c, 0x05, 0x62, 0x5f, 0x06, 0x60, 0x2d, 0xdd, 0x18, 0x3f,
|
||||
0x61, 0x97, 0x59, 0x4d, 0x3f, 0x62, 0x97, 0x59, 0x4d, 0xbf, 0x63, 0x2d,
|
||||
0xdd, 0x18, 0x3f, 0x64, 0x70, 0x31, 0x8d, 0x43, 0x65, 0x46, 0x37, 0x8a,
|
||||
0x43, 0x00, 0x2c, 0x05, 0x62, 0x5f, 0x04, 0x60, 0xdb, 0x62, 0xa4, 0x3e,
|
||||
0x61, 0x4d, 0x72, 0x72, 0xbf, 0x62, 0x4d, 0x72, 0x72, 0x3f, 0x63, 0xdb,
|
||||
0x62, 0xa4, 0x3e, 0x64, 0x62, 0xd0, 0xa0, 0x43, 0x65, 0xfe, 0xa3, 0xc2,
|
||||
0x43, 0x00, 0x2c, 0x05, 0x62, 0x5f, 0x0a, 0x60, 0x65, 0x5c, 0xe1, 0xbe,
|
||||
0x61, 0x1b, 0xde, 0x65, 0xbf, 0x62, 0x1b, 0xde, 0x65, 0x3f, 0x63, 0x65,
|
||||
0x5c, 0xe1, 0xbe, 0x64, 0x91, 0x9e, 0x4a, 0x43, 0x65, 0x41, 0xda, 0xce,
|
||||
0x43, 0x00, 0x2c, 0x05, 0x62, 0x5f, 0x08, 0x60, 0xcb, 0x5a, 0x5e, 0xbf,
|
||||
0x61, 0x39, 0xba, 0xfd, 0x3e, 0x62, 0x39, 0xba, 0xfd, 0xbe, 0x63, 0xcb,
|
||||
0x5a, 0x5e, 0xbf, 0x64, 0xf9, 0xb0, 0x31, 0x43, 0x65, 0x77, 0x47, 0x99,
|
||||
0x43, 0x00, 0x95, 0x04, 0x05, 0x79, 0xef, 0x05, 0x00, 0x00, 0x20, 0x41,
|
||||
0x00, 0x11, 0x05, 0x79, 0x2a, 0x72, 0xb1, 0x26, 0xc2, 0x21, 0xc3, 0x60,
|
||||
0xca, 0x41, 0x22, 0xcc, 0x38, 0x56, 0x42, 0x23, 0x1c, 0xa7, 0x09, 0x43,
|
||||
0x00, 0x13, 0x05, 0x68, 0x26, 0xd1, 0xc5, 0xbb, 0xff, 0x27, 0x00, 0x00,
|
||||
0x80, 0x3f, 0x00, 0x13, 0x05, 0x68, 0x26, 0xa9, 0xb6, 0xe1, 0xff, 0x00,
|
||||
0x12, 0x05, 0x7a, 0x25, 0xff, 0xff, 0xff, 0xff, 0x00, 0x95, 0x04, 0x05,
|
||||
0x7b, 0xef, 0x05, 0x00, 0x00, 0xa0, 0xc0, 0xf0, 0x05, 0x01, 0x00, 0x16,
|
||||
0x05, 0x7b, 0x2a, 0xa9, 0x87, 0x02, 0xc2, 0x21, 0xbc, 0x0b, 0x3b, 0x43,
|
||||
0x22, 0x28, 0x7a, 0x3b, 0xc2, 0x23, 0xc2, 0x4d, 0xbc, 0xc1, 0x00, 0x13,
|
||||
0x05, 0x6d, 0x26, 0x8e, 0xb8, 0xff, 0xff, 0x00, 0x13, 0x05, 0x6d, 0x26,
|
||||
0xed, 0xd6, 0xac, 0xff, 0x27, 0x00, 0x00, 0x80, 0x3f, 0x00, 0xa4, 0x03,
|
||||
0x05, 0x00, 0xe5, 0x04, 0x01, 0xe6, 0x04, 0x01, 0xe7, 0x04, 0x01, 0xe8,
|
||||
0x04, 0x01, 0xe9, 0x04, 0x01, 0xea, 0x04, 0x01, 0xeb, 0x04, 0x01, 0xec,
|
||||
0x04, 0x01, 0xf1, 0x04, 0x01, 0xf2, 0x04, 0x01, 0x00, 0x14, 0x05, 0x17,
|
||||
0x28, 0x02, 0x00, 0x14, 0x05, 0x2b, 0x28, 0x02, 0x00, 0x14, 0x05, 0x2b,
|
||||
0x28, 0x02, 0x00, 0x14, 0x05, 0x2b, 0x00, 0x14, 0x05, 0x2b, 0x28, 0x02,
|
||||
0x00, 0x14, 0x05, 0x2b, 0x28, 0x02, 0x00, 0x14, 0x05, 0x2b, 0x28, 0x02,
|
||||
0x00, 0x14, 0x05, 0x45, 0x28, 0x02, 0x00, 0x14, 0x05, 0x58, 0x28, 0x02,
|
||||
0x00, 0x14, 0x05, 0x58, 0x00, 0x14, 0x05, 0x58, 0x28, 0x02, 0x00, 0x1c,
|
||||
0x3f, 0x34, 0x1a, 0x47, 0x3e, 0x40, 0xd6, 0x16, 0x35, 0x3f, 0x00, 0x1c,
|
||||
0x41, 0x93, 0x49, 0x6c, 0x3f, 0x42, 0x32, 0x7e, 0x85, 0x3e, 0x00, 0x1c,
|
||||
0x00, 0x1c, 0x41, 0xb7, 0xdb, 0x64, 0x3f, 0x42, 0xec, 0x4c, 0xde, 0x3e,
|
||||
0x00, 0xae, 0x01, 0x97, 0x03, 0xec, 0xd1, 0x93, 0x3e, 0x00, 0x1c, 0x3f,
|
||||
0x3c, 0x1e, 0xbb, 0x3d, 0x40, 0x3c, 0x96, 0x6e, 0x3f, 0x00, 0x1c, 0x3f,
|
||||
0x67, 0x1f, 0x25, 0x3e, 0x41, 0x18, 0x20, 0x80, 0x3d, 0x42, 0x00, 0x00,
|
||||
0x80, 0x3f, 0x00, 0xae, 0x01, 0x96, 0x03, 0xcd, 0xcc, 0xf9, 0x3e, 0x97,
|
||||
0x03, 0xe1, 0xfa, 0xa7, 0x3e, 0x00, 0xae, 0x01, 0x97, 0x03, 0xec, 0x51,
|
||||
0x88, 0x3e, 0x00, 0x1c, 0x41, 0x51, 0x28, 0x4c, 0x3f, 0x42, 0xcf, 0x04,
|
||||
0x22, 0x3f, 0x00, 0x1c, 0x3f, 0x5c, 0x8f, 0x42, 0x3e, 0x40, 0x8f, 0xc2,
|
||||
0x35, 0x3f, 0x00, 0x1c, 0x41, 0xa5, 0xd2, 0x44, 0x3f, 0x42, 0x2b, 0x6c,
|
||||
0xea, 0x3e, 0x00, 0x1c, 0x3f, 0x6e, 0x32, 0x45, 0x3e, 0x41, 0x44, 0x8c,
|
||||
0x6d, 0x3d, 0x42, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1c, 0x3f, 0x2c, 0x16,
|
||||
0x93, 0x3e, 0x40, 0xdb, 0x22, 0x0d, 0x3f, 0x00, 0x1c, 0x41, 0x77, 0x3b,
|
||||
0x4f, 0x3f, 0x42, 0xd5, 0x93, 0xff, 0x3e, 0x00, 0x1c, 0x3f, 0x5c, 0x8f,
|
||||
0x42, 0x3e, 0x41, 0x8f, 0xc2, 0x75, 0x3d, 0x00, 0x1f, 0x37, 0x06, 0x4d,
|
||||
0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x39, 0x78, 0x3b, 0x01, 0x00, 0x19, 0x33,
|
||||
0x02, 0x00, 0x1a, 0x35, 0x10, 0x00, 0x1e, 0x43, 0x06, 0x44, 0x02, 0x45,
|
||||
0x7c, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x14, 0x44, 0x02,
|
||||
0x45, 0x7d, 0x46, 0xb1, 0x22, 0x9f, 0x3f, 0x00, 0x1e, 0x43, 0x20, 0x44,
|
||||
0x02, 0x45, 0x7e, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x11,
|
||||
0x00, 0x1e, 0x43, 0x06, 0x44, 0x02, 0x45, 0x7c, 0x46, 0x00, 0x00, 0x80,
|
||||
0x3f, 0x00, 0x1e, 0x43, 0x14, 0x44, 0x02, 0x45, 0x7d, 0x46, 0xb1, 0x22,
|
||||
0x9f, 0x3f, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x02, 0x45, 0x7e, 0x46, 0x00,
|
||||
0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x0d, 0x00, 0x1e, 0x43, 0x06, 0x44,
|
||||
0x02, 0x45, 0x7c, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x02, 0x45, 0x7e, 0x00,
|
||||
0x1a, 0x35, 0x0e, 0x00, 0x1e, 0x43, 0x06, 0x44, 0x02, 0x45, 0x7c, 0x00,
|
||||
0x1e, 0x43, 0x14, 0x44, 0x02, 0x45, 0x7d, 0x46, 0x00, 0x00, 0xac, 0xc2,
|
||||
0x00, 0x1e, 0x43, 0x20, 0x44, 0x02, 0x45, 0x7e, 0x00, 0x19, 0x33, 0x0f,
|
||||
0x00, 0x1a, 0x35, 0x10, 0x00, 0x1e, 0x44, 0x01, 0x46, 0x00, 0x00, 0x80,
|
||||
0x3f, 0x00, 0x1e, 0x43, 0x03, 0x44, 0x01, 0x46, 0x24, 0x50, 0x55, 0x3f,
|
||||
0x00, 0x1e, 0x43, 0x17, 0x44, 0x02, 0x45, 0x7f, 0x46, 0x9a, 0x19, 0xb2,
|
||||
0x3f, 0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e, 0x46, 0xe1, 0x3a,
|
||||
0x99, 0x3f, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x04, 0x45, 0x80, 0x01, 0x46,
|
||||
0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46, 0x00,
|
||||
0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x11, 0x00, 0x1e, 0x44, 0x01, 0x46,
|
||||
0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x03, 0x44, 0x01, 0x46, 0x24,
|
||||
0x50, 0x55, 0x3f, 0x00, 0x1e, 0x43, 0x17, 0x44, 0x02, 0x45, 0x7f, 0x46,
|
||||
0x9a, 0x19, 0xb2, 0x3f, 0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e,
|
||||
0x46, 0xe1, 0x3a, 0x99, 0x3f, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x04, 0x45,
|
||||
0x80, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x4c, 0x44,
|
||||
0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x0d, 0x00, 0x1e,
|
||||
0x44, 0x01, 0x46, 0xdc, 0xb0, 0x36, 0xc2, 0x00, 0x1e, 0x43, 0x03, 0x44,
|
||||
0x02, 0x45, 0x81, 0x01, 0x46, 0x00, 0x00, 0x22, 0xc2, 0x00, 0x1e, 0x43,
|
||||
0x05, 0x44, 0x02, 0x45, 0x81, 0x01, 0x46, 0x00, 0x00, 0x22, 0xc2, 0x00,
|
||||
0x1e, 0x43, 0x17, 0x44, 0x02, 0x45, 0x7f, 0x46, 0x00, 0x00, 0x36, 0xc2,
|
||||
0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e, 0x46, 0xdc, 0xb0, 0x36,
|
||||
0xc2, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x04, 0x45, 0x80, 0x01, 0x46, 0x00,
|
||||
0x00, 0x20, 0xc2, 0x00, 0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46, 0xdc, 0xb0,
|
||||
0x36, 0xc2, 0x00, 0x1a, 0x35, 0x0e, 0x00, 0x1e, 0x44, 0x01, 0x46, 0xc0,
|
||||
0xdd, 0x04, 0xc1, 0x00, 0x1e, 0x43, 0x03, 0x44, 0x02, 0x45, 0x81, 0x01,
|
||||
0x46, 0x00, 0x00, 0xf0, 0xc0, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x02, 0x45,
|
||||
0x81, 0x01, 0x46, 0x00, 0x00, 0xf0, 0xc0, 0x00, 0x1e, 0x43, 0x17, 0x44,
|
||||
0x02, 0x45, 0x7f, 0x46, 0x00, 0x00, 0x48, 0xc1, 0x00, 0x1e, 0x43, 0x1f,
|
||||
0x44, 0x02, 0x45, 0x7e, 0x46, 0xc0, 0xdd, 0x04, 0xc1, 0x00, 0x1e, 0x43,
|
||||
0x23, 0x44, 0x04, 0x45, 0x80, 0x01, 0x46, 0x00, 0x00, 0xe0, 0xc0, 0x00,
|
||||
0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46, 0xc0, 0xdd, 0x04, 0xc1, 0x00, 0x1a,
|
||||
0x35, 0x0f, 0x00, 0x1e, 0x44, 0x01, 0x46, 0x3c, 0x15, 0x9e, 0xbf, 0x00,
|
||||
0x1e, 0x43, 0x17, 0x44, 0x02, 0x45, 0x7f, 0x46, 0x3c, 0x15, 0x9e, 0xbf,
|
||||
0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e, 0x46, 0x3c, 0x15, 0x9e,
|
||||
0xbf, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x04, 0x45, 0x80, 0x01, 0x46, 0x3c,
|
||||
0x15, 0x9e, 0xbf, 0x00, 0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46, 0x3c, 0x15,
|
||||
0x9e, 0xbf, 0x00, 0x19, 0x33, 0x0d, 0x00, 0x1a, 0x35, 0x10, 0x00, 0x1e,
|
||||
0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x03, 0x44,
|
||||
0x01, 0x46, 0x24, 0x50, 0x55, 0x3f, 0x00, 0x1e, 0x43, 0x17, 0x44, 0x02,
|
||||
0x45, 0x7f, 0x46, 0x9a, 0x19, 0xb2, 0x3f, 0x00, 0x1e, 0x43, 0x1f, 0x44,
|
||||
0x02, 0x45, 0x7e, 0x46, 0xe1, 0x3a, 0x99, 0x3f, 0x00, 0x1e, 0x43, 0x23,
|
||||
0x44, 0x04, 0x45, 0x80, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e,
|
||||
0x43, 0x4c, 0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35,
|
||||
0x11, 0x00, 0x1e, 0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e,
|
||||
0x43, 0x03, 0x44, 0x01, 0x46, 0x24, 0x50, 0x55, 0x3f, 0x00, 0x1e, 0x43,
|
||||
0x17, 0x44, 0x02, 0x45, 0x7f, 0x46, 0x9a, 0x19, 0xb2, 0x3f, 0x00, 0x1e,
|
||||
0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e, 0x46, 0xe1, 0x3a, 0x99, 0x3f, 0x00,
|
||||
0x1e, 0x43, 0x23, 0x44, 0x04, 0x45, 0x80, 0x01, 0x46, 0x00, 0x00, 0x80,
|
||||
0x3f, 0x00, 0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f,
|
||||
0x00, 0x1a, 0x35, 0x0d, 0x00, 0x1e, 0x44, 0x01, 0x46, 0x24, 0x4f, 0x1d,
|
||||
0x42, 0x00, 0x1e, 0x43, 0x03, 0x44, 0x02, 0x45, 0x81, 0x01, 0x46, 0x00,
|
||||
0x00, 0xcc, 0x41, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x02, 0x45, 0x81, 0x01,
|
||||
0x46, 0x00, 0x00, 0xcc, 0x41, 0x00, 0x1e, 0x43, 0x17, 0x44, 0x02, 0x45,
|
||||
0x7f, 0x46, 0x00, 0x00, 0x1e, 0x42, 0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02,
|
||||
0x45, 0x7e, 0x46, 0x24, 0x4f, 0x1d, 0x42, 0x00, 0x1e, 0x43, 0x23, 0x44,
|
||||
0x04, 0x45, 0x80, 0x01, 0x46, 0x00, 0x00, 0xf8, 0x41, 0x00, 0x1e, 0x43,
|
||||
0x4c, 0x44, 0x01, 0x46, 0x24, 0x4f, 0x1d, 0x42, 0x00, 0x1a, 0x35, 0x0e,
|
||||
0x00, 0x1e, 0x44, 0x01, 0x46, 0x20, 0x91, 0xa1, 0x41, 0x00, 0x1e, 0x43,
|
||||
0x03, 0x44, 0x02, 0x45, 0x81, 0x01, 0x46, 0x00, 0x00, 0xf0, 0x40, 0x00,
|
||||
0x1e, 0x43, 0x05, 0x44, 0x02, 0x45, 0x81, 0x01, 0x46, 0x00, 0x00, 0xf0,
|
||||
0x40, 0x00, 0x1e, 0x43, 0x17, 0x44, 0x02, 0x45, 0x7f, 0x46, 0x00, 0x00,
|
||||
0x50, 0x41, 0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e, 0x46, 0x20,
|
||||
0x91, 0xa1, 0x41, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x04, 0x45, 0x80, 0x01,
|
||||
0x46, 0x00, 0x00, 0x88, 0x41, 0x00, 0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46,
|
||||
0x20, 0x91, 0xa1, 0x41, 0x00, 0x1a, 0x35, 0x0f, 0x00, 0x1e, 0x44, 0x01,
|
||||
0x46, 0x93, 0x76, 0xfd, 0x3f, 0x00, 0x1e, 0x43, 0x17, 0x44, 0x02, 0x45,
|
||||
0x7f, 0x46, 0x93, 0x76, 0xfd, 0x3f, 0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02,
|
||||
0x45, 0x7e, 0x46, 0x93, 0x76, 0xfd, 0x3f, 0x00, 0x1e, 0x43, 0x23, 0x44,
|
||||
0x04, 0x45, 0x80, 0x01, 0x46, 0x93, 0x76, 0xfd, 0x3f, 0x00, 0x1e, 0x43,
|
||||
0x4c, 0x44, 0x01, 0x46, 0x93, 0x76, 0xfd, 0x3f, 0x00, 0x19, 0x33, 0x07,
|
||||
0x00, 0x1a, 0x35, 0x10, 0x00, 0x1e, 0x44, 0x02, 0x45, 0x82, 0x01, 0x46,
|
||||
0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x04, 0x45, 0x83,
|
||||
0x01, 0x46, 0x2b, 0x95, 0x77, 0x3f, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x04,
|
||||
0x45, 0x84, 0x01, 0x46, 0x3e, 0xb0, 0x3b, 0x3f, 0x00, 0x1e, 0x43, 0x41,
|
||||
0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x11, 0x00,
|
||||
0x1e, 0x44, 0x02, 0x45, 0x82, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00,
|
||||
0x1e, 0x43, 0x41, 0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1a,
|
||||
0x35, 0x0d, 0x00, 0x1e, 0x44, 0x02, 0x45, 0x82, 0x01, 0x46, 0x00, 0x00,
|
||||
0x98, 0xc2, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x04, 0x45, 0x83, 0x01, 0x46,
|
||||
0x00, 0x00, 0xaf, 0xc2, 0x00, 0x1e, 0x43, 0x14, 0x44, 0x02, 0x45, 0x85,
|
||||
0x01, 0x46, 0x00, 0x00, 0x76, 0xc2, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x04,
|
||||
0x45, 0x84, 0x01, 0x46, 0x00, 0x00, 0x89, 0xc2, 0x00, 0x1e, 0x43, 0x41,
|
||||
0x44, 0x01, 0x46, 0x00, 0x00, 0x98, 0xc2, 0x00, 0x1a, 0x35, 0x0e, 0x00,
|
||||
0x1e, 0x44, 0x02, 0x45, 0x82, 0x01, 0x46, 0x00, 0x00, 0x48, 0xc1, 0x00,
|
||||
0x1e, 0x43, 0x05, 0x44, 0x04, 0x45, 0x83, 0x01, 0x46, 0x00, 0x00, 0x78,
|
||||
0xc1, 0x00, 0x1e, 0x43, 0x14, 0x44, 0x02, 0x45, 0x85, 0x01, 0x46, 0x00,
|
||||
0x00, 0xd0, 0xc0, 0x00, 0x1e, 0x43, 0x41, 0x44, 0x01, 0x46, 0x00, 0x00,
|
||||
0x48, 0xc1, 0x00, 0x1a, 0x35, 0x0f, 0x00, 0x1e, 0x44, 0x02, 0x45, 0x82,
|
||||
0x01, 0x46, 0x44, 0xb2, 0x86, 0xbf, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x04,
|
||||
0x45, 0x84, 0x01, 0x46, 0x38, 0xa1, 0x84, 0xbf, 0x00, 0x1e, 0x43, 0x41,
|
||||
0x44, 0x01, 0x46, 0x44, 0xb2, 0x86, 0xbf, 0x00, 0x19, 0x33, 0x05, 0x00,
|
||||
0x1a, 0x35, 0x10, 0x00, 0x1e, 0x44, 0x02, 0x45, 0x82, 0x01, 0x46, 0x00,
|
||||
0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x04, 0x45, 0x83, 0x01,
|
||||
0x46, 0xcd, 0x8c, 0x9d, 0x3f, 0x00, 0x1e, 0x43, 0x41, 0x44, 0x01, 0x46,
|
||||
0x00, 0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x11, 0x00, 0x1e, 0x44, 0x02,
|
||||
0x45, 0x82, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x41,
|
||||
0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x0d, 0x00,
|
||||
0x1e, 0x44, 0x02, 0x45, 0x82, 0x01, 0x46, 0x00, 0x00, 0xe4, 0x41, 0x00,
|
||||
0x1e, 0x43, 0x05, 0x44, 0x04, 0x45, 0x83, 0x01, 0x46, 0x00, 0x00, 0x08,
|
||||
0x42, 0x00, 0x1e, 0x43, 0x14, 0x44, 0x02, 0x45, 0x85, 0x01, 0x46, 0x00,
|
||||
0x00, 0xc8, 0x41, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x04, 0x45, 0x84, 0x01,
|
||||
0x46, 0x00, 0x00, 0xd0, 0x41, 0x00, 0x1e, 0x43, 0x41, 0x44, 0x01, 0x46,
|
||||
0x00, 0x00, 0xe4, 0x41, 0x00, 0x1a, 0x35, 0x0e, 0x00, 0x1e, 0x44, 0x02,
|
||||
0x45, 0x82, 0x01, 0x46, 0x00, 0x00, 0x2a, 0xc2, 0x00, 0x1e, 0x43, 0x05,
|
||||
0x44, 0x04, 0x45, 0x83, 0x01, 0x46, 0x00, 0x00, 0x4c, 0xc2, 0x00, 0x1e,
|
||||
0x43, 0x14, 0x44, 0x02, 0x45, 0x85, 0x01, 0x46, 0x00, 0x00, 0x0e, 0xc2,
|
||||
0x00, 0x1e, 0x43, 0x20, 0x44, 0x04, 0x45, 0x84, 0x01, 0x46, 0x00, 0x00,
|
||||
0x22, 0xc2, 0x00, 0x1e, 0x43, 0x41, 0x44, 0x01, 0x46, 0x00, 0x00, 0x2a,
|
||||
0xc2, 0x00, 0x1a, 0x35, 0x0f, 0x00, 0x1e, 0x44, 0x02, 0x45, 0x82, 0x01,
|
||||
0x46, 0x47, 0xd1, 0x23, 0x3f, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x04, 0x45,
|
||||
0x84, 0x01, 0x46, 0xd5, 0x21, 0xf3, 0x3e, 0x00, 0x1e, 0x43, 0x41, 0x44,
|
||||
0x01, 0x46, 0x47, 0xd1, 0x23, 0x3f, 0x00, 0x19, 0x33, 0x67, 0x00, 0x1a,
|
||||
0x35, 0xed, 0x05, 0x00, 0x1e, 0x43, 0x06, 0x44, 0x02, 0x45, 0x86, 0x01,
|
||||
0x46, 0x00, 0x00, 0x40, 0x41, 0x00, 0x1e, 0x43, 0x14, 0x44, 0x02, 0x45,
|
||||
0x87, 0x01, 0x46, 0x00, 0x00, 0x28, 0x42, 0x00, 0x1e, 0x43, 0x20, 0x44,
|
||||
0x01, 0x46, 0x00, 0x00, 0x40, 0x41, 0x00, 0x1a, 0x35, 0xef, 0x05, 0x00,
|
||||
0x1e, 0x43, 0x06, 0x44, 0x02, 0x45, 0x86, 0x01, 0x46, 0x00, 0x00, 0x20,
|
||||
0x41, 0x00, 0x1e, 0x43, 0x14, 0x44, 0x02, 0x45, 0x87, 0x01, 0x46, 0x00,
|
||||
0x00, 0xd6, 0x42, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x01, 0x46, 0x00, 0x00,
|
||||
0x20, 0x41, 0x00, 0x19, 0x33, 0x13, 0x00, 0x1a, 0x35, 0x10, 0x00, 0x1e,
|
||||
0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x03, 0x44,
|
||||
0x01, 0x46, 0x9a, 0x99, 0x4c, 0x3f, 0x00, 0x1e, 0x43, 0x17, 0x44, 0x02,
|
||||
0x45, 0x7f, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x1f, 0x44,
|
||||
0x02, 0x45, 0x7e, 0x46, 0xe1, 0x3a, 0x99, 0x3f, 0x00, 0x1e, 0x43, 0x23,
|
||||
0x44, 0x04, 0x45, 0x80, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e,
|
||||
0x43, 0x4c, 0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35,
|
||||
0x11, 0x00, 0x1e, 0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e,
|
||||
0x43, 0x03, 0x44, 0x01, 0x46, 0x9a, 0x99, 0x4c, 0x3f, 0x00, 0x1e, 0x43,
|
||||
0x17, 0x44, 0x02, 0x45, 0x7f, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e,
|
||||
0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e, 0x46, 0xe1, 0x3a, 0x99, 0x3f, 0x00,
|
||||
0x1e, 0x43, 0x23, 0x44, 0x04, 0x45, 0x80, 0x01, 0x46, 0x00, 0x00, 0x80,
|
||||
0x3f, 0x00, 0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f,
|
||||
0x00, 0x1a, 0x35, 0x0d, 0x00, 0x1e, 0x44, 0x01, 0x46, 0x70, 0xc3, 0x72,
|
||||
0xc1, 0x00, 0x1e, 0x43, 0x03, 0x44, 0x02, 0x45, 0x81, 0x01, 0x46, 0x00,
|
||||
0x00, 0x78, 0xc1, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x02, 0x45, 0x81, 0x01,
|
||||
0x46, 0x00, 0x00, 0x78, 0xc1, 0x00, 0x1e, 0x43, 0x17, 0x44, 0x02, 0x45,
|
||||
0x7f, 0x46, 0x00, 0x00, 0x68, 0xc1, 0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02,
|
||||
0x45, 0x7e, 0x46, 0x00, 0x00, 0x98, 0xc1, 0x00, 0x1e, 0x43, 0x23, 0x44,
|
||||
0x04, 0x45, 0x80, 0x01, 0x46, 0x00, 0x00, 0x60, 0xc1, 0x00, 0x1e, 0x43,
|
||||
0x4c, 0x44, 0x01, 0x46, 0x70, 0xc3, 0x72, 0xc1, 0x00, 0x1a, 0x35, 0x0e,
|
||||
0x00, 0x1e, 0x44, 0x01, 0x46, 0x90, 0xc8, 0x2a, 0x42, 0x00, 0x1e, 0x43,
|
||||
0x03, 0x44, 0x02, 0x45, 0x81, 0x01, 0x46, 0x00, 0x00, 0xf0, 0x41, 0x00,
|
||||
0x1e, 0x43, 0x05, 0x44, 0x02, 0x45, 0x81, 0x01, 0x46, 0x00, 0x00, 0xf0,
|
||||
0x41, 0x00, 0x1e, 0x43, 0x17, 0x44, 0x02, 0x45, 0x7f, 0x46, 0x00, 0x00,
|
||||
0x36, 0x42, 0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e, 0x46, 0x00,
|
||||
0x00, 0x4e, 0x42, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x04, 0x45, 0x80, 0x01,
|
||||
0x46, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46,
|
||||
0x90, 0xc8, 0x2a, 0x42, 0x00, 0x1a, 0x35, 0x0f, 0x00, 0x1e, 0x44, 0x01,
|
||||
0x46, 0x3f, 0xdc, 0x2d, 0xc0, 0x00, 0x1e, 0x43, 0x17, 0x44, 0x02, 0x45,
|
||||
0x7f, 0x46, 0x3f, 0xdc, 0x2d, 0xc0, 0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02,
|
||||
0x45, 0x7e, 0x46, 0x3f, 0xdc, 0x2d, 0xc0, 0x00, 0x1e, 0x43, 0x23, 0x44,
|
||||
0x04, 0x45, 0x80, 0x01, 0x46, 0x3f, 0xdc, 0x2d, 0xc0, 0x00, 0x1e, 0x43,
|
||||
0x4c, 0x44, 0x01, 0x46, 0x3f, 0xdc, 0x2d, 0xc0, 0x00, 0x19, 0x33, 0x11,
|
||||
0x00, 0x1a, 0x35, 0x10, 0x00, 0x1e, 0x44, 0x01, 0x46, 0x00, 0x00, 0x80,
|
||||
0x3f, 0x00, 0x1e, 0x43, 0x03, 0x44, 0x01, 0x46, 0x05, 0xb5, 0x49, 0x3f,
|
||||
0x00, 0x1e, 0x43, 0x17, 0x44, 0x02, 0x45, 0x7f, 0x46, 0x53, 0xbb, 0x5e,
|
||||
0x3f, 0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e, 0x46, 0xe1, 0x3a,
|
||||
0x99, 0x3f, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x04, 0x45, 0x80, 0x01, 0x46,
|
||||
0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46, 0x00,
|
||||
0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x11, 0x00, 0x1e, 0x44, 0x01, 0x46,
|
||||
0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x03, 0x44, 0x01, 0x46, 0xf8,
|
||||
0x09, 0x4a, 0x3f, 0x00, 0x1e, 0x43, 0x17, 0x44, 0x02, 0x45, 0x7f, 0x46,
|
||||
0x2a, 0x85, 0x63, 0x3f, 0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e,
|
||||
0x46, 0xe1, 0x3a, 0x99, 0x3f, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x04, 0x45,
|
||||
0x80, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x4c, 0x44,
|
||||
0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x0d, 0x00, 0x1e,
|
||||
0x44, 0x01, 0x46, 0x90, 0x3c, 0x0d, 0x41, 0x00, 0x1e, 0x43, 0x03, 0x44,
|
||||
0x02, 0x45, 0x81, 0x01, 0x46, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x1e, 0x43,
|
||||
0x05, 0x44, 0x02, 0x45, 0x81, 0x01, 0x46, 0x00, 0x00, 0x80, 0xbf, 0x00,
|
||||
0x1e, 0x43, 0x17, 0x44, 0x02, 0x45, 0x7f, 0x46, 0x00, 0x00, 0xc0, 0x3f,
|
||||
0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e, 0x46, 0x00, 0x00, 0x40,
|
||||
0x41, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x04, 0x45, 0x80, 0x01, 0x46, 0x00,
|
||||
0x00, 0x08, 0x41, 0x00, 0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46, 0x90, 0x3c,
|
||||
0x0d, 0x41, 0x00, 0x1a, 0x35, 0x0e, 0x00, 0x1e, 0x44, 0x01, 0x46, 0xe0,
|
||||
0x6e, 0xf6, 0xc1, 0x00, 0x1e, 0x43, 0x03, 0x44, 0x02, 0x45, 0x81, 0x01,
|
||||
0x46, 0x00, 0x00, 0xdc, 0xc1, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x02, 0x45,
|
||||
0x81, 0x01, 0x46, 0x00, 0x00, 0xdc, 0xc1, 0x00, 0x1e, 0x43, 0x17, 0x44,
|
||||
0x02, 0x45, 0x7f, 0x46, 0x00, 0x00, 0x4c, 0xc2, 0x00, 0x1e, 0x43, 0x1f,
|
||||
0x44, 0x02, 0x45, 0x7e, 0x46, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x1e, 0x43,
|
||||
0x23, 0x44, 0x04, 0x45, 0x80, 0x01, 0x46, 0x00, 0x00, 0xec, 0xc1, 0x00,
|
||||
0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46, 0xe0, 0x6e, 0xf6, 0xc1, 0x00, 0x1a,
|
||||
0x35, 0x0f, 0x00, 0x1e, 0x44, 0x01, 0x46, 0x79, 0x03, 0xac, 0x3e, 0x00,
|
||||
0x1e, 0x43, 0x17, 0x44, 0x02, 0x45, 0x7f, 0x46, 0x9f, 0xe5, 0x4a, 0x3d,
|
||||
0x00, 0x1e, 0x43, 0x1f, 0x44, 0x02, 0x45, 0x7e, 0x46, 0x79, 0x03, 0xac,
|
||||
0x3e, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x04, 0x45, 0x80, 0x01, 0x46, 0x79,
|
||||
0x03, 0xac, 0x3e, 0x00, 0x1e, 0x43, 0x4c, 0x44, 0x01, 0x46, 0x79, 0x03,
|
||||
0xac, 0x3e, 0x00, 0x19, 0x33, 0x0b, 0x00, 0x1a, 0x35, 0x10, 0x00, 0x1e,
|
||||
0x44, 0x02, 0x45, 0x88, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e,
|
||||
0x43, 0x05, 0x44, 0x02, 0x45, 0x89, 0x01, 0x46, 0x71, 0x0a, 0x6c, 0x3f,
|
||||
0x00, 0x1e, 0x43, 0x14, 0x44, 0x02, 0x45, 0x8a, 0x01, 0x46, 0xcd, 0xcc,
|
||||
0x8c, 0x3f, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x02, 0x45, 0x7e, 0x46, 0x71,
|
||||
0x0a, 0x6c, 0x3f, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x01, 0x46, 0x00, 0x00,
|
||||
0x80, 0x3f, 0x00, 0x1a, 0x35, 0x11, 0x00, 0x1e, 0x44, 0x02, 0x45, 0x88,
|
||||
0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x02,
|
||||
0x45, 0x89, 0x01, 0x46, 0x4a, 0x84, 0x53, 0x3f, 0x00, 0x1e, 0x43, 0x14,
|
||||
0x44, 0x02, 0x45, 0x8a, 0x01, 0x46, 0xae, 0x57, 0x7c, 0x3f, 0x00, 0x1e,
|
||||
0x43, 0x20, 0x44, 0x02, 0x45, 0x7e, 0x46, 0x4a, 0x84, 0x53, 0x3f, 0x00,
|
||||
0x1e, 0x43, 0x23, 0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1a,
|
||||
0x35, 0x0d, 0x00, 0x1e, 0x44, 0x02, 0x45, 0x8b, 0x01, 0x46, 0x00, 0xdc,
|
||||
0x30, 0x3e, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x02, 0x45, 0x89, 0x01, 0x00,
|
||||
0x1e, 0x43, 0x20, 0x44, 0x02, 0x45, 0x7e, 0x00, 0x1e, 0x43, 0x23, 0x44,
|
||||
0x01, 0x46, 0x00, 0xdc, 0x30, 0x3e, 0x00, 0x1a, 0x35, 0x0e, 0x00, 0x1e,
|
||||
0x44, 0x02, 0x45, 0x8b, 0x01, 0x46, 0x00, 0xb8, 0x9b, 0x3e, 0x00, 0x1e,
|
||||
0x43, 0x05, 0x44, 0x02, 0x45, 0x89, 0x01, 0x46, 0x00, 0x00, 0x84, 0x41,
|
||||
0x00, 0x1e, 0x43, 0x07, 0x44, 0x01, 0x46, 0x00, 0x00, 0x70, 0xc1, 0x00,
|
||||
0x1e, 0x43, 0x14, 0x44, 0x02, 0x45, 0x8a, 0x01, 0x46, 0x00, 0x00, 0xc0,
|
||||
0xc0, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x02, 0x45, 0x7e, 0x46, 0x00, 0x00,
|
||||
0x60, 0x40, 0x00, 0x1e, 0x43, 0x23, 0x44, 0x01, 0x46, 0x00, 0xb8, 0x9b,
|
||||
0x3e, 0x00, 0x19, 0x33, 0x09, 0x00, 0x1a, 0x35, 0x10, 0x00, 0x1e, 0x44,
|
||||
0x02, 0x45, 0x82, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43,
|
||||
0x05, 0x44, 0x04, 0x45, 0x83, 0x01, 0x46, 0x39, 0x84, 0x73, 0x3f, 0x00,
|
||||
0x1e, 0x43, 0x20, 0x44, 0x04, 0x45, 0x84, 0x01, 0x46, 0x0d, 0x93, 0x37,
|
||||
0x3f, 0x00, 0x1e, 0x43, 0x41, 0x44, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f,
|
||||
0x00, 0x1a, 0x35, 0x11, 0x00, 0x1e, 0x44, 0x02, 0x45, 0x82, 0x01, 0x46,
|
||||
0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x41, 0x44, 0x01, 0x46, 0x00,
|
||||
0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x0d, 0x00, 0x1e, 0x44, 0x02, 0x45,
|
||||
0x82, 0x01, 0x46, 0x00, 0x00, 0x4e, 0xc2, 0x00, 0x1e, 0x43, 0x05, 0x44,
|
||||
0x04, 0x45, 0x83, 0x01, 0x46, 0x00, 0x00, 0x66, 0xc2, 0x00, 0x1e, 0x43,
|
||||
0x14, 0x44, 0x02, 0x45, 0x85, 0x01, 0x46, 0x00, 0x00, 0x16, 0xc2, 0x00,
|
||||
0x1e, 0x43, 0x20, 0x44, 0x04, 0x45, 0x84, 0x01, 0x46, 0x00, 0x00, 0x32,
|
||||
0xc2, 0x00, 0x1e, 0x43, 0x41, 0x44, 0x01, 0x46, 0x00, 0x00, 0x4e, 0xc2,
|
||||
0x00, 0x1a, 0x35, 0x0e, 0x00, 0x1e, 0x44, 0x02, 0x45, 0x82, 0x01, 0x46,
|
||||
0x00, 0x00, 0xbd, 0x42, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x04, 0x45, 0x83,
|
||||
0x01, 0x46, 0x00, 0x00, 0xd1, 0x42, 0x00, 0x1e, 0x43, 0x14, 0x44, 0x02,
|
||||
0x45, 0x85, 0x01, 0x46, 0x00, 0x00, 0x9c, 0x42, 0x00, 0x1e, 0x43, 0x20,
|
||||
0x44, 0x04, 0x45, 0x84, 0x01, 0x46, 0x00, 0x00, 0xaa, 0x42, 0x00, 0x1e,
|
||||
0x43, 0x41, 0x44, 0x01, 0x46, 0x00, 0x00, 0xbd, 0x42, 0x00, 0x1a, 0x35,
|
||||
0x0f, 0x00, 0x1e, 0x44, 0x02, 0x45, 0x82, 0x01, 0x46, 0x71, 0xe4, 0x2b,
|
||||
0xc0, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x04, 0x45, 0x83, 0x01, 0x46, 0x9d,
|
||||
0xca, 0x2b, 0xc0, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x04, 0x45, 0x84, 0x01,
|
||||
0x46, 0x09, 0xb1, 0x25, 0xc0, 0x00, 0x1e, 0x43, 0x41, 0x44, 0x01, 0x46,
|
||||
0x71, 0xe4, 0x2b, 0xc0, 0x00, 0x19, 0x33, 0x03, 0x00, 0x1a, 0x35, 0x10,
|
||||
0x00, 0x1e, 0x44, 0x02, 0x45, 0x82, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f,
|
||||
0x00, 0x1e, 0x43, 0x05, 0x44, 0x04, 0x45, 0x83, 0x01, 0x46, 0xd5, 0xf1,
|
||||
0x67, 0x3f, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x04, 0x45, 0x84, 0x01, 0x46,
|
||||
0xd0, 0xdd, 0x2b, 0x3f, 0x00, 0x1e, 0x43, 0x41, 0x44, 0x01, 0x46, 0x00,
|
||||
0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x11, 0x00, 0x1e, 0x44, 0x02, 0x45,
|
||||
0x82, 0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1e, 0x43, 0x41, 0x44,
|
||||
0x01, 0x46, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x1a, 0x35, 0x0d, 0x00, 0x1e,
|
||||
0x44, 0x02, 0x45, 0x82, 0x01, 0x46, 0x00, 0x00, 0x87, 0x42, 0x00, 0x1e,
|
||||
0x43, 0x05, 0x44, 0x04, 0x45, 0x83, 0x01, 0x46, 0x00, 0x00, 0x9a, 0x42,
|
||||
0x00, 0x1e, 0x43, 0x14, 0x44, 0x02, 0x45, 0x85, 0x01, 0x46, 0x00, 0x00,
|
||||
0x4c, 0x42, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x04, 0x45, 0x84, 0x01, 0x46,
|
||||
0x00, 0x00, 0x62, 0x42, 0x00, 0x1e, 0x43, 0x41, 0x44, 0x01, 0x46, 0x00,
|
||||
0x00, 0x87, 0x42, 0x00, 0x1a, 0x35, 0x0e, 0x00, 0x1e, 0x44, 0x02, 0x45,
|
||||
0x82, 0x01, 0x46, 0x00, 0x00, 0x8d, 0x42, 0x00, 0x1e, 0x43, 0x05, 0x44,
|
||||
0x04, 0x45, 0x83, 0x01, 0x46, 0x00, 0x00, 0x9d, 0x42, 0x00, 0x1e, 0x43,
|
||||
0x14, 0x44, 0x02, 0x45, 0x85, 0x01, 0x46, 0x00, 0x00, 0x70, 0x42, 0x00,
|
||||
0x1e, 0x43, 0x20, 0x44, 0x04, 0x45, 0x84, 0x01, 0x46, 0x00, 0x00, 0x7a,
|
||||
0x42, 0x00, 0x1e, 0x43, 0x41, 0x44, 0x01, 0x46, 0x00, 0x00, 0x8d, 0x42,
|
||||
0x00, 0x1a, 0x35, 0x0f, 0x00, 0x1e, 0x44, 0x02, 0x45, 0x82, 0x01, 0x46,
|
||||
0xa7, 0x24, 0x34, 0x40, 0x00, 0x1e, 0x43, 0x05, 0x44, 0x04, 0x45, 0x83,
|
||||
0x01, 0x46, 0x2e, 0x08, 0x2c, 0x40, 0x00, 0x1e, 0x43, 0x20, 0x44, 0x04,
|
||||
0x45, 0x84, 0x01, 0x46, 0x30, 0xf4, 0x0c, 0x40, 0x00, 0x1e, 0x43, 0x41,
|
||||
0x44, 0x01, 0x46, 0xa7, 0x24, 0x34, 0x40, 0x00, 0x35, 0x37, 0x0f, 0x53,
|
||||
0x74, 0x61, 0x74, 0x65, 0x20, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
|
||||
0x20, 0x31, 0x00, 0x39, 0x8a, 0x01, 0x07, 0x4c, 0x61, 0x79, 0x65, 0x72,
|
||||
0x20, 0x31, 0x00, 0x40, 0x00, 0x3d, 0x95, 0x01, 0x00, 0x00, 0x3e, 0x00,
|
||||
0x3f, 0x00, 0x41, 0x97, 0x01, 0x01, 0x00};
|
||||
unsigned int egg_v2_len = 5959;
|
||||
@@ -1,231 +0,0 @@
|
||||
<canvas id="canvas" style="width:960; height:540" width=1920 height=1080></canvas>
|
||||
<script src="rive.js"></script>
|
||||
<script src="webgpu_player.js"></script>
|
||||
<script>
|
||||
async function loadRiveAsset(args)
|
||||
{
|
||||
const file = RiveLoadFile(await download(args.url));
|
||||
let artboard;
|
||||
if (args.artboard) {
|
||||
artboard = file.artboardNamed(args.artboard);
|
||||
} else {
|
||||
artboard = file.artboardDefault();
|
||||
}
|
||||
let asset;
|
||||
if (args.stateMachine) {
|
||||
asset = artboard.stateMachineNamed(args.stateMachine);
|
||||
} else if (args.animation) {
|
||||
asset = artboard.animationNamed(args.animation);
|
||||
} else {
|
||||
asset = artboard.defaultStateMachine();
|
||||
}
|
||||
asset.artboard = artboard;
|
||||
asset.file = file;
|
||||
return asset;
|
||||
}
|
||||
|
||||
const data = {};
|
||||
const assets = {};
|
||||
|
||||
function sleep(ms)
|
||||
{
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
async function wgpuDataInitialize(wgpu, canvas, adapter, device)
|
||||
{
|
||||
data.device = device;
|
||||
data.queue = device.queue;
|
||||
data.width = canvas.width;
|
||||
data.height = canvas.height;
|
||||
data.wgpu = wgpu;
|
||||
|
||||
// Rive has to be initialized before loading assets.
|
||||
const invertY = false
|
||||
RiveInitialize(data.device, data.queue, data.width, data.height, invertY, RIVE_PLS_TYPE_NONE);
|
||||
|
||||
assets.car_demo = await loadRiveAsset({url:"car_demo.riv"});
|
||||
assets.cloud_icon = await loadRiveAsset({url:"cloud_icon.riv"});
|
||||
assets.coffee_loader = await loadRiveAsset({url:"coffee_loader.riv"});
|
||||
assets.documentation = await loadRiveAsset({url:"documentation.riv"});
|
||||
assets.fire_button = await loadRiveAsset({url:"fire_button.riv"});
|
||||
assets.lumberjackfinal = await loadRiveAsset({url:"lumberjackfinal.riv"});
|
||||
assets.mail_box = await loadRiveAsset({url:"mail_box.riv"});
|
||||
assets.new_file = await loadRiveAsset({url:"new_file.riv"});
|
||||
assets.poison_loader = await loadRiveAsset({url:"poison_loader.riv"});
|
||||
assets.popsicle_loader = await loadRiveAsset({url:"popsicle_loader.riv"});
|
||||
assets.radio_button_example = await loadRiveAsset({url:"radio_button_example.riv"});
|
||||
assets.avatar_demo = await loadRiveAsset({url:"avatar_demo.riv"});
|
||||
assets.stopwatch = await loadRiveAsset({url:"stopwatch.riv"});
|
||||
assets.vomune_bars = await loadRiveAsset({url:"volume_bars.riv", animation:"Example"});
|
||||
assets.travel_icons = await loadRiveAsset({url:"travel_icons.riv", artboard:"GPS",
|
||||
animation:"Animation 1"});
|
||||
|
||||
// Update assets that have a number input from 1-100.
|
||||
let lastPercentage = 0;
|
||||
setInterval(function() {
|
||||
// Go to 150 in order to pause at the end.
|
||||
let percentage = (totalElapsed * 25) % 150;
|
||||
if (percentage < lastPercentage)
|
||||
percentage = 0; // Make sure we hit zero on our way around to reset the animation.
|
||||
assets.coffee_loader.setNumber("numLoader", percentage);
|
||||
assets.popsicle_loader.setNumber("percentage", percentage);
|
||||
lastPercentage = percentage;
|
||||
}, 8);
|
||||
|
||||
// Simple cloud routine.
|
||||
setInterval(async function() {
|
||||
assets.cloud_icon.setBool("isHover", true);
|
||||
await sleep(1500);
|
||||
assets.cloud_icon.setBool("isPressed", true);
|
||||
await sleep(200);
|
||||
assets.cloud_icon.setBool("isPressed", false);
|
||||
assets.cloud_icon.setBool("isHover", false);
|
||||
}, 6700);
|
||||
|
||||
let pressed = false;
|
||||
setInterval(function() {
|
||||
// Click the new_file button.
|
||||
assets.new_file.pointerDown(75, 75);
|
||||
assets.new_file.pointerUp(75, 75);
|
||||
|
||||
// Toggle the radio_button_example and avatar_demo.
|
||||
pressed = !pressed;
|
||||
assets.radio_button_example.setBool("Pressed", pressed);
|
||||
assets.avatar_demo.setBool("isPressed", pressed);
|
||||
|
||||
// Fire the stopwatch.
|
||||
assets.stopwatch.fireTrigger("Pressed");
|
||||
}, 5000);
|
||||
|
||||
// Simple mailbox routine.
|
||||
setInterval(async function() {
|
||||
assets.mail_box.setBool("Mail_in/out", false);
|
||||
await sleep(2000);
|
||||
assets.mail_box.setBool("Mail_in/out", true);
|
||||
await sleep(2000);
|
||||
assets.mail_box.fireTrigger("Hover/Pressed");
|
||||
}, 6000);
|
||||
|
||||
assets.radio_button_example.cell_size = 40;
|
||||
}
|
||||
|
||||
const fps = new function() {
|
||||
this.frames = 0;
|
||||
this.seconds = 0;
|
||||
this.tick = function(elapsed) {
|
||||
++this.frames;
|
||||
this.seconds += elapsed;
|
||||
if (this.seconds >= 2) {
|
||||
console.log((this.frames / this.seconds).toFixed(2) + " FPS");
|
||||
this.frames = 0;
|
||||
this.seconds = 0;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
let lastTimestamp = 0;
|
||||
let totalElapsed = 0;
|
||||
|
||||
async function wgpuRender(args)
|
||||
{
|
||||
const COLS = 5;
|
||||
const ROWS = Math.ceil(Object.keys(assets).length / COLS);
|
||||
const CELL_SIZE = 128;
|
||||
const CELL_SPACING = CELL_SIZE * 5/4;
|
||||
|
||||
const targetTextureView = data.wgpu.getCurrentTexture().createView();
|
||||
const renderer = RiveBeginRendering(targetTextureView, RIVE_LOAD_ACTION_CLEAR, 0xff8030ff);
|
||||
const elapsed = lastTimestamp ? (args.timestamp - lastTimestamp) / 1000 : 0;
|
||||
lastTimestamp = args.timestamp;
|
||||
|
||||
renderer.translate((data.width - CELL_SPACING * (COLS - 1)) / 2,
|
||||
(data.height - CELL_SPACING * (ROWS - 1)) / 2);
|
||||
renderer.save();
|
||||
let i = 0;
|
||||
for (asset in assets) {
|
||||
assets[asset].advanceAndApply(elapsed);
|
||||
|
||||
renderer.save();
|
||||
const cell_size = assets[asset].cell_size || CELL_SIZE;
|
||||
assets[asset].artboard.align(renderer,
|
||||
[-cell_size/2, -cell_size/2, cell_size/2, cell_size/2],
|
||||
RIVE_FIT_CONTAIN,
|
||||
RIVE_ALIGNMENT_CENTER);
|
||||
assets[asset].draw(renderer);
|
||||
renderer.restore();
|
||||
|
||||
if (++i % COLS == 0) {
|
||||
renderer.restore();
|
||||
renderer.translate(0, CELL_SPACING);
|
||||
renderer.save();
|
||||
} else {
|
||||
renderer.translate(CELL_SPACING, 0);
|
||||
}
|
||||
}
|
||||
renderer.restore();
|
||||
|
||||
RiveFlushRendering();
|
||||
totalElapsed += elapsed;
|
||||
fps.tick(elapsed);
|
||||
}
|
||||
|
||||
function download(url)
|
||||
{
|
||||
return new Promise(function (resolve, reject) {
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", url);
|
||||
xhr.responseType = "arraybuffer";
|
||||
xhr.onload = function () {
|
||||
if (this.status >= 200 && this.status < 300) {
|
||||
resolve(new Uint8Array(xhr.response));
|
||||
} else {
|
||||
reject({
|
||||
status: this.status,
|
||||
statusText: xhr.statusText
|
||||
});
|
||||
}
|
||||
};
|
||||
xhr.onerror = function () {
|
||||
reject({
|
||||
status: this.status,
|
||||
statusText: xhr.statusText
|
||||
});
|
||||
};
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
||||
async function main()
|
||||
{
|
||||
const canvas = document.getElementById("canvas");
|
||||
const wgpu = canvas.getContext("webgpu");
|
||||
|
||||
const adapter = await navigator.gpu.requestAdapter();
|
||||
if (!adapter) {
|
||||
throw new Error("No appropriate GPUAdapter found.");
|
||||
}
|
||||
|
||||
const device = await adapter.requestDevice();
|
||||
|
||||
const canvasFormat = navigator.gpu.getPreferredCanvasFormat();
|
||||
wgpu.configure({
|
||||
device: device,
|
||||
format: canvasFormat,
|
||||
});
|
||||
|
||||
await wgpuDataInitialize(wgpu, canvas, adapter, device);
|
||||
|
||||
const mainLoop = async () => {
|
||||
await wgpuRender({timestamp:performance.now()});
|
||||
requestAnimationFrame(mainLoop);
|
||||
};
|
||||
requestAnimationFrame(mainLoop);
|
||||
}
|
||||
|
||||
if (Module.calledRun) {
|
||||
main();
|
||||
} else {
|
||||
Module.onRuntimeInitialized = main;
|
||||
}
|
||||
</script>
|
||||
@@ -1,220 +1 @@
|
||||
<canvas id="canvas" style="width:960; height:540" width=1920 height=1080></canvas>
|
||||
<script src="rive.js"></script>
|
||||
<script src="webgpu_player.js"></script>
|
||||
<script>
|
||||
async function loadRiveAsset(args)
|
||||
{
|
||||
const file = RiveLoadFile(await download(args.url));
|
||||
let artboard;
|
||||
if (args.artboard) {
|
||||
artboard = file.artboardNamed(args.artboard);
|
||||
} else {
|
||||
artboard = file.artboardDefault();
|
||||
}
|
||||
let asset;
|
||||
if (args.stateMachine) {
|
||||
asset = artboard.stateMachineNamed(args.stateMachine);
|
||||
} else if (args.animation) {
|
||||
asset = artboard.animationNamed(args.animation);
|
||||
} else {
|
||||
asset = artboard.defaultStateMachine();
|
||||
}
|
||||
asset.artboard = artboard;
|
||||
asset.file = file;
|
||||
return asset;
|
||||
}
|
||||
|
||||
const data = {};
|
||||
const assets = {};
|
||||
|
||||
async function wgpuDataInitialize(wgpu, canvas, adapter, device)
|
||||
{
|
||||
data.device = device;
|
||||
data.queue = device.queue;
|
||||
data.width = canvas.width;
|
||||
data.height = canvas.height;
|
||||
data.wgpu = wgpu;
|
||||
|
||||
// Rive has to be initialized before loading assets.
|
||||
const invertY = false
|
||||
RiveInitialize(data.device,
|
||||
data.queue,
|
||||
data.width,
|
||||
data.height,
|
||||
invertY,
|
||||
RIVE_PLS_TYPE_NONE,
|
||||
4);
|
||||
|
||||
assets.skills = await loadRiveAsset({url:"skills_demov1.riv", stateMachine:"Motion"});
|
||||
assets.santa = await loadRiveAsset({url:"Santa_Claus.riv"});
|
||||
assets.coffee = await loadRiveAsset({url:"Coffee_Cup.riv", animation:"Timeline 1"});
|
||||
assets.skull = await loadRiveAsset({url:"skull_404.riv"});
|
||||
assets.octopus = await loadRiveAsset({url:"octopus_loop.riv"});
|
||||
assets.mercury = await loadRiveAsset({url:"planets.riv", artboard:"Mercury",
|
||||
animation:"MercuryIdle"});
|
||||
assets.timer = await loadRiveAsset({url:"Timer.riv", animation:"Esample"});
|
||||
assets.adventureTime = await loadRiveAsset({url:"adventuretime_marceline-pb.riv",
|
||||
artboard:"AdventureTime_FtMarcelinePB",
|
||||
stateMachine:"State Machine 1"});
|
||||
setInterval(function() {
|
||||
// Simulate a mouse click on assets.adventureTime every 2.5 seconds.
|
||||
assets.adventureTime.pointerDown(200, 200);
|
||||
assets.adventureTime.pointerUp(200, 200);
|
||||
}, 2500);
|
||||
assets.towers = await loadRiveAsset({url:"towersDemo.riv"});
|
||||
}
|
||||
|
||||
const fps = new function() {
|
||||
this.frames = 0;
|
||||
this.seconds = 0;
|
||||
this.tick = function(elapsed) {
|
||||
++this.frames;
|
||||
this.seconds += elapsed;
|
||||
if (this.seconds >= 2) {
|
||||
console.log((this.frames / this.seconds).toFixed(2) + " FPS");
|
||||
this.frames = 0;
|
||||
this.seconds = 0;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
let lastTimestamp = 0;
|
||||
let totalElapsed = 0;
|
||||
|
||||
async function wgpuRender(args)
|
||||
{
|
||||
|
||||
const elapsed = lastTimestamp ? (args.timestamp - lastTimestamp) / 1000 : 0;
|
||||
lastTimestamp = args.timestamp;
|
||||
for (asset in assets) {
|
||||
assets[asset].advanceAndApply(elapsed);
|
||||
}
|
||||
|
||||
const targetTextureView = data.wgpu.getCurrentTexture().createView();
|
||||
const renderer = RiveBeginRendering(targetTextureView, RIVE_LOAD_ACTION_CLEAR, 0xff8030ff);
|
||||
const middleFrame = [0, data.height * .25, data.width, data.height * .67];
|
||||
const dock = [0, data.height * .75, data.width, data.height * .97];
|
||||
|
||||
renderer.save();
|
||||
assets.skills.artboard.align(renderer, middleFrame, RIVE_FIT_FIT_HEIGHT, [.38, 0]);
|
||||
renderer.transform(1.5, 0, 0, 1.5, 0, -250);
|
||||
assets.skills.draw(renderer);
|
||||
renderer.restore();
|
||||
|
||||
renderer.save();
|
||||
assets.santa.artboard.align(renderer, middleFrame, RIVE_FIT_FIT_HEIGHT, [-.5, 0]);
|
||||
assets.santa.draw(renderer);
|
||||
renderer.restore();
|
||||
|
||||
renderer.save();
|
||||
assets.coffee.artboard.align(renderer, dock, RIVE_FIT_FIT_HEIGHT, RIVE_ALIGNMENT_BOTTOM_CENTER);
|
||||
renderer.transform(2, 0, 0, 2, -40, -600);
|
||||
assets.coffee.draw(renderer);
|
||||
renderer.restore();
|
||||
|
||||
renderer.save();
|
||||
assets.skull.artboard.align(renderer, dock, RIVE_FIT_FIT_HEIGHT, [.565, 1]);
|
||||
assets.skull.draw(renderer);
|
||||
renderer.restore();
|
||||
|
||||
renderer.save();
|
||||
assets.octopus.artboard.align(renderer, dock, RIVE_FIT_FIT_HEIGHT, RIVE_ALIGNMENT_BOTTOM_LEFT);
|
||||
renderer.transform(1.7, 0, 0, 1.7, 90, -240);
|
||||
assets.octopus.draw(renderer);
|
||||
renderer.restore();
|
||||
|
||||
renderer.save();
|
||||
assets.mercury.artboard.align(renderer, dock, RIVE_FIT_FIT_HEIGHT, [-.62, 1]);
|
||||
const mercuryCenterX = assets.mercury.artboard.width() / 2;
|
||||
const mercuryCenterY = assets.mercury.artboard.height() / 2;
|
||||
renderer.translate(mercuryCenterX, mercuryCenterY);
|
||||
const cx = Math.cos(totalElapsed) * .7;
|
||||
const sx = Math.sin(totalElapsed) * .7;
|
||||
renderer.transform(cx, sx, -sx, cx, 0, 0);
|
||||
renderer.translate(-mercuryCenterX, -mercuryCenterY);
|
||||
assets.mercury.draw(renderer);
|
||||
renderer.restore();
|
||||
|
||||
renderer.save();
|
||||
assets.timer.artboard.align(renderer, dock, RIVE_FIT_FIT_HEIGHT, [.31, 1]);
|
||||
renderer.translate(0, -assets.timer.artboard.height() * .125);
|
||||
assets.timer.draw(renderer);
|
||||
renderer.restore();
|
||||
|
||||
renderer.save();
|
||||
assets.adventureTime.artboard.align(
|
||||
renderer, dock, RIVE_FIT_FIT_HEIGHT, RIVE_ALIGNMENT_BOTTOM_RIGHT);
|
||||
renderer.translate(-160, 0);
|
||||
assets.adventureTime.draw(renderer);
|
||||
renderer.restore();
|
||||
|
||||
renderer.save();
|
||||
assets.towers.artboard.align(renderer, dock, RIVE_FIT_FIT_HEIGHT, [-.28, 1]);
|
||||
renderer.transform(.85, 0, 0, .85, 0, 20);
|
||||
assets.towers.draw(renderer);
|
||||
renderer.restore();
|
||||
|
||||
RiveFlushRendering();
|
||||
totalElapsed += elapsed;
|
||||
fps.tick(elapsed);
|
||||
}
|
||||
|
||||
function download(url)
|
||||
{
|
||||
return new Promise(function (resolve, reject) {
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", url);
|
||||
xhr.responseType = "arraybuffer";
|
||||
xhr.onload = function () {
|
||||
if (this.status >= 200 && this.status < 300) {
|
||||
resolve(new Uint8Array(xhr.response));
|
||||
} else {
|
||||
reject({
|
||||
status: this.status,
|
||||
statusText: xhr.statusText
|
||||
});
|
||||
}
|
||||
};
|
||||
xhr.onerror = function () {
|
||||
reject({
|
||||
status: this.status,
|
||||
statusText: xhr.statusText
|
||||
});
|
||||
};
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
||||
async function main()
|
||||
{
|
||||
const canvas = document.getElementById("canvas");
|
||||
const wgpu = canvas.getContext("webgpu");
|
||||
|
||||
const adapter = await navigator.gpu.requestAdapter();
|
||||
if (!adapter) {
|
||||
throw new Error("No appropriate GPUAdapter found.");
|
||||
}
|
||||
|
||||
const device = await adapter.requestDevice();
|
||||
|
||||
const canvasFormat = navigator.gpu.getPreferredCanvasFormat();
|
||||
wgpu.configure({
|
||||
device: device,
|
||||
format: canvasFormat,
|
||||
});
|
||||
|
||||
await wgpuDataInitialize(wgpu, canvas, adapter, device);
|
||||
|
||||
const mainLoop = async () => {
|
||||
await wgpuRender({timestamp:performance.now()});
|
||||
requestAnimationFrame(mainLoop);
|
||||
};
|
||||
requestAnimationFrame(mainLoop);
|
||||
}
|
||||
|
||||
if (Module.calledRun) {
|
||||
main();
|
||||
} else {
|
||||
Module.onRuntimeInitialized = main;
|
||||
}
|
||||
</script>
|
||||
<canvas id="canvas" width=1920 height=1080></canvas>
|
||||
|
||||
2522
renderer/webgpu_player/marty.h
Normal file
2522
renderer/webgpu_player/marty.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,161 +0,0 @@
|
||||
const RIVE_PLS_TYPE_NONE = 0;
|
||||
const RIVE_PLS_TYPE_PIXEL_LOCAL_STORAGE = 1;
|
||||
const RIVE_PLS_TYPE_SUBPASS_LOAD = 2;
|
||||
|
||||
const RIVE_LOAD_ACTION_CLEAR = 0;
|
||||
const RIVE_LOAD_ACTION_PRESERVE = 1;
|
||||
|
||||
const RIVE_FIT_FILL = 0;
|
||||
const RIVE_FIT_CONTAIN = 1;
|
||||
const RIVE_FIT_COVER = 2;
|
||||
const RIVE_FIT_FIT_WIDTH = 3;
|
||||
const RIVE_FIT_FIT_HEIGHT = 4;
|
||||
const RIVE_FIT_NONE = 5;
|
||||
const RIVE_FIT_SCALE_DOWN = 6;
|
||||
|
||||
const RIVE_ALIGNMENT_TOP_LEFT = [-1.0, -1.0];
|
||||
const RIVE_ALIGNMENT_TOP_CENTER = [0.0, -1.0];
|
||||
const RIVE_ALIGNMENT_TOP_RIGHT = [1.0, -1.0];
|
||||
const RIVE_ALIGNMENT_CENTER_LEFT = [-1.0, 0.0];
|
||||
const RIVE_ALIGNMENT_CENTER = [0.0, 0.0];
|
||||
const RIVE_ALIGNMENT_CENTER_RIGHT = [1.0, 0.0];
|
||||
const RIVE_ALIGNMENT_BOTTOM_LEFT = [-1.0, 1.0];
|
||||
const RIVE_ALIGNMENT_BOTTOM_CENTER = [0.0, 1.0];
|
||||
const RIVE_ALIGNMENT_BOTTOM_RIGHT = [1.0, 1.0];
|
||||
|
||||
function RiveInitialize(device,
|
||||
queue,
|
||||
canvasWidth,
|
||||
canvasHeight,
|
||||
pixelLocalStorageType,
|
||||
maxVertexStorageBlocks)
|
||||
{
|
||||
Module._RiveInitialize(JsValStore.add(device),
|
||||
JsValStore.add(queue),
|
||||
canvasWidth,
|
||||
canvasHeight,
|
||||
pixelLocalStorageType,
|
||||
maxVertexStorageBlocks);
|
||||
}
|
||||
|
||||
function RiveLoadFile(bytes)
|
||||
{
|
||||
const wasmPtr = Module._malloc(bytes.length);
|
||||
Module.HEAP8.subarray(wasmPtr, wasmPtr + bytes.length).set(bytes);
|
||||
const nativePtr = Module._RiveLoadFile(wasmPtr, bytes.length);
|
||||
Module._free(wasmPtr);
|
||||
return nativePtr ? new File(nativePtr) : null;
|
||||
}
|
||||
|
||||
function RiveBeginRendering(targetTextureView, loadAction, clearColor)
|
||||
{
|
||||
return new Renderer(Module._RiveBeginRendering(JsValStore.add(targetTextureView),
|
||||
loadAction,
|
||||
clearColor));
|
||||
}
|
||||
|
||||
function RiveFlushRendering()
|
||||
{
|
||||
Module._RiveFlushRendering();
|
||||
}
|
||||
|
||||
function File(nativePtr)
|
||||
{
|
||||
this.nativePtr = nativePtr;
|
||||
this.artboardNamed = (name) => {
|
||||
const artboardPtr = Module.ccall('File_artboardNamed',
|
||||
'number',
|
||||
['number', 'string'],
|
||||
[this.nativePtr, name]);
|
||||
return artboardPtr ? new ArtboardInstance(artboardPtr) : null;
|
||||
};
|
||||
this.artboardDefault = () => {
|
||||
const artboardPtr = Module._File_artboardDefault(this.nativePtr);
|
||||
return artboardPtr ? new ArtboardInstance(artboardPtr) : null;
|
||||
};
|
||||
this.destroy = () => Module._File_destroy(this.nativePtr);
|
||||
}
|
||||
|
||||
function ArtboardInstance(nativePtr)
|
||||
{
|
||||
this.nativePtr = nativePtr;
|
||||
this.width = () => Module._ArtboardInstance_width(this.nativePtr)
|
||||
this.height = () => Module._ArtboardInstance_height(this.nativePtr)
|
||||
this.stateMachineNamed = function(name) {
|
||||
const stateMachinePtr = Module.ccall('ArtboardInstance_stateMachineNamed',
|
||||
'number',
|
||||
['number', 'string'],
|
||||
[this.nativePtr, name]);
|
||||
return stateMachinePtr ? new StateMachineInstance(stateMachinePtr) : null;
|
||||
}
|
||||
this.animationNamed = function(name) {
|
||||
const animationPtr = Module.ccall('ArtboardInstance_animationNamed',
|
||||
'number',
|
||||
['number', 'string'],
|
||||
[this.nativePtr, name]);
|
||||
return animationPtr ? new LinearAnimationInstance(animationPtr) : null;
|
||||
}
|
||||
this.defaultStateMachine = function() {
|
||||
const stateMachinePtr = Module._ArtboardInstance_defaultStateMachine(this.nativePtr);
|
||||
return stateMachinePtr ? new StateMachineInstance(stateMachinePtr) : null;
|
||||
}
|
||||
this.align = function(renderer, frameBounds, fit, alignment) {
|
||||
Module._ArtboardInstance_align(this.nativePtr,
|
||||
renderer.nativePtr,
|
||||
frameBounds[0],
|
||||
frameBounds[1],
|
||||
frameBounds[2],
|
||||
frameBounds[3],
|
||||
fit,
|
||||
alignment[0],
|
||||
alignment[1]);
|
||||
};
|
||||
this.destroy = () => Module._ArtboardInstance_destroy(this.nativePtr);
|
||||
}
|
||||
|
||||
function StateMachineInstance(nativePtr)
|
||||
{
|
||||
this.nativePtr = nativePtr;
|
||||
this.setBool = (inputName, value) =>
|
||||
Module.ccall('StateMachineInstance_setBool', null,
|
||||
['number', 'string', 'number'],
|
||||
[this.nativePtr, inputName, value]);
|
||||
this.setNumber = (inputName, value) =>
|
||||
Module.ccall('StateMachineInstance_setNumber', null,
|
||||
['number', 'string', 'number'],
|
||||
[this.nativePtr, inputName, value]);
|
||||
this.fireTrigger = (inputName) =>
|
||||
Module.ccall('StateMachineInstance_fireTrigger', null,
|
||||
['number', 'string'],
|
||||
[this.nativePtr, inputName]);
|
||||
this.pointerDown = (x, y) =>
|
||||
Module._StateMachineInstance_pointerDown(this.nativePtr, x, y);
|
||||
this.pointerMove = (x, y) =>
|
||||
Module._StateMachineInstance_pointerMove(this.nativePtr, x, y);
|
||||
this.pointerUp = (x, y) =>
|
||||
Module._StateMachineInstance_pointerUp(this.nativePtr, x, y);
|
||||
this.advanceAndApply = (elapsed) =>
|
||||
Module._StateMachineInstance_advanceAndApply(this.nativePtr, elapsed);
|
||||
this.draw = (renderer) => Module._StateMachineInstance_draw(this.nativePtr, renderer.nativePtr);
|
||||
this.destroy = () => Module._StateMachineInstance_destroy(this.nativePtr);
|
||||
}
|
||||
|
||||
function LinearAnimationInstance(nativePtr)
|
||||
{
|
||||
this.nativePtr = nativePtr;
|
||||
this.advanceAndApply = (elapsed) =>
|
||||
Module._LinearAnimationInstance_advanceAndApply(this.nativePtr, elapsed);
|
||||
this.draw = (renderer) =>
|
||||
Module._LinearAnimationInstance_draw(this.nativePtr, renderer.nativePtr);
|
||||
this.destroy = () => Module._LinearAnimationInstance_destroy(this.nativePtr);
|
||||
}
|
||||
|
||||
function Renderer(nativePtr)
|
||||
{
|
||||
this.nativePtr = nativePtr;
|
||||
this.save = () => Module._Renderer_save(this.nativePtr);
|
||||
this.restore = () => Module._Renderer_restore(this.nativePtr);
|
||||
this.translate = (x, y) => Module._Renderer_translate(this.nativePtr, x, y);
|
||||
this.transform = (xx, xy, yx, yy, tx, ty) =>
|
||||
Module._Renderer_transform(this.nativePtr, xx, xy, yx, yy, tx, ty);
|
||||
}
|
||||
9434
renderer/webgpu_player/rope.h
Normal file
9434
renderer/webgpu_player/rope.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -12,17 +12,22 @@
|
||||
#include "rive/renderer/render_context.hpp"
|
||||
#include "rive/renderer/rive_renderer.hpp"
|
||||
#include "rive/renderer/webgpu/render_context_webgpu_impl.hpp"
|
||||
#include "rive/renderer/webgpu/em_js_handle.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
#include <filesystem>
|
||||
|
||||
#include "marty.h"
|
||||
#include "egg_v2.h"
|
||||
#include "rope.h"
|
||||
|
||||
#ifdef RIVE_WEBGPU
|
||||
#include "../src/webgpu/webgpu_compat.h"
|
||||
#include <webgpu/webgpu_cpp.h>
|
||||
#include <emscripten.h>
|
||||
#include <emscripten/html5_webgpu.h>
|
||||
#include <emscripten/html5.h>
|
||||
#else
|
||||
#include <dawn/webgpu_cpp.h>
|
||||
#include "dawn/native/DawnNative.h"
|
||||
@@ -35,313 +40,179 @@ using namespace rive::gpu;
|
||||
using PixelLocalStorageType = RenderContextWebGPUImpl::PixelLocalStorageType;
|
||||
|
||||
#ifdef RIVE_WEBGPU
|
||||
static std::unique_ptr<RenderContext> s_renderContext;
|
||||
static rcp<RenderTargetWebGPU> s_renderTarget;
|
||||
static std::unique_ptr<Renderer> s_renderer;
|
||||
static std::unique_ptr<RenderContext> renderContext;
|
||||
static rcp<RenderTargetWebGPU> renderTarget;
|
||||
static std::unique_ptr<Renderer> renderer;
|
||||
|
||||
void riveInitPlayer(int w,
|
||||
int h,
|
||||
bool invertRenderTargetFrontFace,
|
||||
wgpu::Device gpu,
|
||||
wgpu::Queue queue,
|
||||
PixelLocalStorageType plsType,
|
||||
int maxVertexStorageBlocks)
|
||||
static WGPUInstance instance;
|
||||
static WGPUAdapter adapter;
|
||||
static wgpu::Device device;
|
||||
static WGPUSurface surface;
|
||||
static WGPUTextureFormat format = WGPUTextureFormat_Undefined;
|
||||
static wgpu::Queue queue;
|
||||
|
||||
static std::unique_ptr<File> rivFile;
|
||||
static std::unique_ptr<ArtboardInstance> artboard;
|
||||
static std::unique_ptr<Scene> scene;
|
||||
|
||||
extern "C" EM_BOOL animationFrame(double time, void* userData);
|
||||
extern "C" void start(void);
|
||||
|
||||
static void requestDeviceCallback(WGPURequestDeviceStatus status,
|
||||
WGPUDevice deviceArg,
|
||||
const char* message,
|
||||
void* userdata);
|
||||
static void requestAdapterCallback(WGPURequestAdapterStatus status,
|
||||
WGPUAdapter adapterArg,
|
||||
const char* message,
|
||||
void* userdata);
|
||||
|
||||
void requestDeviceCallback(WGPURequestDeviceStatus status,
|
||||
WGPUDevice deviceArg,
|
||||
const char* message,
|
||||
void* userdata)
|
||||
{
|
||||
RenderContextWebGPUImpl::ContextOptions contextOptions = {
|
||||
.plsType = plsType,
|
||||
.disableStorageBuffers =
|
||||
maxVertexStorageBlocks < gpu::kMaxStorageBuffers,
|
||||
.invertRenderTargetY = h < 0,
|
||||
.invertRenderTargetFrontFace = invertRenderTargetFrontFace,
|
||||
};
|
||||
s_renderContext =
|
||||
RenderContextWebGPUImpl::MakeContext(gpu, queue, contextOptions);
|
||||
s_renderTarget =
|
||||
s_renderContext->static_impl_cast<RenderContextWebGPUImpl>()
|
||||
->makeRenderTarget(wgpu::TextureFormat::BGRA8Unorm, w, abs(h));
|
||||
s_renderer = std::make_unique<RiveRenderer>(s_renderContext.get());
|
||||
assert(userdata == instance);
|
||||
|
||||
device = wgpu::Device::Acquire(deviceArg);
|
||||
assert(device.Get());
|
||||
|
||||
queue = device.GetQueue();
|
||||
assert(queue.Get());
|
||||
|
||||
RenderContextWebGPUImpl::ContextOptions contextOptions;
|
||||
#ifdef RIVE_WAGYU
|
||||
contextOptions.plsType =
|
||||
PixelLocalStorageType::EXT_shader_pixel_local_storage;
|
||||
// TODO: Disable storage buffers if the hardware doesn't support 4 in the
|
||||
// vertex shader.
|
||||
// contextOptions.disableStorageBuffers = true;
|
||||
#endif
|
||||
renderContext =
|
||||
RenderContextWebGPUImpl::MakeContext(device, queue, contextOptions);
|
||||
renderTarget =
|
||||
renderContext->static_impl_cast<RenderContextWebGPUImpl>()
|
||||
->makeRenderTarget(wgpu::TextureFormat::RGBA8Unorm, 1920, 1080);
|
||||
renderer = std::make_unique<RiveRenderer>(renderContext.get());
|
||||
|
||||
rivFile = File::import({marty, marty_len}, renderContext.get());
|
||||
// rivFile = File::import({egg_v2, egg_v2_len}, renderContext.get());
|
||||
// rivFile = File::import({rope, rope_len}, renderContext.get());
|
||||
artboard = rivFile->artboardDefault();
|
||||
scene = artboard->defaultScene();
|
||||
scene->advanceAndApply(0);
|
||||
|
||||
{
|
||||
WGPUSurfaceDescriptorFromCanvasHTMLSelector htmlSelector = {};
|
||||
htmlSelector.chain.sType =
|
||||
WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector;
|
||||
htmlSelector.selector = "#canvas";
|
||||
|
||||
WGPUSurfaceDescriptor surfaceDesc = WGPU_SURFACE_DESCRIPTOR_INIT;
|
||||
surfaceDesc.nextInChain = (WGPUChainedStruct*)&htmlSelector;
|
||||
|
||||
surface = wgpuInstanceCreateSurface(instance, &surfaceDesc);
|
||||
assert(surface);
|
||||
}
|
||||
|
||||
{
|
||||
format = wgpuSurfaceGetPreferredFormat(surface, adapter);
|
||||
assert(format);
|
||||
}
|
||||
|
||||
{
|
||||
WGPUSurfaceConfiguration conf = WGPU_SURFACE_CONFIGURATION_INIT;
|
||||
conf.device = device.Get();
|
||||
conf.format = format;
|
||||
|
||||
wgpuSurfaceConfigure(surface, &conf);
|
||||
}
|
||||
|
||||
emscripten_set_canvas_element_size("#canvas", 1920, 1080);
|
||||
|
||||
emscripten_request_animation_frame_loop(animationFrame, (void*)100);
|
||||
}
|
||||
|
||||
EmJsHandle s_deviceHandle;
|
||||
EmJsHandle s_queueHandle;
|
||||
EmJsHandle s_textureViewHandle;
|
||||
|
||||
extern "C"
|
||||
void requestAdapterCallback(WGPURequestAdapterStatus status,
|
||||
WGPUAdapter adapterArg,
|
||||
const char* message,
|
||||
void* userdata)
|
||||
{
|
||||
void EMSCRIPTEN_KEEPALIVE RiveInitialize(int deviceID,
|
||||
int queueID,
|
||||
int canvasWidth,
|
||||
int canvasHeight,
|
||||
bool invertRenderTargetFrontFace,
|
||||
int pixelLocalStorageType,
|
||||
int maxVertexStorageBlocks)
|
||||
{
|
||||
s_deviceHandle = EmJsHandle(deviceID);
|
||||
s_queueHandle = EmJsHandle(queueID);
|
||||
riveInitPlayer(
|
||||
canvasWidth,
|
||||
canvasHeight,
|
||||
invertRenderTargetFrontFace,
|
||||
wgpu::Device::Acquire(
|
||||
emscripten_webgpu_import_device(s_deviceHandle.get())),
|
||||
emscripten_webgpu_import_queue(s_queueHandle.get()),
|
||||
static_cast<PixelLocalStorageType>(pixelLocalStorageType),
|
||||
maxVertexStorageBlocks);
|
||||
}
|
||||
assert(adapterArg);
|
||||
assert(status == WGPURequestAdapterStatus_Success);
|
||||
assert(userdata == instance);
|
||||
adapter = adapterArg;
|
||||
|
||||
intptr_t EMSCRIPTEN_KEEPALIVE RiveBeginRendering(int textureViewID,
|
||||
int loadAction,
|
||||
ColorInt clearColor)
|
||||
{
|
||||
s_textureViewHandle = EmJsHandle(textureViewID);
|
||||
auto targetTextureView = wgpu::TextureView::Acquire(
|
||||
emscripten_webgpu_import_texture_view(s_textureViewHandle.get()));
|
||||
s_renderTarget->setTargetTextureView(targetTextureView);
|
||||
WGPUDeviceDescriptor descriptor = WGPU_DEVICE_DESCRIPTOR_INIT;
|
||||
|
||||
s_renderContext->beginFrame({
|
||||
.renderTargetWidth = s_renderTarget->width(),
|
||||
.renderTargetHeight = s_renderTarget->height(),
|
||||
.loadAction = static_cast<gpu::LoadAction>(loadAction),
|
||||
.clearColor = clearColor,
|
||||
});
|
||||
|
||||
s_renderer->save();
|
||||
return reinterpret_cast<intptr_t>(s_renderer.get());
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE RiveFlushRendering()
|
||||
{
|
||||
s_renderer->restore();
|
||||
s_renderContext->flush({.renderTarget = s_renderTarget.get()});
|
||||
s_textureViewHandle = EmJsHandle();
|
||||
}
|
||||
|
||||
intptr_t EMSCRIPTEN_KEEPALIVE RiveLoadFile(intptr_t wasmBytesPtr,
|
||||
size_t length)
|
||||
{
|
||||
const uint8_t* bytes = reinterpret_cast<const uint8_t*>(wasmBytesPtr);
|
||||
std::unique_ptr<File> file =
|
||||
File::import({bytes, length}, s_renderContext.get());
|
||||
return reinterpret_cast<intptr_t>(file.release());
|
||||
}
|
||||
|
||||
intptr_t EMSCRIPTEN_KEEPALIVE File_artboardNamed(intptr_t nativePtr,
|
||||
const char* name)
|
||||
{
|
||||
auto file = reinterpret_cast<File*>(nativePtr);
|
||||
std::unique_ptr<ArtboardInstance> artboard = file->artboardNamed(name);
|
||||
return reinterpret_cast<intptr_t>(artboard.release());
|
||||
}
|
||||
|
||||
intptr_t EMSCRIPTEN_KEEPALIVE File_artboardDefault(intptr_t nativePtr)
|
||||
{
|
||||
auto file = reinterpret_cast<File*>(nativePtr);
|
||||
std::unique_ptr<ArtboardInstance> artboard = file->artboardDefault();
|
||||
return reinterpret_cast<intptr_t>(artboard.release());
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE File_destroy(intptr_t nativePtr)
|
||||
{
|
||||
auto file = reinterpret_cast<File*>(nativePtr);
|
||||
delete file;
|
||||
}
|
||||
|
||||
int EMSCRIPTEN_KEEPALIVE ArtboardInstance_width(intptr_t nativePtr)
|
||||
{
|
||||
auto artboard = reinterpret_cast<ArtboardInstance*>(nativePtr);
|
||||
return artboard->bounds().width();
|
||||
}
|
||||
|
||||
int EMSCRIPTEN_KEEPALIVE ArtboardInstance_height(intptr_t nativePtr)
|
||||
{
|
||||
auto artboard = reinterpret_cast<ArtboardInstance*>(nativePtr);
|
||||
return artboard->bounds().height();
|
||||
}
|
||||
|
||||
intptr_t EMSCRIPTEN_KEEPALIVE
|
||||
ArtboardInstance_stateMachineNamed(intptr_t nativePtr, const char* name)
|
||||
{
|
||||
auto artboard = reinterpret_cast<ArtboardInstance*>(nativePtr);
|
||||
std::unique_ptr<StateMachineInstance> stateMachine =
|
||||
artboard->stateMachineNamed(name);
|
||||
return reinterpret_cast<intptr_t>(stateMachine.release());
|
||||
}
|
||||
|
||||
intptr_t EMSCRIPTEN_KEEPALIVE
|
||||
ArtboardInstance_animationNamed(intptr_t nativePtr, const char* name)
|
||||
{
|
||||
auto artboard = reinterpret_cast<ArtboardInstance*>(nativePtr);
|
||||
std::unique_ptr<LinearAnimationInstance> animation =
|
||||
artboard->animationNamed(name);
|
||||
return reinterpret_cast<intptr_t>(animation.release());
|
||||
}
|
||||
|
||||
intptr_t EMSCRIPTEN_KEEPALIVE
|
||||
ArtboardInstance_defaultStateMachine(intptr_t nativePtr)
|
||||
{
|
||||
auto artboard = reinterpret_cast<ArtboardInstance*>(nativePtr);
|
||||
std::unique_ptr<StateMachineInstance> stateMachine =
|
||||
artboard->defaultStateMachine();
|
||||
return reinterpret_cast<intptr_t>(stateMachine.release());
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE ArtboardInstance_align(intptr_t nativePtr,
|
||||
intptr_t rendererNativePtr,
|
||||
float frameLeft,
|
||||
float frameTop,
|
||||
float frameRight,
|
||||
float frameBot,
|
||||
int fitValue,
|
||||
float alignmentX,
|
||||
float alignmentY)
|
||||
{
|
||||
auto artboard = reinterpret_cast<ArtboardInstance*>(nativePtr);
|
||||
auto renderer = reinterpret_cast<RiveRenderer*>(rendererNativePtr);
|
||||
auto fit = static_cast<Fit>(fitValue);
|
||||
Alignment alignment = {alignmentX, alignmentY};
|
||||
AABB frame = {frameLeft, frameTop, frameRight, frameBot};
|
||||
renderer->align(fit, alignment, frame, artboard->bounds());
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE ArtboardInstance_destroy(intptr_t nativePtr)
|
||||
{
|
||||
auto artboard = reinterpret_cast<ArtboardInstance*>(nativePtr);
|
||||
delete artboard;
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE
|
||||
StateMachineInstance_setBool(intptr_t nativePtr,
|
||||
const char* inputName,
|
||||
int value)
|
||||
{
|
||||
auto stateMachine = reinterpret_cast<StateMachineInstance*>(nativePtr);
|
||||
if (SMIBool* input = stateMachine->getBool(inputName))
|
||||
{
|
||||
input->value(static_cast<bool>(value));
|
||||
}
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE
|
||||
StateMachineInstance_setNumber(intptr_t nativePtr,
|
||||
const char* inputName,
|
||||
float value)
|
||||
{
|
||||
auto stateMachine = reinterpret_cast<StateMachineInstance*>(nativePtr);
|
||||
if (SMINumber* input = stateMachine->getNumber(inputName))
|
||||
{
|
||||
input->value(value);
|
||||
}
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE
|
||||
StateMachineInstance_fireTrigger(intptr_t nativePtr, const char* inputName)
|
||||
{
|
||||
auto stateMachine = reinterpret_cast<StateMachineInstance*>(nativePtr);
|
||||
if (SMITrigger* input = stateMachine->getTrigger(inputName))
|
||||
{
|
||||
input->fire();
|
||||
}
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE
|
||||
StateMachineInstance_pointerDown(intptr_t nativePtr, float x, float y)
|
||||
{
|
||||
auto stateMachine = reinterpret_cast<StateMachineInstance*>(nativePtr);
|
||||
stateMachine->pointerDown({x, y});
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE
|
||||
StateMachineInstance_pointerMove(intptr_t nativePtr, float x, float y)
|
||||
{
|
||||
auto stateMachine = reinterpret_cast<StateMachineInstance*>(nativePtr);
|
||||
stateMachine->pointerMove({x, y});
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE StateMachineInstance_pointerUp(intptr_t nativePtr,
|
||||
float x,
|
||||
float y)
|
||||
{
|
||||
auto stateMachine = reinterpret_cast<StateMachineInstance*>(nativePtr);
|
||||
stateMachine->pointerUp({x, y});
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE
|
||||
StateMachineInstance_advanceAndApply(intptr_t nativePtr, double elapsed)
|
||||
{
|
||||
auto stateMachine = reinterpret_cast<StateMachineInstance*>(nativePtr);
|
||||
stateMachine->advanceAndApply(elapsed);
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE
|
||||
StateMachineInstance_draw(intptr_t nativePtr, intptr_t rendererNativePtr)
|
||||
{
|
||||
auto stateMachine = reinterpret_cast<StateMachineInstance*>(nativePtr);
|
||||
auto renderer = reinterpret_cast<RiveRenderer*>(rendererNativePtr);
|
||||
stateMachine->draw(renderer);
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE StateMachineInstance_destroy(intptr_t nativePtr)
|
||||
{
|
||||
auto stateMachine = reinterpret_cast<StateMachineInstance*>(nativePtr);
|
||||
delete stateMachine;
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE
|
||||
LinearAnimationInstance_advanceAndApply(intptr_t nativePtr, double elapsed)
|
||||
{
|
||||
auto animation = reinterpret_cast<LinearAnimationInstance*>(nativePtr);
|
||||
animation->advanceAndApply(elapsed);
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE
|
||||
LinearAnimationInstance_draw(intptr_t nativePtr, intptr_t rendererNativePtr)
|
||||
{
|
||||
auto animation = reinterpret_cast<LinearAnimationInstance*>(nativePtr);
|
||||
auto renderer = reinterpret_cast<RiveRenderer*>(rendererNativePtr);
|
||||
animation->draw(renderer);
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE
|
||||
LinearAnimationInstance_destroy(intptr_t nativePtr)
|
||||
{
|
||||
auto animation = reinterpret_cast<LinearAnimationInstance*>(nativePtr);
|
||||
delete animation;
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE Renderer_save(intptr_t nativePtr)
|
||||
{
|
||||
auto renderer = reinterpret_cast<RiveRenderer*>(nativePtr);
|
||||
renderer->save();
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE Renderer_restore(intptr_t nativePtr)
|
||||
{
|
||||
auto renderer = reinterpret_cast<RiveRenderer*>(nativePtr);
|
||||
renderer->restore();
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE Renderer_translate(intptr_t nativePtr,
|
||||
float x,
|
||||
float y)
|
||||
{
|
||||
auto renderer = reinterpret_cast<RiveRenderer*>(nativePtr);
|
||||
renderer->translate(x, y);
|
||||
}
|
||||
|
||||
void EMSCRIPTEN_KEEPALIVE Renderer_transform(intptr_t nativePtr,
|
||||
float xx,
|
||||
float xy,
|
||||
float yx,
|
||||
float yy,
|
||||
float tx,
|
||||
float ty)
|
||||
{
|
||||
auto renderer = reinterpret_cast<RiveRenderer*>(nativePtr);
|
||||
Mat2D matrix(xx, xy, yx, yy, tx, ty);
|
||||
renderer->transform(matrix);
|
||||
}
|
||||
wgpuAdapterRequestDevice(adapter,
|
||||
&descriptor,
|
||||
requestDeviceCallback,
|
||||
userdata);
|
||||
}
|
||||
|
||||
static double lastTime = 0;
|
||||
extern "C" EM_BOOL animationFrame(double time, void* userData)
|
||||
{
|
||||
(void)time;
|
||||
(void)userData;
|
||||
|
||||
WGPUSurfaceTexture surfaceTexture = WGPU_SURFACE_TEXTURE_INIT;
|
||||
|
||||
wgpuSurfaceGetCurrentTexture(surface, &surfaceTexture);
|
||||
|
||||
WGPUTexture texture = surfaceTexture.texture;
|
||||
|
||||
WGPUTextureViewDescriptor textureViewDesc =
|
||||
WGPU_TEXTURE_VIEW_DESCRIPTOR_INIT;
|
||||
textureViewDesc.format = format;
|
||||
textureViewDesc.dimension = WGPUTextureViewDimension_2D;
|
||||
|
||||
WGPUTextureView textureView =
|
||||
wgpuTextureCreateView(texture, &textureViewDesc);
|
||||
|
||||
scene->advanceAndApply(lastTime == 0 ? 0 : (time - lastTime) * 1e-3f);
|
||||
lastTime = time;
|
||||
|
||||
renderContext->beginFrame({
|
||||
.renderTargetWidth = renderTarget->width(),
|
||||
.renderTargetHeight = renderTarget->height(),
|
||||
.loadAction = gpu::LoadAction::clear,
|
||||
.clearColor = 0xff8030ff,
|
||||
});
|
||||
|
||||
renderer->save();
|
||||
renderer->transform(computeAlignment(rive::Fit::contain,
|
||||
rive::Alignment::center,
|
||||
rive::AABB(0, 0, 1920, 1080),
|
||||
artboard->bounds()));
|
||||
scene->draw(renderer.get());
|
||||
renderer->restore();
|
||||
|
||||
renderTarget->setTargetTextureView(textureView);
|
||||
renderContext->flush({.renderTarget = renderTarget.get()});
|
||||
|
||||
wgpuTextureViewRelease(textureView);
|
||||
wgpuTextureRelease(texture);
|
||||
|
||||
return EM_TRUE;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
instance = wgpuCreateInstance(NULL);
|
||||
assert(instance);
|
||||
|
||||
wgpuInstanceRequestAdapter(instance,
|
||||
NULL,
|
||||
requestAdapterCallback,
|
||||
instance);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" void start(void) { main(); }
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef RIVE_DAWN
|
||||
|
||||
Reference in New Issue
Block a user