mirror of
https://github.com/vlang/v.git
synced 2025-08-03 17:57:59 -04:00
sokol: update to match uptream at 9e0f1b4 (#19687)
This commit is contained in:
parent
2cf024b913
commit
775b25e11b
2
.github/workflows/other_ci.yml
vendored
2
.github/workflows/other_ci.yml
vendored
@ -101,7 +101,7 @@ jobs:
|
||||
|
||||
- name: Shader examples can be built
|
||||
run: |
|
||||
wget https://github.com/floooh/sokol-tools-bin/raw/6040b18d39649d56dbae2ae1aed59fb755b26369/bin/linux/sokol-shdc
|
||||
wget https://github.com/floooh/sokol-tools-bin/raw/6b84ea387a323db9e8e17f5abed2b254a6e409fe/bin/linux/sokol-shdc
|
||||
chmod +x ./sokol-shdc
|
||||
for f in examples/sokol/02_cubes_glsl/cube_glsl \
|
||||
examples/sokol/03_march_tracing_glsl/rt_glsl \
|
||||
|
@ -19,8 +19,8 @@ import flag
|
||||
import net.http
|
||||
|
||||
const (
|
||||
shdc_full_hash = '6040b18d39649d56dbae2ae1aed59fb755b26369'
|
||||
tool_version = '0.0.2'
|
||||
shdc_full_hash = '6b84ea387a323db9e8e17f5abed2b254a6e409fe'
|
||||
tool_version = '0.0.3'
|
||||
tool_description = "Compile shaders in sokol's annotated GLSL format to C headers for use with sokol based apps"
|
||||
tool_name = os.file_name(os.executable())
|
||||
cache_dir = os.join_path(os.cache_dir(), 'v', tool_name)
|
||||
|
@ -56,7 +56,7 @@ mut:
|
||||
* Texture functions
|
||||
*
|
||||
******************************************************************************/
|
||||
fn create_texture(w int, h int, buf &byte) (gfx.Image, gfx.Sampler) {
|
||||
fn create_texture(w int, h int, buf &u8) (gfx.Image, gfx.Sampler) {
|
||||
sz := w * h * 4
|
||||
mut img_desc := gfx.ImageDesc{
|
||||
width: w
|
||||
@ -90,7 +90,7 @@ fn destroy_texture(sg_img gfx.Image) {
|
||||
}
|
||||
|
||||
// Use only if usage: .dynamic is enabled
|
||||
fn update_text_texture(sg_img gfx.Image, w int, h int, buf &byte) {
|
||||
fn update_text_texture(sg_img gfx.Image, w int, h int, buf &u8) {
|
||||
sz := w * h * 4
|
||||
mut tmp_sbc := gfx.ImageData{}
|
||||
tmp_sbc.subimage[0][0] = gfx.Range{
|
||||
|
@ -55,7 +55,7 @@ mut:
|
||||
/******************************************************************************
|
||||
* Texture functions
|
||||
******************************************************************************/
|
||||
fn create_texture(w int, h int, buf &byte) (gfx.Image, gfx.Sampler) {
|
||||
fn create_texture(w int, h int, buf &u8) (gfx.Image, gfx.Sampler) {
|
||||
sz := w * h * 4
|
||||
mut img_desc := gfx.ImageDesc{
|
||||
width: w
|
||||
@ -93,7 +93,7 @@ fn destroy_texture(sg_img gfx.Image) {
|
||||
}
|
||||
|
||||
// Use only if usage: .dynamic is enabled
|
||||
fn update_text_texture(sg_img gfx.Image, w int, h int, buf &byte) {
|
||||
fn update_text_texture(sg_img gfx.Image, w int, h int, buf &u8) {
|
||||
sz := w * h * 4
|
||||
mut tmp_sbc := gfx.ImageData{}
|
||||
tmp_sbc.subimage[0][0] = gfx.Range{
|
||||
|
585
thirdparty/sokol/sokol_app.h
vendored
585
thirdparty/sokol/sokol_app.h
vendored
@ -1500,7 +1500,7 @@ typedef struct sapp_icon_desc {
|
||||
|
||||
Used in sapp_desc to provide custom memory-alloc and -free functions
|
||||
to sokol_app.h. If memory management should be overridden, both the
|
||||
alloc_fb and free_fn function must be provided (e.g. it's not valid to
|
||||
alloc_fn and free_fn function must be provided (e.g. it's not valid to
|
||||
override one function but not the other).
|
||||
*/
|
||||
typedef struct sapp_allocator {
|
||||
@ -1600,6 +1600,18 @@ typedef struct sapp_allocator {
|
||||
_SAPP_LOGITEM_XMACRO(ANDROID_NATIVE_ACTIVITY_ONCREATE, "NativeActivity onCreate") \
|
||||
_SAPP_LOGITEM_XMACRO(ANDROID_CREATE_THREAD_PIPE_FAILED, "failed to create thread pipe") \
|
||||
_SAPP_LOGITEM_XMACRO(ANDROID_NATIVE_ACTIVITY_CREATE_SUCCESS, "NativeActivity sucessfully created") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_SWAPCHAIN_CREATE_SURFACE_FAILED, "wgpu: failed to create surface for swapchain") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_SWAPCHAIN_CREATE_SWAPCHAIN_FAILED, "wgpu: failed to create swapchain object") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_SWAPCHAIN_CREATE_DEPTH_STENCIL_TEXTURE_FAILED, "wgpu: failed to create depth-stencil texture for swapchain") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_SWAPCHAIN_CREATE_DEPTH_STENCIL_VIEW_FAILED, "wgpu: failed to create view object for swapchain depth-stencil texture") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_SWAPCHAIN_CREATE_MSAA_TEXTURE_FAILED, "wgpu: failed to create msaa texture for swapchain") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_SWAPCHAIN_CREATE_MSAA_VIEW_FAILED, "wgpu: failed to create view object for swapchain msaa texture") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_REQUEST_DEVICE_STATUS_ERROR, "wgpu: requesting device failed with status 'error'") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_REQUEST_DEVICE_STATUS_UNKNOWN, "wgpu: requesting device failed with status 'unknown'") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_REQUEST_ADAPTER_STATUS_UNAVAILABLE, "wgpu: requesting adapter failed with 'unavailable'") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_REQUEST_ADAPTER_STATUS_ERROR, "wgpu: requesting adapter failed with status 'error'") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_REQUEST_ADAPTER_STATUS_UNKNOWN, "wgpu: requesting adapter failed with status 'unknown'") \
|
||||
_SAPP_LOGITEM_XMACRO(WGPU_CREATE_INSTANCE_FAILED, "wgpu: failed to create instance") \
|
||||
_SAPP_LOGITEM_XMACRO(IMAGE_DATA_SIZE_MISMATCH, "image data size mismatch (must be width*height*4 bytes)") \
|
||||
_SAPP_LOGITEM_XMACRO(DROPPED_FILE_PATH_TOO_LONG, "dropped file path too long (sapp_desc.max_dropped_filed_path_length)") \
|
||||
_SAPP_LOGITEM_XMACRO(CLIPBOARD_STRING_TOO_BIG, "clipboard string didn't fit into clipboard buffer") \
|
||||
@ -1882,7 +1894,31 @@ inline void sapp_run(const sapp_desc& desc) { return sapp_run(&desc); }
|
||||
#include <stddef.h> // size_t
|
||||
#include <math.h> // roundf
|
||||
|
||||
/* check if the config defines are alright */
|
||||
// helper macros
|
||||
#define _sapp_def(val, def) (((val) == 0) ? (def) : (val))
|
||||
#define _sapp_absf(a) (((a)<0.0f)?-(a):(a))
|
||||
|
||||
#define _SAPP_MAX_TITLE_LENGTH (128)
|
||||
#define _SAPP_FALLBACK_DEFAULT_WINDOW_WIDTH (640)
|
||||
#define _SAPP_FALLBACK_DEFAULT_WINDOW_HEIGHT (480)
|
||||
// NOTE: the pixel format values *must* be compatible with sg_pixel_format
|
||||
#define _SAPP_PIXELFORMAT_RGBA8 (23)
|
||||
#define _SAPP_PIXELFORMAT_BGRA8 (28)
|
||||
#define _SAPP_PIXELFORMAT_DEPTH (42)
|
||||
#define _SAPP_PIXELFORMAT_DEPTH_STENCIL (43)
|
||||
|
||||
#if defined(_SAPP_MACOS) || defined(_SAPP_IOS)
|
||||
// this is ARC compatible
|
||||
#if defined(__cplusplus)
|
||||
#define _SAPP_CLEAR_ARC_STRUCT(type, item) { item = type(); }
|
||||
#else
|
||||
#define _SAPP_CLEAR_ARC_STRUCT(type, item) { item = (type) { 0 }; }
|
||||
#endif
|
||||
#else
|
||||
#define _SAPP_CLEAR_ARC_STRUCT(type, item) { _sapp_clear(&item, sizeof(item)); }
|
||||
#endif
|
||||
|
||||
// check if the config defines are alright
|
||||
#if defined(__APPLE__)
|
||||
// see https://clang.llvm.org/docs/LanguageExtensions.html#automatic-reference-counting
|
||||
#if !defined(__cplusplus)
|
||||
@ -2391,15 +2427,18 @@ typedef struct {
|
||||
|
||||
#if defined(SOKOL_WGPU)
|
||||
typedef struct {
|
||||
int state;
|
||||
WGPUInstance instance;
|
||||
WGPUAdapter adapter;
|
||||
WGPUDevice device;
|
||||
WGPUSwapChain swapchain;
|
||||
WGPUTextureFormat render_format;
|
||||
WGPUSurface surface;
|
||||
WGPUSwapChain swapchain;
|
||||
WGPUTexture msaa_tex;
|
||||
WGPUTexture depth_stencil_tex;
|
||||
WGPUTextureView swapchain_view;
|
||||
WGPUTextureView msaa_view;
|
||||
WGPUTexture depth_stencil_tex;
|
||||
WGPUTextureView depth_stencil_view;
|
||||
WGPUTextureView swapchain_view;
|
||||
bool async_init_done;
|
||||
} _sapp_wgpu_t;
|
||||
#endif
|
||||
|
||||
@ -2409,9 +2448,6 @@ typedef struct {
|
||||
bool wants_hide_keyboard;
|
||||
bool mouse_lock_requested;
|
||||
uint16_t mouse_buttons;
|
||||
#if defined(SOKOL_WGPU)
|
||||
_sapp_wgpu_t wgpu;
|
||||
#endif
|
||||
} _sapp_emsc_t;
|
||||
#endif // _SAPP_EMSCRIPTEN
|
||||
|
||||
@ -2448,7 +2484,7 @@ typedef enum MONITOR_DPI_TYPE {
|
||||
MDT_RAW_DPI = 2,
|
||||
MDT_DEFAULT = MDT_EFFECTIVE_DPI
|
||||
} MONITOR_DPI_TYPE;
|
||||
#endif /*DPI_ENUMS_DECLARED*/
|
||||
#endif // DPI_ENUMS_DECLARED
|
||||
|
||||
typedef struct {
|
||||
bool aware;
|
||||
@ -2735,30 +2771,6 @@ typedef struct {
|
||||
|
||||
#endif // _SAPP_LINUX
|
||||
|
||||
/* helper macros */
|
||||
#define _sapp_def(val, def) (((val) == 0) ? (def) : (val))
|
||||
#define _sapp_absf(a) (((a)<0.0f)?-(a):(a))
|
||||
|
||||
#define _SAPP_MAX_TITLE_LENGTH (128)
|
||||
#define _SAPP_FALLBACK_DEFAULT_WINDOW_WIDTH (640)
|
||||
#define _SAPP_FALLBACK_DEFAULT_WINDOW_HEIGHT (480)
|
||||
/* NOTE: the pixel format values *must* be compatible with sg_pixel_format */
|
||||
#define _SAPP_PIXELFORMAT_RGBA8 (23)
|
||||
#define _SAPP_PIXELFORMAT_BGRA8 (28)
|
||||
#define _SAPP_PIXELFORMAT_DEPTH (42)
|
||||
#define _SAPP_PIXELFORMAT_DEPTH_STENCIL (43)
|
||||
|
||||
#if defined(_SAPP_MACOS) || defined(_SAPP_IOS)
|
||||
// this is ARC compatible
|
||||
#if defined(__cplusplus)
|
||||
#define _SAPP_CLEAR_ARC_STRUCT(type, item) { item = type(); }
|
||||
#else
|
||||
#define _SAPP_CLEAR_ARC_STRUCT(type, item) { item = (type) { 0 }; }
|
||||
#endif
|
||||
#else
|
||||
#define _SAPP_CLEAR_ARC_STRUCT(type, item) { _sapp_clear(&item, sizeof(item)); }
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
bool enabled;
|
||||
int buf_size;
|
||||
@ -2816,6 +2828,9 @@ typedef struct {
|
||||
_sapp_ios_t ios;
|
||||
#elif defined(_SAPP_EMSCRIPTEN)
|
||||
_sapp_emsc_t emsc;
|
||||
#if defined(SOKOL_WGPU)
|
||||
_sapp_wgpu_t wgpu;
|
||||
#endif
|
||||
#elif defined(_SAPP_WIN32)
|
||||
_sapp_win32_t win32;
|
||||
#if defined(SOKOL_D3D11)
|
||||
@ -2834,8 +2849,8 @@ typedef struct {
|
||||
#endif
|
||||
#endif
|
||||
char html5_canvas_selector[_SAPP_MAX_TITLE_LENGTH];
|
||||
char window_title[_SAPP_MAX_TITLE_LENGTH]; /* UTF-8 */
|
||||
wchar_t window_title_wide[_SAPP_MAX_TITLE_LENGTH]; /* UTF-32 or UCS-2 */
|
||||
char window_title[_SAPP_MAX_TITLE_LENGTH]; // UTF-8
|
||||
wchar_t window_title_wide[_SAPP_MAX_TITLE_LENGTH]; // UTF-32 or UCS-2 */
|
||||
sapp_keycode keycodes[SAPP_MAX_KEYCODES];
|
||||
// __v_ start
|
||||
bool __v_native_render; /* V patch to allow for native rendering */
|
||||
@ -5191,11 +5206,6 @@ _SOKOL_PRIVATE void _sapp_emsc_set_icon(const sapp_icon_desc* icon_desc, int num
|
||||
sapp_js_set_favicon(img_desc->width, img_desc->height, (const uint8_t*) img_desc->pixels.ptr);
|
||||
}
|
||||
|
||||
#if defined(SOKOL_WGPU)
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_surfaces_create(void);
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_surfaces_discard(void);
|
||||
#endif
|
||||
|
||||
_SOKOL_PRIVATE uint32_t _sapp_emsc_mouse_button_mods(uint16_t buttons) {
|
||||
uint32_t m = 0;
|
||||
if (0 != (buttons & (1<<0))) { m |= SAPP_MODIFIER_LMB; }
|
||||
@ -5234,6 +5244,10 @@ _SOKOL_PRIVATE uint32_t _sapp_emsc_touch_event_mods(const EmscriptenTouchEvent*
|
||||
return m;
|
||||
}
|
||||
|
||||
#if defined(SOKOL_WGPU)
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_size_changed(void);
|
||||
#endif
|
||||
|
||||
_SOKOL_PRIVATE EM_BOOL _sapp_emsc_size_changed(int event_type, const EmscriptenUiEvent* ui_event, void* user_data) {
|
||||
_SOKOL_UNUSED(event_type);
|
||||
_SOKOL_UNUSED(user_data);
|
||||
@ -5279,9 +5293,8 @@ _SOKOL_PRIVATE EM_BOOL _sapp_emsc_size_changed(int event_type, const EmscriptenU
|
||||
SOKOL_ASSERT((_sapp.framebuffer_width > 0) && (_sapp.framebuffer_height > 0));
|
||||
emscripten_set_canvas_element_size(_sapp.html5_canvas_selector, _sapp.framebuffer_width, _sapp.framebuffer_height);
|
||||
#if defined(SOKOL_WGPU)
|
||||
/* on WebGPU: recreate size-dependent rendering surfaces */
|
||||
_sapp_emsc_wgpu_surfaces_discard();
|
||||
_sapp_emsc_wgpu_surfaces_create();
|
||||
// on WebGPU: recreate size-dependent rendering surfaces
|
||||
_sapp_emsc_wgpu_size_changed();
|
||||
#endif
|
||||
if (_sapp_events_enabled()) {
|
||||
_sapp_init_event(SAPP_EVENTTYPE_RESIZED);
|
||||
@ -5553,11 +5566,10 @@ _SOKOL_PRIVATE EM_BOOL _sapp_emsc_key_cb(int emsc_type, const EmscriptenKeyboard
|
||||
_sapp.event.key_code = _sapp_emsc_translate_key(emsc_event->key);
|
||||
}
|
||||
|
||||
/* Special hack for macOS: if the Super key is pressed, macOS doesn't
|
||||
send keyUp events. As a workaround, to prevent keys from
|
||||
"sticking", we'll send a keyup event following a keydown
|
||||
when the SUPER key is pressed
|
||||
*/
|
||||
// Special hack for macOS: if the Super key is pressed, macOS doesn't
|
||||
// send keyUp events. As a workaround, to prevent keys from
|
||||
// "sticking", we'll send a keyup event following a keydown
|
||||
// when the SUPER key is pressed
|
||||
if ((type == SAPP_EVENTTYPE_KEY_DOWN) &&
|
||||
(_sapp.event.key_code != SAPP_KEYCODE_LEFT_SUPER) &&
|
||||
(_sapp.event.key_code != SAPP_KEYCODE_RIGHT_SUPER) &&
|
||||
@ -5752,114 +5764,184 @@ _SOKOL_PRIVATE void _sapp_emsc_webgl_init(void) {
|
||||
#endif
|
||||
|
||||
#if defined(SOKOL_WGPU)
|
||||
#define _SAPP_EMSC_WGPU_STATE_INITIAL (0)
|
||||
#define _SAPP_EMSC_WGPU_STATE_READY (1)
|
||||
#define _SAPP_EMSC_WGPU_STATE_RUNNING (2)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
/* called when the asynchronous WebGPU device + swapchain init code in JS has finished */
|
||||
EMSCRIPTEN_KEEPALIVE void _sapp_emsc_wgpu_ready(int device_id, int swapchain_id, int swapchain_fmt) {
|
||||
SOKOL_ASSERT(0 == _sapp.emsc.wgpu.device);
|
||||
_sapp.emsc.wgpu.device = (WGPUDevice) device_id;
|
||||
_sapp.emsc.wgpu.swapchain = (WGPUSwapChain) swapchain_id;
|
||||
_sapp.emsc.wgpu.render_format = (WGPUTextureFormat) swapchain_fmt;
|
||||
_sapp.emsc.wgpu.state = _SAPP_EMSC_WGPU_STATE_READY;
|
||||
}
|
||||
#if defined(__cplusplus)
|
||||
} // extern "C"
|
||||
#endif
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_create_swapchain(void) {
|
||||
SOKOL_ASSERT(_sapp.wgpu.instance);
|
||||
SOKOL_ASSERT(_sapp.wgpu.device);
|
||||
SOKOL_ASSERT(0 == _sapp.wgpu.surface);
|
||||
SOKOL_ASSERT(0 == _sapp.wgpu.swapchain);
|
||||
SOKOL_ASSERT(0 == _sapp.wgpu.msaa_tex);
|
||||
SOKOL_ASSERT(0 == _sapp.wgpu.msaa_view);
|
||||
SOKOL_ASSERT(0 == _sapp.wgpu.depth_stencil_tex);
|
||||
SOKOL_ASSERT(0 == _sapp.wgpu.depth_stencil_view);
|
||||
SOKOL_ASSERT(0 == _sapp.wgpu.swapchain_view);
|
||||
|
||||
/* embedded JS function to handle all the asynchronous WebGPU setup */
|
||||
EM_JS(void, sapp_js_wgpu_init, (), {
|
||||
WebGPU.initManagers();
|
||||
// FIXME: the extension activation must be more clever here
|
||||
navigator.gpu.requestAdapter().then((adapter) => {
|
||||
console.log("wgpu adapter extensions: " + adapter.extensions);
|
||||
adapter.requestDevice({ extensions: ["textureCompressionBC"]}).then((device) => {
|
||||
var gpuContext = document.getElementById("canvas").getContext("gpupresent");
|
||||
console.log("wgpu device extensions: " + adapter.extensions);
|
||||
gpuContext.getSwapChainPreferredFormat(device).then((fmt) => {
|
||||
const swapChainDescriptor = { device: device, format: fmt };
|
||||
const swapChain = gpuContext.configureSwapChain(swapChainDescriptor);
|
||||
const deviceId = WebGPU.mgrDevice.create(device);
|
||||
const swapChainId = WebGPU.mgrSwapChain.create(swapChain);
|
||||
const fmtId = WebGPU.TextureFormat.findIndex(function(elm) { return elm==fmt; });
|
||||
console.log("wgpu device: " + device);
|
||||
console.log("wgpu swap chain: " + swapChain);
|
||||
console.log("wgpu preferred format: " + fmt + " (" + fmtId + ")");
|
||||
__sapp_emsc_wgpu_ready(deviceId, swapChainId, fmtId);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
WGPUSurfaceDescriptorFromCanvasHTMLSelector canvas_desc;
|
||||
_sapp_clear(&canvas_desc, sizeof(canvas_desc));
|
||||
canvas_desc.chain.sType = WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector;
|
||||
canvas_desc.selector = _sapp.html5_canvas_selector;
|
||||
WGPUSurfaceDescriptor surf_desc;
|
||||
_sapp_clear(&surf_desc, sizeof(surf_desc));
|
||||
surf_desc.nextInChain = &canvas_desc.chain;
|
||||
_sapp.wgpu.surface = wgpuInstanceCreateSurface(_sapp.wgpu.instance, &surf_desc);
|
||||
if (0 == _sapp.wgpu.surface) {
|
||||
_SAPP_PANIC(WGPU_SWAPCHAIN_CREATE_SURFACE_FAILED);
|
||||
}
|
||||
_sapp.wgpu.render_format = wgpuSurfaceGetPreferredFormat(_sapp.wgpu.surface, _sapp.wgpu.adapter);
|
||||
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_surfaces_create(void) {
|
||||
SOKOL_ASSERT(_sapp.emsc.wgpu.device);
|
||||
SOKOL_ASSERT(_sapp.emsc.wgpu.swapchain);
|
||||
SOKOL_ASSERT(0 == _sapp.emsc.wgpu.depth_stencil_tex);
|
||||
SOKOL_ASSERT(0 == _sapp.emsc.wgpu.depth_stencil_view);
|
||||
SOKOL_ASSERT(0 == _sapp.emsc.wgpu.msaa_tex);
|
||||
SOKOL_ASSERT(0 == _sapp.emsc.wgpu.msaa_view);
|
||||
WGPUSwapChainDescriptor sc_desc;
|
||||
_sapp_clear(&sc_desc, sizeof(sc_desc));
|
||||
sc_desc.usage = WGPUTextureUsage_RenderAttachment;
|
||||
sc_desc.format = _sapp.wgpu.render_format;
|
||||
sc_desc.width = (uint32_t)_sapp.framebuffer_width;
|
||||
sc_desc.height = (uint32_t)_sapp.framebuffer_height;
|
||||
sc_desc.presentMode = WGPUPresentMode_Fifo;
|
||||
_sapp.wgpu.swapchain = wgpuDeviceCreateSwapChain(_sapp.wgpu.device, _sapp.wgpu.surface, &sc_desc);
|
||||
if (0 == _sapp.wgpu.swapchain) {
|
||||
_SAPP_PANIC(WGPU_SWAPCHAIN_CREATE_SWAPCHAIN_FAILED);
|
||||
}
|
||||
|
||||
WGPUTextureDescriptor ds_desc;
|
||||
_sapp_clear(&ds_desc, sizeof(ds_desc));
|
||||
ds_desc.usage = WGPUTextureUsage_OutputAttachment;
|
||||
ds_desc.usage = WGPUTextureUsage_RenderAttachment;
|
||||
ds_desc.dimension = WGPUTextureDimension_2D;
|
||||
ds_desc.size.width = (uint32_t) _sapp.framebuffer_width;
|
||||
ds_desc.size.height = (uint32_t) _sapp.framebuffer_height;
|
||||
ds_desc.size.depth = 1;
|
||||
ds_desc.arrayLayerCount = 1;
|
||||
ds_desc.format = WGPUTextureFormat_Depth24PlusStencil8;
|
||||
ds_desc.size.width = (uint32_t)_sapp.framebuffer_width;
|
||||
ds_desc.size.height = (uint32_t)_sapp.framebuffer_height;
|
||||
ds_desc.size.depthOrArrayLayers = 1;
|
||||
ds_desc.format = WGPUTextureFormat_Depth32FloatStencil8;
|
||||
ds_desc.mipLevelCount = 1;
|
||||
ds_desc.sampleCount = _sapp.sample_count;
|
||||
_sapp.emsc.wgpu.depth_stencil_tex = wgpuDeviceCreateTexture(_sapp.emsc.wgpu.device, &ds_desc);
|
||||
_sapp.emsc.wgpu.depth_stencil_view = wgpuTextureCreateView(_sapp.emsc.wgpu.depth_stencil_tex, 0);
|
||||
ds_desc.sampleCount = (uint32_t)_sapp.sample_count;
|
||||
_sapp.wgpu.depth_stencil_tex = wgpuDeviceCreateTexture(_sapp.wgpu.device, &ds_desc);
|
||||
if (0 == _sapp.wgpu.depth_stencil_tex) {
|
||||
_SAPP_PANIC(WGPU_SWAPCHAIN_CREATE_DEPTH_STENCIL_TEXTURE_FAILED);
|
||||
}
|
||||
_sapp.wgpu.depth_stencil_view = wgpuTextureCreateView(_sapp.wgpu.depth_stencil_tex, 0);
|
||||
if (0 == _sapp.wgpu.depth_stencil_view) {
|
||||
_SAPP_PANIC(WGPU_SWAPCHAIN_CREATE_DEPTH_STENCIL_VIEW_FAILED);
|
||||
}
|
||||
|
||||
if (_sapp.sample_count > 1) {
|
||||
WGPUTextureDescriptor msaa_desc;
|
||||
_sapp_clear(&msaa_desc, sizeof(msaa_desc));
|
||||
msaa_desc.usage = WGPUTextureUsage_OutputAttachment;
|
||||
msaa_desc.usage = WGPUTextureUsage_RenderAttachment;
|
||||
msaa_desc.dimension = WGPUTextureDimension_2D;
|
||||
msaa_desc.size.width = (uint32_t) _sapp.framebuffer_width;
|
||||
msaa_desc.size.height = (uint32_t) _sapp.framebuffer_height;
|
||||
msaa_desc.size.depth = 1;
|
||||
msaa_desc.arrayLayerCount = 1;
|
||||
msaa_desc.format = _sapp.emsc.wgpu.render_format;
|
||||
msaa_desc.size.width = (uint32_t)_sapp.framebuffer_width;
|
||||
msaa_desc.size.height = (uint32_t)_sapp.framebuffer_height;
|
||||
msaa_desc.size.depthOrArrayLayers = 1;
|
||||
msaa_desc.format = _sapp.wgpu.render_format;
|
||||
msaa_desc.mipLevelCount = 1;
|
||||
msaa_desc.sampleCount = _sapp.sample_count;
|
||||
_sapp.emsc.wgpu.msaa_tex = wgpuDeviceCreateTexture(_sapp.emsc.wgpu.device, &msaa_desc);
|
||||
_sapp.emsc.wgpu.msaa_view = wgpuTextureCreateView(_sapp.emsc.wgpu.msaa_tex, 0);
|
||||
msaa_desc.sampleCount = (uint32_t)_sapp.sample_count;
|
||||
_sapp.wgpu.msaa_tex = wgpuDeviceCreateTexture(_sapp.wgpu.device, &msaa_desc);
|
||||
if (0 == _sapp.wgpu.msaa_tex) {
|
||||
_SAPP_PANIC(WGPU_SWAPCHAIN_CREATE_MSAA_TEXTURE_FAILED);
|
||||
}
|
||||
_sapp.wgpu.msaa_view = wgpuTextureCreateView(_sapp.wgpu.msaa_tex, 0);
|
||||
if (0 == _sapp.wgpu.msaa_view) {
|
||||
_SAPP_PANIC(WGPU_SWAPCHAIN_CREATE_MSAA_VIEW_FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_surfaces_discard(void) {
|
||||
if (_sapp.emsc.wgpu.msaa_tex) {
|
||||
wgpuTextureRelease(_sapp.emsc.wgpu.msaa_tex);
|
||||
_sapp.emsc.wgpu.msaa_tex = 0;
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_discard_swapchain(void) {
|
||||
if (_sapp.wgpu.msaa_view) {
|
||||
wgpuTextureViewRelease(_sapp.wgpu.msaa_view);
|
||||
_sapp.wgpu.msaa_view = 0;
|
||||
}
|
||||
if (_sapp.emsc.wgpu.msaa_view) {
|
||||
wgpuTextureViewRelease(_sapp.emsc.wgpu.msaa_view);
|
||||
_sapp.emsc.wgpu.msaa_view = 0;
|
||||
if (_sapp.wgpu.msaa_tex) {
|
||||
wgpuTextureRelease(_sapp.wgpu.msaa_tex);
|
||||
_sapp.wgpu.msaa_tex = 0;
|
||||
}
|
||||
if (_sapp.emsc.wgpu.depth_stencil_tex) {
|
||||
wgpuTextureRelease(_sapp.emsc.wgpu.depth_stencil_tex);
|
||||
_sapp.emsc.wgpu.depth_stencil_tex = 0;
|
||||
if (_sapp.wgpu.depth_stencil_view) {
|
||||
wgpuTextureViewRelease(_sapp.wgpu.depth_stencil_view);
|
||||
_sapp.wgpu.depth_stencil_view = 0;
|
||||
}
|
||||
if (_sapp.emsc.wgpu.depth_stencil_view) {
|
||||
wgpuTextureViewRelease(_sapp.emsc.wgpu.depth_stencil_view);
|
||||
_sapp.emsc.wgpu.depth_stencil_view = 0;
|
||||
if (_sapp.wgpu.depth_stencil_tex) {
|
||||
wgpuTextureRelease(_sapp.wgpu.depth_stencil_tex);
|
||||
_sapp.wgpu.depth_stencil_tex = 0;
|
||||
}
|
||||
if (_sapp.wgpu.swapchain) {
|
||||
wgpuSwapChainRelease(_sapp.wgpu.swapchain);
|
||||
_sapp.wgpu.swapchain = 0;
|
||||
}
|
||||
if (_sapp.wgpu.surface) {
|
||||
wgpuSurfaceRelease(_sapp.wgpu.surface);
|
||||
_sapp.wgpu.surface = 0;
|
||||
}
|
||||
}
|
||||
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_next_frame(void) {
|
||||
if (_sapp.emsc.wgpu.swapchain_view) {
|
||||
wgpuTextureViewRelease(_sapp.emsc.wgpu.swapchain_view);
|
||||
}
|
||||
_sapp.emsc.wgpu.swapchain_view = wgpuSwapChainGetCurrentTextureView(_sapp.emsc.wgpu.swapchain);
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_size_changed(void) {
|
||||
_sapp_emsc_wgpu_discard_swapchain();
|
||||
_sapp_emsc_wgpu_create_swapchain();
|
||||
}
|
||||
#endif
|
||||
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_request_device_cb(WGPURequestDeviceStatus status, WGPUDevice device, const char* msg, void* userdata) {
|
||||
_SOKOL_UNUSED(msg);
|
||||
_SOKOL_UNUSED(userdata);
|
||||
SOKOL_ASSERT(!_sapp.wgpu.async_init_done);
|
||||
if (status != WGPURequestDeviceStatus_Success) {
|
||||
if (status == WGPURequestDeviceStatus_Error) {
|
||||
_SAPP_PANIC(WGPU_REQUEST_DEVICE_STATUS_ERROR);
|
||||
} else {
|
||||
_SAPP_PANIC(WGPU_REQUEST_DEVICE_STATUS_UNKNOWN);
|
||||
}
|
||||
}
|
||||
SOKOL_ASSERT(device);
|
||||
_sapp.wgpu.device = device;
|
||||
_sapp_emsc_wgpu_create_swapchain();
|
||||
_sapp.wgpu.async_init_done = true;
|
||||
}
|
||||
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_request_adapter_cb(WGPURequestAdapterStatus status, WGPUAdapter adapter, const char* msg, void* userdata) {
|
||||
_SOKOL_UNUSED(msg);
|
||||
_SOKOL_UNUSED(userdata);
|
||||
if (status != WGPURequestAdapterStatus_Success) {
|
||||
switch (status) {
|
||||
case WGPURequestAdapterStatus_Unavailable: _SAPP_PANIC(WGPU_REQUEST_ADAPTER_STATUS_UNAVAILABLE); break;
|
||||
case WGPURequestAdapterStatus_Error: _SAPP_PANIC(WGPU_REQUEST_ADAPTER_STATUS_ERROR); break;
|
||||
default: _SAPP_PANIC(WGPU_REQUEST_ADAPTER_STATUS_UNKNOWN); break;
|
||||
}
|
||||
}
|
||||
SOKOL_ASSERT(adapter);
|
||||
_sapp.wgpu.adapter = adapter;
|
||||
size_t cur_feature_index = 1;
|
||||
WGPUFeatureName requiredFeatures[8] = {
|
||||
WGPUFeatureName_Depth32FloatStencil8,
|
||||
};
|
||||
// check for optional features we're interested in
|
||||
// FIXME: ASTC texture compression
|
||||
if (wgpuAdapterHasFeature(adapter, WGPUFeatureName_TextureCompressionBC)) {
|
||||
requiredFeatures[cur_feature_index++] = WGPUFeatureName_TextureCompressionBC;
|
||||
} else if (wgpuAdapterHasFeature(adapter, WGPUFeatureName_TextureCompressionETC2)) {
|
||||
requiredFeatures[cur_feature_index++] = WGPUFeatureName_TextureCompressionETC2;
|
||||
}
|
||||
|
||||
WGPUDeviceDescriptor dev_desc;
|
||||
_sapp_clear(&dev_desc, sizeof(dev_desc));
|
||||
dev_desc.requiredFeaturesCount = cur_feature_index;
|
||||
dev_desc.requiredFeatures = requiredFeatures,
|
||||
wgpuAdapterRequestDevice(adapter, &dev_desc, _sapp_emsc_wgpu_request_device_cb, 0);
|
||||
}
|
||||
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_init(void) {
|
||||
SOKOL_ASSERT(0 == _sapp.wgpu.instance);
|
||||
SOKOL_ASSERT(!_sapp.wgpu.async_init_done);
|
||||
_sapp.wgpu.instance = wgpuCreateInstance(0);
|
||||
if (0 == _sapp.wgpu.instance) {
|
||||
_SAPP_PANIC(WGPU_CREATE_INSTANCE_FAILED);
|
||||
}
|
||||
// FIXME: power preference?
|
||||
wgpuInstanceRequestAdapter(_sapp.wgpu.instance, 0, _sapp_emsc_wgpu_request_adapter_cb, 0);
|
||||
}
|
||||
|
||||
_SOKOL_PRIVATE void _sapp_emsc_wgpu_frame(void) {
|
||||
if (_sapp.wgpu.async_init_done) {
|
||||
_sapp.wgpu.swapchain_view = wgpuSwapChainGetCurrentTextureView(_sapp.wgpu.swapchain);
|
||||
_sapp_frame();
|
||||
wgpuTextureViewRelease(_sapp.wgpu.swapchain_view);
|
||||
_sapp.wgpu.swapchain_view = 0;
|
||||
}
|
||||
}
|
||||
#endif // SOKOL_WGPU
|
||||
|
||||
_SOKOL_PRIVATE void _sapp_emsc_register_eventhandlers(void) {
|
||||
emscripten_set_mousedown_callback(_sapp.html5_canvas_selector, 0, true, _sapp_emsc_mouse_cb);
|
||||
@ -5928,32 +6010,12 @@ _SOKOL_PRIVATE EM_BOOL _sapp_emsc_frame(double time, void* userData) {
|
||||
_sapp_timing_external(&_sapp.timing, time / 1000.0);
|
||||
|
||||
#if defined(SOKOL_WGPU)
|
||||
/*
|
||||
on WebGPU, the emscripten frame callback will already be called while
|
||||
the asynchronous WebGPU device and swapchain initialization is still
|
||||
in progress
|
||||
*/
|
||||
switch (_sapp.emsc.wgpu.state) {
|
||||
case _SAPP_EMSC_WGPU_STATE_INITIAL:
|
||||
/* async JS init hasn't finished yet */
|
||||
break;
|
||||
case _SAPP_EMSC_WGPU_STATE_READY:
|
||||
/* perform post-async init stuff */
|
||||
_sapp_emsc_wgpu_surfaces_create();
|
||||
_sapp.emsc.wgpu.state = _SAPP_EMSC_WGPU_STATE_RUNNING;
|
||||
break;
|
||||
case _SAPP_EMSC_WGPU_STATE_RUNNING:
|
||||
/* a regular frame */
|
||||
_sapp_emsc_wgpu_next_frame();
|
||||
_sapp_frame();
|
||||
break;
|
||||
}
|
||||
_sapp_emsc_wgpu_frame();
|
||||
#else
|
||||
/* WebGL code path */
|
||||
_sapp_frame();
|
||||
#endif
|
||||
|
||||
/* quit-handling */
|
||||
// quit-handling
|
||||
if (_sapp.quit_requested) {
|
||||
_sapp_init_event(SAPP_EVENTTYPE_QUIT_REQUESTED);
|
||||
_sapp_call_event(&_sapp.event);
|
||||
@ -5993,18 +6055,17 @@ _SOKOL_PRIVATE void _sapp_emsc_run(const sapp_desc* desc) {
|
||||
#if defined(SOKOL_GLES3)
|
||||
_sapp_emsc_webgl_init();
|
||||
#elif defined(SOKOL_WGPU)
|
||||
sapp_js_wgpu_init();
|
||||
_sapp_emsc_wgpu_init();
|
||||
#endif
|
||||
_sapp.valid = true;
|
||||
_sapp_emsc_register_eventhandlers();
|
||||
sapp_set_icon(&desc->icon);
|
||||
|
||||
/* start the frame loop */
|
||||
// start the frame loop
|
||||
emscripten_request_animation_frame_loop(_sapp_emsc_frame, 0);
|
||||
|
||||
/* NOT A BUG: do not call _sapp_discard_state() here, instead this is
|
||||
called in _sapp_emsc_frame() when the application is ordered to quit
|
||||
*/
|
||||
// NOT A BUG: do not call _sapp_discard_state() here, instead this is
|
||||
// called in _sapp_emsc_frame() when the application is ordered to quit
|
||||
}
|
||||
|
||||
#if !defined(SOKOL_NO_ENTRY)
|
||||
@ -6048,6 +6109,99 @@ _SOKOL_PRIVATE void _sapp_gl_init_fbconfig(_sapp_gl_fbconfig* fbconfig) {
|
||||
fbconfig->samples = -1;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
int least_missing;
|
||||
int least_color_diff;
|
||||
int least_extra_diff;
|
||||
bool best_match;
|
||||
} _sapp_gl_fbselect;
|
||||
|
||||
_SOKOL_PRIVATE void _sapp_gl_init_fbselect(_sapp_gl_fbselect* fbselect) {
|
||||
_sapp_clear(fbselect, sizeof(_sapp_gl_fbselect));
|
||||
fbselect->least_missing = 1000000;
|
||||
fbselect->least_color_diff = 10000000;
|
||||
fbselect->least_extra_diff = 10000000;
|
||||
fbselect->best_match = false;
|
||||
}
|
||||
|
||||
// NOTE: this is used only in the WGL code path
|
||||
_SOKOL_PRIVATE bool _sapp_gl_select_fbconfig(_sapp_gl_fbselect* fbselect, const _sapp_gl_fbconfig* desired, const _sapp_gl_fbconfig* current) {
|
||||
int missing = 0;
|
||||
if (desired->doublebuffer != current->doublebuffer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((desired->alpha_bits > 0) && (current->alpha_bits == 0)) {
|
||||
missing++;
|
||||
}
|
||||
if ((desired->depth_bits > 0) && (current->depth_bits == 0)) {
|
||||
missing++;
|
||||
}
|
||||
if ((desired->stencil_bits > 0) && (current->stencil_bits == 0)) {
|
||||
missing++;
|
||||
}
|
||||
if ((desired->samples > 0) && (current->samples == 0)) {
|
||||
/* Technically, several multisampling buffers could be
|
||||
involved, but that's a lower level implementation detail and
|
||||
not important to us here, so we count them as one
|
||||
*/
|
||||
missing++;
|
||||
}
|
||||
|
||||
/* These polynomials make many small channel size differences matter
|
||||
less than one large channel size difference
|
||||
Calculate color channel size difference value
|
||||
*/
|
||||
int color_diff = 0;
|
||||
if (desired->red_bits != -1) {
|
||||
color_diff += (desired->red_bits - current->red_bits) * (desired->red_bits - current->red_bits);
|
||||
}
|
||||
if (desired->green_bits != -1) {
|
||||
color_diff += (desired->green_bits - current->green_bits) * (desired->green_bits - current->green_bits);
|
||||
}
|
||||
if (desired->blue_bits != -1) {
|
||||
color_diff += (desired->blue_bits - current->blue_bits) * (desired->blue_bits - current->blue_bits);
|
||||
}
|
||||
|
||||
/* Calculate non-color channel size difference value */
|
||||
int extra_diff = 0;
|
||||
if (desired->alpha_bits != -1) {
|
||||
extra_diff += (desired->alpha_bits - current->alpha_bits) * (desired->alpha_bits - current->alpha_bits);
|
||||
}
|
||||
if (desired->depth_bits != -1) {
|
||||
extra_diff += (desired->depth_bits - current->depth_bits) * (desired->depth_bits - current->depth_bits);
|
||||
}
|
||||
if (desired->stencil_bits != -1) {
|
||||
extra_diff += (desired->stencil_bits - current->stencil_bits) * (desired->stencil_bits - current->stencil_bits);
|
||||
}
|
||||
if (desired->samples != -1) {
|
||||
extra_diff += (desired->samples - current->samples) * (desired->samples - current->samples);
|
||||
}
|
||||
|
||||
/* Figure out if the current one is better than the best one found so far
|
||||
Least number of missing buffers is the most important heuristic,
|
||||
then color buffer size match and lastly size match for other buffers
|
||||
*/
|
||||
bool new_closest = false;
|
||||
if (missing < fbselect->least_missing) {
|
||||
new_closest = true;
|
||||
} else if (missing == fbselect->least_missing) {
|
||||
if ((color_diff < fbselect->least_color_diff) ||
|
||||
((color_diff == fbselect->least_color_diff) && (extra_diff < fbselect->least_extra_diff)))
|
||||
{
|
||||
new_closest = true;
|
||||
}
|
||||
}
|
||||
if (new_closest) {
|
||||
fbselect->least_missing = missing;
|
||||
fbselect->least_color_diff = color_diff;
|
||||
fbselect->least_extra_diff = extra_diff;
|
||||
fbselect->best_match = (missing | color_diff | extra_diff) == 0;
|
||||
}
|
||||
return new_closest;
|
||||
}
|
||||
|
||||
// NOTE: this is used only in the GLX code path
|
||||
_SOKOL_PRIVATE const _sapp_gl_fbconfig* _sapp_gl_choose_fbconfig(const _sapp_gl_fbconfig* desired, const _sapp_gl_fbconfig* alternatives, int count) {
|
||||
int missing, least_missing = 1000000;
|
||||
int color_diff, least_color_diff = 10000000;
|
||||
@ -6735,22 +6889,21 @@ _SOKOL_PRIVATE void _sapp_wgl_attribiv(int pixel_format, int num_attribs, const
|
||||
_SOKOL_PRIVATE int _sapp_wgl_find_pixel_format(void) {
|
||||
SOKOL_ASSERT(_sapp.win32.dc);
|
||||
SOKOL_ASSERT(_sapp.wgl.arb_pixel_format);
|
||||
const _sapp_gl_fbconfig* closest;
|
||||
|
||||
#define _sapp_wgl_num_query_tags (12)
|
||||
const int query_tags[_sapp_wgl_num_query_tags] = {
|
||||
WGL_SUPPORT_OPENGL_ARB,
|
||||
WGL_DRAW_TO_WINDOW_ARB,
|
||||
WGL_PIXEL_TYPE_ARB,
|
||||
WGL_ACCELERATION_ARB,
|
||||
WGL_DOUBLE_BUFFER_ARB,
|
||||
WGL_RED_BITS_ARB,
|
||||
WGL_GREEN_BITS_ARB,
|
||||
WGL_BLUE_BITS_ARB,
|
||||
WGL_ALPHA_BITS_ARB,
|
||||
WGL_DEPTH_BITS_ARB,
|
||||
WGL_STENCIL_BITS_ARB,
|
||||
WGL_SAMPLES_ARB,
|
||||
WGL_SUPPORT_OPENGL_ARB,
|
||||
WGL_DRAW_TO_WINDOW_ARB,
|
||||
WGL_PIXEL_TYPE_ARB,
|
||||
WGL_ACCELERATION_ARB,
|
||||
WGL_DOUBLE_BUFFER_ARB,
|
||||
WGL_RED_BITS_ARB,
|
||||
WGL_GREEN_BITS_ARB,
|
||||
WGL_BLUE_BITS_ARB,
|
||||
WGL_ALPHA_BITS_ARB,
|
||||
WGL_DEPTH_BITS_ARB,
|
||||
WGL_STENCIL_BITS_ARB,
|
||||
WGL_SAMPLES_ARB,
|
||||
};
|
||||
const int result_support_opengl_index = 0;
|
||||
const int result_draw_to_window_index = 1;
|
||||
@ -6774,38 +6927,7 @@ _SOKOL_PRIVATE int _sapp_wgl_find_pixel_format(void) {
|
||||
}
|
||||
|
||||
int native_count = _sapp_wgl_attrib(1, WGL_NUMBER_PIXEL_FORMATS_ARB);
|
||||
_sapp_gl_fbconfig* usable_configs = (_sapp_gl_fbconfig*) _sapp_malloc_clear((size_t)native_count * sizeof(_sapp_gl_fbconfig));
|
||||
SOKOL_ASSERT(usable_configs);
|
||||
int usable_count = 0;
|
||||
for (int i = 0; i < native_count; i++) {
|
||||
const int n = i + 1;
|
||||
_sapp_gl_fbconfig* u = usable_configs + usable_count;
|
||||
_sapp_gl_init_fbconfig(u);
|
||||
_sapp_wgl_attribiv(n, query_count, query_tags, query_results);
|
||||
|
||||
if (query_results[result_support_opengl_index] == 0
|
||||
|| query_results[result_draw_to_window_index] == 0
|
||||
|| query_results[result_pixel_type_index] != WGL_TYPE_RGBA_ARB
|
||||
|| query_results[result_acceleration_index] == WGL_NO_ACCELERATION_ARB)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
u->red_bits = query_results[result_red_bits_index];
|
||||
u->green_bits = query_results[result_green_bits_index];
|
||||
u->blue_bits = query_results[result_blue_bits_index];
|
||||
u->alpha_bits = query_results[result_alpha_bits_index];
|
||||
u->depth_bits = query_results[result_depth_bits_index];
|
||||
u->stencil_bits = query_results[result_stencil_bits_index];
|
||||
if (query_results[result_double_buffer_index]) {
|
||||
u->doublebuffer = true;
|
||||
}
|
||||
|
||||
u->samples = query_results[result_samples_index]; // NOTE: If arb_multisample is not supported - just takes the default 0
|
||||
|
||||
u->handle = (uintptr_t)n;
|
||||
usable_count++;
|
||||
}
|
||||
SOKOL_ASSERT(usable_count > 0);
|
||||
_sapp_gl_fbconfig desired;
|
||||
_sapp_gl_init_fbconfig(&desired);
|
||||
desired.red_bits = 8;
|
||||
@ -6815,13 +6937,46 @@ _SOKOL_PRIVATE int _sapp_wgl_find_pixel_format(void) {
|
||||
desired.depth_bits = 24;
|
||||
desired.stencil_bits = 8;
|
||||
desired.doublebuffer = true;
|
||||
desired.samples = _sapp.sample_count > 1 ? _sapp.sample_count : 0;
|
||||
closest = _sapp_gl_choose_fbconfig(&desired, usable_configs, usable_count);
|
||||
desired.samples = (_sapp.sample_count > 1) ? _sapp.sample_count : 0;
|
||||
|
||||
int pixel_format = 0;
|
||||
if (closest) {
|
||||
pixel_format = (int) closest->handle;
|
||||
|
||||
_sapp_gl_fbselect fbselect;
|
||||
_sapp_gl_init_fbselect(&fbselect);
|
||||
for (int i = 0; i < native_count; i++) {
|
||||
const int n = i + 1;
|
||||
_sapp_wgl_attribiv(n, query_count, query_tags, query_results);
|
||||
|
||||
if (query_results[result_support_opengl_index] == 0
|
||||
|| query_results[result_draw_to_window_index] == 0
|
||||
|| query_results[result_pixel_type_index] != WGL_TYPE_RGBA_ARB
|
||||
|| query_results[result_acceleration_index] == WGL_NO_ACCELERATION_ARB)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
_sapp_gl_fbconfig u;
|
||||
_sapp_clear(&u, sizeof(u));
|
||||
u.red_bits = query_results[result_red_bits_index];
|
||||
u.green_bits = query_results[result_green_bits_index];
|
||||
u.blue_bits = query_results[result_blue_bits_index];
|
||||
u.alpha_bits = query_results[result_alpha_bits_index];
|
||||
u.depth_bits = query_results[result_depth_bits_index];
|
||||
u.stencil_bits = query_results[result_stencil_bits_index];
|
||||
u.doublebuffer = 0 != query_results[result_double_buffer_index];
|
||||
u.samples = query_results[result_samples_index]; // NOTE: If arb_multisample is not supported - just takes the default 0
|
||||
|
||||
// Test if this pixel format is better than the previous one
|
||||
if (_sapp_gl_select_fbconfig(&fbselect, &desired, &u)) {
|
||||
pixel_format = (uintptr_t)n;
|
||||
|
||||
// Early exit if matching as good as possible
|
||||
if (fbselect.best_match) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
_sapp_free(usable_configs);
|
||||
|
||||
return pixel_format;
|
||||
}
|
||||
|
||||
@ -11233,7 +11388,7 @@ SOKOL_API_IMPL float sapp_heightf(void) {
|
||||
|
||||
SOKOL_API_IMPL int sapp_color_format(void) {
|
||||
#if defined(_SAPP_EMSCRIPTEN) && defined(SOKOL_WGPU)
|
||||
switch (_sapp.emsc.wgpu.render_format) {
|
||||
switch (_sapp.wgpu.render_format) {
|
||||
case WGPUTextureFormat_RGBA8Unorm:
|
||||
return _SAPP_PIXELFORMAT_RGBA8;
|
||||
case WGPUTextureFormat_BGRA8Unorm:
|
||||
@ -11661,7 +11816,7 @@ SOKOL_API_IMPL const void* sapp_win32_get_hwnd(void) {
|
||||
SOKOL_API_IMPL const void* sapp_wgpu_get_device(void) {
|
||||
SOKOL_ASSERT(_sapp.valid);
|
||||
#if defined(_SAPP_EMSCRIPTEN) && defined(SOKOL_WGPU)
|
||||
return (const void*) _sapp.emsc.wgpu.device;
|
||||
return (const void*) _sapp.wgpu.device;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
@ -11671,10 +11826,10 @@ SOKOL_API_IMPL const void* sapp_wgpu_get_render_view(void) {
|
||||
SOKOL_ASSERT(_sapp.valid);
|
||||
#if defined(_SAPP_EMSCRIPTEN) && defined(SOKOL_WGPU)
|
||||
if (_sapp.sample_count > 1) {
|
||||
return (const void*) _sapp.emsc.wgpu.msaa_view;
|
||||
return (const void*) _sapp.wgpu.msaa_view;
|
||||
}
|
||||
else {
|
||||
return (const void*) _sapp.emsc.wgpu.swapchain_view;
|
||||
return (const void*) _sapp.wgpu.swapchain_view;
|
||||
}
|
||||
#else
|
||||
return 0;
|
||||
@ -11685,7 +11840,7 @@ SOKOL_API_IMPL const void* sapp_wgpu_get_resolve_view(void) {
|
||||
SOKOL_ASSERT(_sapp.valid);
|
||||
#if defined(_SAPP_EMSCRIPTEN) && defined(SOKOL_WGPU)
|
||||
if (_sapp.sample_count > 1) {
|
||||
return (const void*) _sapp.emsc.wgpu.swapchain_view;
|
||||
return (const void*) _sapp.wgpu.swapchain_view;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
@ -11698,7 +11853,7 @@ SOKOL_API_IMPL const void* sapp_wgpu_get_resolve_view(void) {
|
||||
SOKOL_API_IMPL const void* sapp_wgpu_get_depth_stencil_view(void) {
|
||||
SOKOL_ASSERT(_sapp.valid);
|
||||
#if defined(_SAPP_EMSCRIPTEN) && defined(SOKOL_WGPU)
|
||||
return (const void*) _sapp.emsc.wgpu.depth_stencil_view;
|
||||
return (const void*) _sapp.wgpu.depth_stencil_view;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
3766
thirdparty/sokol/sokol_gfx.h
vendored
3766
thirdparty/sokol/sokol_gfx.h
vendored
File diff suppressed because it is too large
Load Diff
316
thirdparty/sokol/util/sokol_fontstash.h
vendored
316
thirdparty/sokol/util/sokol_fontstash.h
vendored
@ -300,7 +300,9 @@ SOKOL_FONTSTASH_API_DECL uint32_t sfons_rgba(uint8_t r, uint8_t g, uint8_t b, ui
|
||||
out vec4 color;
|
||||
void main() {
|
||||
gl_Position = mvp * position;
|
||||
#ifndef SOKOL_WGSL
|
||||
gl_PointSize = psize;
|
||||
#endif
|
||||
uv = tm * vec4(texcoord0, 0.0, 1.0);
|
||||
color = color0;
|
||||
}
|
||||
@ -1395,195 +1397,125 @@ static const uint8_t _sfons_fs_bytecode_hlsl4[628] = {
|
||||
0x00,0x00,0x00,0x00,
|
||||
};
|
||||
#elif defined(SOKOL_WGPU)
|
||||
static const uint8_t _sfons_vs_bytecode_wgpu[1968] = {
|
||||
0x03,0x02,0x23,0x07,0x00,0x00,0x01,0x00,0x08,0x00,0x08,0x00,0x35,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x11,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x0b,0x00,0x06,0x00,
|
||||
0x02,0x00,0x00,0x00,0x47,0x4c,0x53,0x4c,0x2e,0x73,0x74,0x64,0x2e,0x34,0x35,0x30,
|
||||
0x00,0x00,0x00,0x00,0x0e,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x0f,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,
|
||||
0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,0x21,0x00,0x00,0x00,
|
||||
0x25,0x00,0x00,0x00,0x2a,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x33,0x00,0x00,0x00,
|
||||
0x07,0x00,0x03,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x05,0x00,
|
||||
0x07,0x00,0x00,0x00,0x73,0x66,0x6f,0x6e,0x73,0x2e,0x67,0x6c,0x73,0x6c,0x00,0x00,
|
||||
0x03,0x00,0x37,0x00,0x02,0x00,0x00,0x00,0xc2,0x01,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,
|
||||
0x73,0x73,0x65,0x64,0x20,0x63,0x6c,0x69,0x65,0x6e,0x74,0x20,0x76,0x75,0x6c,0x6b,
|
||||
0x61,0x6e,0x31,0x30,0x30,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,
|
||||
0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x63,0x6c,0x69,0x65,0x6e,
|
||||
0x74,0x20,0x6f,0x70,0x65,0x6e,0x67,0x6c,0x31,0x30,0x30,0x0a,0x2f,0x2f,0x20,0x4f,
|
||||
0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,
|
||||
0x20,0x74,0x61,0x72,0x67,0x65,0x74,0x2d,0x65,0x6e,0x76,0x20,0x76,0x75,0x6c,0x6b,
|
||||
0x61,0x6e,0x31,0x2e,0x30,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,
|
||||
0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x74,0x61,0x72,0x67,0x65,
|
||||
0x74,0x2d,0x65,0x6e,0x76,0x20,0x6f,0x70,0x65,0x6e,0x67,0x6c,0x0a,0x2f,0x2f,0x20,
|
||||
0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,
|
||||
0x64,0x20,0x65,0x6e,0x74,0x72,0x79,0x2d,0x70,0x6f,0x69,0x6e,0x74,0x20,0x6d,0x61,
|
||||
0x69,0x6e,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x0a,0x00,0x05,0x00,0x04,0x00,
|
||||
0x05,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,0x00,0x00,0x00,0x00,0x05,0x00,0x06,0x00,
|
||||
0x0d,0x00,0x00,0x00,0x67,0x6c,0x5f,0x50,0x65,0x72,0x56,0x65,0x72,0x74,0x65,0x78,
|
||||
0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x06,0x00,0x07,0x00,
|
||||
0x0d,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,
|
||||
0x53,0x69,0x7a,0x65,0x00,0x00,0x00,0x00,0x06,0x00,0x07,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0x67,0x6c,0x5f,0x43,0x6c,0x69,0x70,0x44,0x69,0x73,0x74,0x61,
|
||||
0x6e,0x63,0x65,0x00,0x06,0x00,0x07,0x00,0x0d,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
|
||||
0x67,0x6c,0x5f,0x43,0x75,0x6c,0x6c,0x44,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x00,
|
||||
0x05,0x00,0x03,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x05,0x00,
|
||||
0x13,0x00,0x00,0x00,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x00,0x00,0x00,
|
||||
0x06,0x00,0x04,0x00,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6d,0x76,0x70,0x00,
|
||||
0x06,0x00,0x04,0x00,0x13,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x74,0x6d,0x00,0x00,
|
||||
0x05,0x00,0x03,0x00,0x15,0x00,0x00,0x00,0x5f,0x32,0x31,0x00,0x05,0x00,0x05,0x00,
|
||||
0x1a,0x00,0x00,0x00,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x00,0x00,0x00,
|
||||
0x05,0x00,0x04,0x00,0x21,0x00,0x00,0x00,0x70,0x73,0x69,0x7a,0x65,0x00,0x00,0x00,
|
||||
0x05,0x00,0x03,0x00,0x25,0x00,0x00,0x00,0x75,0x76,0x00,0x00,0x05,0x00,0x05,0x00,
|
||||
0x2a,0x00,0x00,0x00,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x00,0x00,0x00,
|
||||
0x05,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x63,0x6f,0x6c,0x6f,0x72,0x00,0x00,0x00,
|
||||
0x05,0x00,0x04,0x00,0x33,0x00,0x00,0x00,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x00,0x00,
|
||||
0x48,0x00,0x05,0x00,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x0d,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x0b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x48,0x00,0x05,0x00,
|
||||
0x0d,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x47,0x00,0x03,0x00,0x0d,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x48,0x00,0x04,0x00,
|
||||
0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x48,0x00,0x05,0x00,
|
||||
0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x48,0x00,0x05,0x00,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,
|
||||
0x10,0x00,0x00,0x00,0x48,0x00,0x04,0x00,0x13,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x05,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x13,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x23,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x13,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x47,0x00,0x03,0x00,
|
||||
0x13,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x15,0x00,0x00,0x00,
|
||||
0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x15,0x00,0x00,0x00,
|
||||
0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x1a,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x21,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x25,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x2a,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x32,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x33,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x13,0x00,0x02,0x00,0x03,0x00,0x00,0x00,
|
||||
0x21,0x00,0x03,0x00,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x16,0x00,0x03,0x00,
|
||||
0x08,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x17,0x00,0x04,0x00,0x09,0x00,0x00,0x00,
|
||||
0x08,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x15,0x00,0x04,0x00,0x0a,0x00,0x00,0x00,
|
||||
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2b,0x00,0x04,0x00,0x0a,0x00,0x00,0x00,
|
||||
0x0b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1c,0x00,0x04,0x00,0x0c,0x00,0x00,0x00,
|
||||
0x08,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x1e,0x00,0x06,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x09,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x0e,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x0e,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
|
||||
0x15,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x2b,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x18,0x00,0x04,0x00,0x12,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x04,0x00,0x13,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x14,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x13,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x14,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x16,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x19,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x09,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x19,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x1d,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x09,0x00,0x00,0x00,
|
||||
0x2b,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x20,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x23,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x1d,0x00,0x00,0x00,0x25,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
|
||||
0x17,0x00,0x04,0x00,0x28,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x29,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x28,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x29,0x00,0x00,0x00,0x2a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x2b,0x00,0x04,0x00,0x08,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x2b,0x00,0x04,0x00,0x08,0x00,0x00,0x00,0x2d,0x00,0x00,0x00,0x00,0x00,0x80,0x3f,
|
||||
0x3b,0x00,0x04,0x00,0x1d,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x19,0x00,0x00,0x00,0x33,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x36,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x04,0x00,0x00,0x00,0xf8,0x00,0x02,0x00,0x06,0x00,0x00,0x00,0x08,0x00,0x04,0x00,
|
||||
0x07,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x05,0x00,
|
||||
0x16,0x00,0x00,0x00,0x17,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
|
||||
0x3d,0x00,0x04,0x00,0x12,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x17,0x00,0x00,0x00,
|
||||
0x3d,0x00,0x04,0x00,0x09,0x00,0x00,0x00,0x1b,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,
|
||||
0x91,0x00,0x05,0x00,0x09,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x18,0x00,0x00,0x00,
|
||||
0x1b,0x00,0x00,0x00,0x41,0x00,0x05,0x00,0x1d,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x0f,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x1c,0x00,0x00,0x00,0x08,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x13,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,0x08,0x00,0x00,0x00,0x22,0x00,0x00,0x00,
|
||||
0x21,0x00,0x00,0x00,0x41,0x00,0x05,0x00,0x23,0x00,0x00,0x00,0x24,0x00,0x00,0x00,
|
||||
0x0f,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,0x24,0x00,0x00,0x00,
|
||||
0x22,0x00,0x00,0x00,0x08,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x14,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x41,0x00,0x05,0x00,0x16,0x00,0x00,0x00,0x26,0x00,0x00,0x00,
|
||||
0x15,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,0x12,0x00,0x00,0x00,
|
||||
0x27,0x00,0x00,0x00,0x26,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,0x28,0x00,0x00,0x00,
|
||||
0x2b,0x00,0x00,0x00,0x2a,0x00,0x00,0x00,0x51,0x00,0x05,0x00,0x08,0x00,0x00,0x00,
|
||||
0x2e,0x00,0x00,0x00,0x2b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x51,0x00,0x05,0x00,
|
||||
0x08,0x00,0x00,0x00,0x2f,0x00,0x00,0x00,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x50,0x00,0x07,0x00,0x09,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x2e,0x00,0x00,0x00,
|
||||
0x2f,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x2d,0x00,0x00,0x00,0x91,0x00,0x05,0x00,
|
||||
0x09,0x00,0x00,0x00,0x31,0x00,0x00,0x00,0x27,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x3e,0x00,0x03,0x00,0x25,0x00,0x00,0x00,0x31,0x00,0x00,0x00,0x08,0x00,0x04,0x00,
|
||||
0x07,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,
|
||||
0x09,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0x33,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,
|
||||
0x32,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0xfd,0x00,0x01,0x00,0x38,0x00,0x01,0x00,
|
||||
static const char _sfons_vs_source_wgsl[1162] = {
|
||||
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
|
||||
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
|
||||
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
|
||||
0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,
|
||||
0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,
|
||||
0x20,0x6d,0x76,0x70,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,0x34,0x66,0x2c,0x0a,
|
||||
0x20,0x20,0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x36,0x34,0x29,
|
||||
0x20,0x2a,0x2f,0x0a,0x20,0x20,0x74,0x6d,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,
|
||||
0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29,
|
||||
0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x30,0x29,0x20,0x76,0x61,0x72,
|
||||
0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x31,0x39,0x20,0x3a,
|
||||
0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x0a,0x76,0x61,0x72,
|
||||
0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,
|
||||
0x6f,0x6e,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,
|
||||
0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,
|
||||
0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
|
||||
0x76,0x61,0x74,0x65,0x3e,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,
|
||||
0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,
|
||||
0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,
|
||||
0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,
|
||||
0x74,0x65,0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,
|
||||
0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,
|
||||
0x3e,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x0a,
|
||||
0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x67,0x6c,0x5f,
|
||||
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,
|
||||
0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,
|
||||
0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x20,0x3a,0x20,0x6d,0x61,
|
||||
0x74,0x34,0x78,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70,
|
||||
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x35,0x20,0x3a,0x20,0x76,
|
||||
0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,
|
||||
0x31,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
|
||||
0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,0x32,0x20,0x2a,0x20,0x78,0x5f,0x32,0x35,0x29,
|
||||
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x32,0x20,0x3a,0x20,0x6d,
|
||||
0x61,0x74,0x34,0x78,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x39,0x2e,0x74,0x6d,
|
||||
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x36,0x20,0x3a,0x20,0x76,
|
||||
0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,
|
||||
0x3b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x28,0x78,0x5f,0x33,0x32,0x20,0x2a,
|
||||
0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x33,0x36,0x2e,0x78,0x2c,0x20,0x78,
|
||||
0x5f,0x33,0x36,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,
|
||||
0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x35,0x20,
|
||||
0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,
|
||||
0x3b,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x78,0x5f,0x34,0x35,
|
||||
0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,
|
||||
0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,
|
||||
0x0a,0x20,0x20,0x40,0x62,0x75,0x69,0x6c,0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,
|
||||
0x74,0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,
|
||||
0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40,
|
||||
0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x75,0x76,
|
||||
0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c,
|
||||
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x0a,0x20,0x20,0x63,0x6f,0x6c,
|
||||
0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,
|
||||
0x0a,0x40,0x76,0x65,0x72,0x74,0x65,0x78,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,
|
||||
0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x70,0x6f,
|
||||
0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,
|
||||
0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,
|
||||
0x6e,0x28,0x31,0x29,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70,
|
||||
0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c,
|
||||
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x32,0x29,0x20,0x63,0x6f,0x6c,0x6f,0x72,
|
||||
0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,
|
||||
0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x33,0x29,0x20,0x70,0x73,
|
||||
0x69,0x7a,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x66,0x33,0x32,0x29,
|
||||
0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,
|
||||
0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x20,0x3d,0x20,0x70,0x6f,
|
||||
0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,
|
||||
0x20,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,0x20,0x74,0x65,
|
||||
0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,
|
||||
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,
|
||||
0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,
|
||||
0x3d,0x20,0x70,0x73,0x69,0x7a,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,
|
||||
0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,
|
||||
0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x67,0x6c,0x5f,
|
||||
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x75,0x76,0x2c,0x20,0x63,0x6f,
|
||||
0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||
};
|
||||
static const uint8_t fs_bytecode_wgpu[1000] = {
|
||||
0x03,0x02,0x23,0x07,0x00,0x00,0x01,0x00,0x08,0x00,0x08,0x00,0x1f,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x11,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x0b,0x00,0x06,0x00,
|
||||
0x02,0x00,0x00,0x00,0x47,0x4c,0x53,0x4c,0x2e,0x73,0x74,0x64,0x2e,0x34,0x35,0x30,
|
||||
0x00,0x00,0x00,0x00,0x0e,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x0f,0x00,0x08,0x00,0x04,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,
|
||||
0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x13,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,
|
||||
0x10,0x00,0x03,0x00,0x05,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x03,0x00,
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x05,0x00,0x07,0x00,0x00,0x00,
|
||||
0x73,0x66,0x6f,0x6e,0x73,0x2e,0x67,0x6c,0x73,0x6c,0x00,0x00,0x03,0x00,0x37,0x00,
|
||||
0x02,0x00,0x00,0x00,0xc2,0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x2f,0x2f,0x20,0x4f,
|
||||
0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,
|
||||
0x20,0x63,0x6c,0x69,0x65,0x6e,0x74,0x20,0x76,0x75,0x6c,0x6b,0x61,0x6e,0x31,0x30,
|
||||
0x30,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,
|
||||
0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x63,0x6c,0x69,0x65,0x6e,0x74,0x20,0x6f,0x70,
|
||||
0x65,0x6e,0x67,0x6c,0x31,0x30,0x30,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,
|
||||
0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x74,0x61,0x72,
|
||||
0x67,0x65,0x74,0x2d,0x65,0x6e,0x76,0x20,0x76,0x75,0x6c,0x6b,0x61,0x6e,0x31,0x2e,
|
||||
0x30,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,
|
||||
0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x74,0x61,0x72,0x67,0x65,0x74,0x2d,0x65,0x6e,
|
||||
0x76,0x20,0x6f,0x70,0x65,0x6e,0x67,0x6c,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,
|
||||
0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x65,0x6e,
|
||||
0x74,0x72,0x79,0x2d,0x70,0x6f,0x69,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x0a,0x23,
|
||||
0x6c,0x69,0x6e,0x65,0x20,0x31,0x0a,0x00,0x05,0x00,0x04,0x00,0x05,0x00,0x00,0x00,
|
||||
0x6d,0x61,0x69,0x6e,0x00,0x00,0x00,0x00,0x05,0x00,0x05,0x00,0x0b,0x00,0x00,0x00,
|
||||
0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x00,0x00,0x05,0x00,0x03,0x00,
|
||||
0x10,0x00,0x00,0x00,0x74,0x65,0x78,0x00,0x05,0x00,0x03,0x00,0x13,0x00,0x00,0x00,
|
||||
0x75,0x76,0x00,0x00,0x05,0x00,0x04,0x00,0x1c,0x00,0x00,0x00,0x63,0x6f,0x6c,0x6f,
|
||||
0x72,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x0b,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x22,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x21,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x13,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x1c,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x13,0x00,0x02,0x00,0x03,0x00,0x00,0x00,0x21,0x00,0x03,0x00,
|
||||
0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x16,0x00,0x03,0x00,0x08,0x00,0x00,0x00,
|
||||
0x20,0x00,0x00,0x00,0x17,0x00,0x04,0x00,0x09,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x04,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x0a,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
|
||||
0x09,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x0a,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,
|
||||
0x03,0x00,0x00,0x00,0x2b,0x00,0x04,0x00,0x08,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,
|
||||
0x00,0x00,0x80,0x3f,0x19,0x00,0x09,0x00,0x0d,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1b,0x00,0x03,0x00,0x0e,0x00,0x00,0x00,
|
||||
0x0d,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x0e,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x0f,0x00,0x00,0x00,0x10,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x12,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x09,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x12,0x00,0x00,0x00,0x13,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x17,0x00,0x04,0x00,0x14,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x12,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x36,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xf8,0x00,0x02,0x00,0x06,0x00,0x00,0x00,
|
||||
0x08,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x3d,0x00,0x04,0x00,0x0e,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x10,0x00,0x00,0x00,
|
||||
0x3d,0x00,0x04,0x00,0x09,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x13,0x00,0x00,0x00,
|
||||
0x4f,0x00,0x07,0x00,0x14,0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x15,0x00,0x00,0x00,
|
||||
0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x57,0x00,0x05,0x00,
|
||||
0x09,0x00,0x00,0x00,0x17,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x16,0x00,0x00,0x00,
|
||||
0x51,0x00,0x05,0x00,0x08,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,0x17,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x50,0x00,0x07,0x00,0x09,0x00,0x00,0x00,0x1b,0x00,0x00,0x00,
|
||||
0x0c,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,
|
||||
0x3d,0x00,0x04,0x00,0x09,0x00,0x00,0x00,0x1d,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,
|
||||
0x85,0x00,0x05,0x00,0x09,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x1b,0x00,0x00,0x00,
|
||||
0x1d,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,0x0b,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||
0xfd,0x00,0x01,0x00,0x38,0x00,0x01,0x00,
|
||||
static const char _sfons_fs_source_wgsl[674] = {
|
||||
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
|
||||
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
|
||||
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
|
||||
0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
|
||||
0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,
|
||||
0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x33,0x32,
|
||||
0x29,0x20,0x76,0x61,0x72,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x74,0x65,0x78,0x74,
|
||||
0x75,0x72,0x65,0x5f,0x32,0x64,0x3c,0x66,0x33,0x32,0x3e,0x3b,0x0a,0x0a,0x40,0x67,
|
||||
0x72,0x6f,0x75,0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,
|
||||
0x28,0x34,0x38,0x29,0x20,0x76,0x61,0x72,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x73,
|
||||
0x61,0x6d,0x70,0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
|
||||
0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,
|
||||
0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,
|
||||
0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,
|
||||
0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,
|
||||
0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,
|
||||
0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,
|
||||
0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,
|
||||
0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x74,0x65,0x78,0x2c,0x20,0x73,
|
||||
0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x32,0x34,0x2e,0x78,
|
||||
0x2c,0x20,0x78,0x5f,0x32,0x34,0x2e,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,
|
||||
0x74,0x20,0x78,0x5f,0x33,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,
|
||||
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,
|
||||
0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x28,0x76,0x65,0x63,0x34,0x66,0x28,0x31,0x2e,
|
||||
0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x2c,0x20,
|
||||
0x78,0x5f,0x32,0x36,0x2e,0x78,0x29,0x20,0x2a,0x20,0x78,0x5f,0x33,0x32,0x29,0x3b,
|
||||
0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,
|
||||
0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,
|
||||
0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,
|
||||
0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,
|
||||
0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x66,0x72,0x61,0x67,0x6d,
|
||||
0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,
|
||||
0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,
|
||||
0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,
|
||||
0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x70,0x61,
|
||||
0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x29,0x20,0x2d,0x3e,0x20,
|
||||
0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x75,0x76,0x20,
|
||||
0x3d,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x63,0x6f,
|
||||
0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x70,0x61,0x72,0x61,
|
||||
0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,
|
||||
0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,
|
||||
0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,
|
||||
0x0a,0x00,
|
||||
};
|
||||
#elif defined(SOKOL_DUMMY_BACKEND)
|
||||
static const char* _sfons_vs_source_dummy = "";
|
||||
@ -1663,7 +1595,7 @@ static int _sfons_render_create(void* user_ptr, int width, int height) {
|
||||
shd_desc.fs.images[0].image_type = SG_IMAGETYPE_2D;
|
||||
shd_desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT;
|
||||
shd_desc.fs.samplers[0].used = true;
|
||||
shd_desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_SAMPLE;
|
||||
shd_desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING;
|
||||
shd_desc.fs.image_sampler_pairs[0].used = true;
|
||||
shd_desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp";
|
||||
shd_desc.fs.image_sampler_pairs[0].image_slot = 0;
|
||||
@ -1696,10 +1628,8 @@ static int _sfons_render_create(void* user_ptr, int width, int height) {
|
||||
shd_desc.vs.bytecode = SG_RANGE(_sfons_vs_bytecode_hlsl4);
|
||||
shd_desc.fs.bytecode = SG_RANGE(_sfons_fs_bytecode_hlsl4);
|
||||
#elif defined(SOKOL_WGPU)
|
||||
shd_desc.vs.byte_code = _sfons_vs_bytecode_wgpu;
|
||||
shd_desc.vs.byte_code_size = sizeof(_sfons_vs_bytecode_wgpu);
|
||||
shd_desc.fs.byte_code = _sfons_fs_bytecode_wgpu;
|
||||
shd_desc.fs.byte_code_size = sizeof(_sfons_fs_bytecode_wgpu);
|
||||
shd_desc.vs.source = _sfons_vs_source_wgsl;
|
||||
shd_desc.fs.source = _sfons_fs_source_wgsl;
|
||||
#else
|
||||
shd_desc.vs.source = _sfons_vs_source_dummy;
|
||||
shd_desc.fs.source = _sfons_fs_source_dummy;
|
||||
|
308
thirdparty/sokol/util/sokol_gl.h
vendored
308
thirdparty/sokol/util/sokol_gl.h
vendored
@ -991,7 +991,9 @@ inline sgl_pipeline sgl_context_make_pipeline(sgl_context ctx, const sg_pipeline
|
||||
out vec4 color;
|
||||
void main() {
|
||||
gl_Position = mvp * position;
|
||||
#ifndef SOKOL_WGSL
|
||||
gl_PointSize = psize;
|
||||
#endif
|
||||
uv = tm * vec4(texcoord0, 0.0, 1.0);
|
||||
color = color0;
|
||||
}
|
||||
@ -2078,191 +2080,123 @@ static const uint8_t _sgl_fs_bytecode_hlsl4[608] = {
|
||||
|
||||
};
|
||||
#elif defined(SOKOL_WGPU)
|
||||
static const uint8_t _sgl_vs_bytecode_wgpu[1968] = {
|
||||
0x03,0x02,0x23,0x07,0x00,0x00,0x01,0x00,0x08,0x00,0x08,0x00,0x35,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x11,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x0b,0x00,0x06,0x00,
|
||||
0x02,0x00,0x00,0x00,0x47,0x4c,0x53,0x4c,0x2e,0x73,0x74,0x64,0x2e,0x34,0x35,0x30,
|
||||
0x00,0x00,0x00,0x00,0x0e,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x0f,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,
|
||||
0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,0x21,0x00,0x00,0x00,
|
||||
0x25,0x00,0x00,0x00,0x2a,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x33,0x00,0x00,0x00,
|
||||
0x07,0x00,0x03,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x05,0x00,
|
||||
0x07,0x00,0x00,0x00,0x73,0x67,0x6c,0x2e,0x67,0x6c,0x73,0x6c,0x00,0x00,0x00,0x00,
|
||||
0x03,0x00,0x37,0x00,0x02,0x00,0x00,0x00,0xc2,0x01,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,
|
||||
0x73,0x73,0x65,0x64,0x20,0x63,0x6c,0x69,0x65,0x6e,0x74,0x20,0x76,0x75,0x6c,0x6b,
|
||||
0x61,0x6e,0x31,0x30,0x30,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,
|
||||
0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x63,0x6c,0x69,0x65,0x6e,
|
||||
0x74,0x20,0x6f,0x70,0x65,0x6e,0x67,0x6c,0x31,0x30,0x30,0x0a,0x2f,0x2f,0x20,0x4f,
|
||||
0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,
|
||||
0x20,0x74,0x61,0x72,0x67,0x65,0x74,0x2d,0x65,0x6e,0x76,0x20,0x76,0x75,0x6c,0x6b,
|
||||
0x61,0x6e,0x31,0x2e,0x30,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,
|
||||
0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x74,0x61,0x72,0x67,0x65,
|
||||
0x74,0x2d,0x65,0x6e,0x76,0x20,0x6f,0x70,0x65,0x6e,0x67,0x6c,0x0a,0x2f,0x2f,0x20,
|
||||
0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,
|
||||
0x64,0x20,0x65,0x6e,0x74,0x72,0x79,0x2d,0x70,0x6f,0x69,0x6e,0x74,0x20,0x6d,0x61,
|
||||
0x69,0x6e,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x0a,0x00,0x05,0x00,0x04,0x00,
|
||||
0x05,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,0x00,0x00,0x00,0x00,0x05,0x00,0x06,0x00,
|
||||
0x0d,0x00,0x00,0x00,0x67,0x6c,0x5f,0x50,0x65,0x72,0x56,0x65,0x72,0x74,0x65,0x78,
|
||||
0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x06,0x00,0x07,0x00,
|
||||
0x0d,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,
|
||||
0x53,0x69,0x7a,0x65,0x00,0x00,0x00,0x00,0x06,0x00,0x07,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0x67,0x6c,0x5f,0x43,0x6c,0x69,0x70,0x44,0x69,0x73,0x74,0x61,
|
||||
0x6e,0x63,0x65,0x00,0x06,0x00,0x07,0x00,0x0d,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
|
||||
0x67,0x6c,0x5f,0x43,0x75,0x6c,0x6c,0x44,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x00,
|
||||
0x05,0x00,0x03,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x05,0x00,
|
||||
0x13,0x00,0x00,0x00,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x00,0x00,0x00,
|
||||
0x06,0x00,0x04,0x00,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6d,0x76,0x70,0x00,
|
||||
0x06,0x00,0x04,0x00,0x13,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x74,0x6d,0x00,0x00,
|
||||
0x05,0x00,0x03,0x00,0x15,0x00,0x00,0x00,0x5f,0x32,0x31,0x00,0x05,0x00,0x05,0x00,
|
||||
0x1a,0x00,0x00,0x00,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x00,0x00,0x00,
|
||||
0x05,0x00,0x04,0x00,0x21,0x00,0x00,0x00,0x70,0x73,0x69,0x7a,0x65,0x00,0x00,0x00,
|
||||
0x05,0x00,0x03,0x00,0x25,0x00,0x00,0x00,0x75,0x76,0x00,0x00,0x05,0x00,0x05,0x00,
|
||||
0x2a,0x00,0x00,0x00,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x00,0x00,0x00,
|
||||
0x05,0x00,0x04,0x00,0x32,0x00,0x00,0x00,0x63,0x6f,0x6c,0x6f,0x72,0x00,0x00,0x00,
|
||||
0x05,0x00,0x04,0x00,0x33,0x00,0x00,0x00,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x00,0x00,
|
||||
0x48,0x00,0x05,0x00,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x0d,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x0b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x48,0x00,0x05,0x00,
|
||||
0x0d,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x47,0x00,0x03,0x00,0x0d,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x48,0x00,0x04,0x00,
|
||||
0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x48,0x00,0x05,0x00,
|
||||
0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x48,0x00,0x05,0x00,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,
|
||||
0x10,0x00,0x00,0x00,0x48,0x00,0x04,0x00,0x13,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x05,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x13,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x23,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x13,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x47,0x00,0x03,0x00,
|
||||
0x13,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x15,0x00,0x00,0x00,
|
||||
0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x15,0x00,0x00,0x00,
|
||||
0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x1a,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x21,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x25,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x2a,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x32,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x33,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x13,0x00,0x02,0x00,0x03,0x00,0x00,0x00,
|
||||
0x21,0x00,0x03,0x00,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x16,0x00,0x03,0x00,
|
||||
0x08,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x17,0x00,0x04,0x00,0x09,0x00,0x00,0x00,
|
||||
0x08,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x15,0x00,0x04,0x00,0x0a,0x00,0x00,0x00,
|
||||
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2b,0x00,0x04,0x00,0x0a,0x00,0x00,0x00,
|
||||
0x0b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1c,0x00,0x04,0x00,0x0c,0x00,0x00,0x00,
|
||||
0x08,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x1e,0x00,0x06,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x09,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x0e,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x0e,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
|
||||
0x15,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x2b,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x18,0x00,0x04,0x00,0x12,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x1e,0x00,0x04,0x00,0x13,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x14,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x13,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x14,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x16,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x19,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x09,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x19,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x1d,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x09,0x00,0x00,0x00,
|
||||
0x2b,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x20,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x23,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x1d,0x00,0x00,0x00,0x25,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
|
||||
0x17,0x00,0x04,0x00,0x28,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
|
||||
0x20,0x00,0x04,0x00,0x29,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x28,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x29,0x00,0x00,0x00,0x2a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x2b,0x00,0x04,0x00,0x08,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x2b,0x00,0x04,0x00,0x08,0x00,0x00,0x00,0x2d,0x00,0x00,0x00,0x00,0x00,0x80,0x3f,
|
||||
0x3b,0x00,0x04,0x00,0x1d,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
|
||||
0x3b,0x00,0x04,0x00,0x19,0x00,0x00,0x00,0x33,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x36,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x04,0x00,0x00,0x00,0xf8,0x00,0x02,0x00,0x06,0x00,0x00,0x00,0x08,0x00,0x04,0x00,
|
||||
0x07,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x05,0x00,
|
||||
0x16,0x00,0x00,0x00,0x17,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
|
||||
0x3d,0x00,0x04,0x00,0x12,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x17,0x00,0x00,0x00,
|
||||
0x3d,0x00,0x04,0x00,0x09,0x00,0x00,0x00,0x1b,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,
|
||||
0x91,0x00,0x05,0x00,0x09,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x18,0x00,0x00,0x00,
|
||||
0x1b,0x00,0x00,0x00,0x41,0x00,0x05,0x00,0x1d,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x0f,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x1c,0x00,0x00,0x00,0x08,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x13,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,0x08,0x00,0x00,0x00,0x22,0x00,0x00,0x00,
|
||||
0x21,0x00,0x00,0x00,0x41,0x00,0x05,0x00,0x23,0x00,0x00,0x00,0x24,0x00,0x00,0x00,
|
||||
0x0f,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,0x24,0x00,0x00,0x00,
|
||||
0x22,0x00,0x00,0x00,0x08,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x14,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x41,0x00,0x05,0x00,0x16,0x00,0x00,0x00,0x26,0x00,0x00,0x00,
|
||||
0x15,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,0x12,0x00,0x00,0x00,
|
||||
0x27,0x00,0x00,0x00,0x26,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,0x28,0x00,0x00,0x00,
|
||||
0x2b,0x00,0x00,0x00,0x2a,0x00,0x00,0x00,0x51,0x00,0x05,0x00,0x08,0x00,0x00,0x00,
|
||||
0x2e,0x00,0x00,0x00,0x2b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x51,0x00,0x05,0x00,
|
||||
0x08,0x00,0x00,0x00,0x2f,0x00,0x00,0x00,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x50,0x00,0x07,0x00,0x09,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x2e,0x00,0x00,0x00,
|
||||
0x2f,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x2d,0x00,0x00,0x00,0x91,0x00,0x05,0x00,
|
||||
0x09,0x00,0x00,0x00,0x31,0x00,0x00,0x00,0x27,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x3e,0x00,0x03,0x00,0x25,0x00,0x00,0x00,0x31,0x00,0x00,0x00,0x08,0x00,0x04,0x00,
|
||||
0x07,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,
|
||||
0x09,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0x33,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,
|
||||
0x32,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0xfd,0x00,0x01,0x00,0x38,0x00,0x01,0x00,
|
||||
static const char _sgl_vs_source_wgsl[1162] = {
|
||||
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
|
||||
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
|
||||
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
|
||||
0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,
|
||||
0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,
|
||||
0x20,0x6d,0x76,0x70,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,0x34,0x66,0x2c,0x0a,
|
||||
0x20,0x20,0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x36,0x34,0x29,
|
||||
0x20,0x2a,0x2f,0x0a,0x20,0x20,0x74,0x6d,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,
|
||||
0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29,
|
||||
0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x30,0x29,0x20,0x76,0x61,0x72,
|
||||
0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x31,0x39,0x20,0x3a,
|
||||
0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x0a,0x76,0x61,0x72,
|
||||
0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,
|
||||
0x6f,0x6e,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,
|
||||
0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,
|
||||
0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
|
||||
0x76,0x61,0x74,0x65,0x3e,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,
|
||||
0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,
|
||||
0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,
|
||||
0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,
|
||||
0x74,0x65,0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,
|
||||
0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,
|
||||
0x3e,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x0a,
|
||||
0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x67,0x6c,0x5f,
|
||||
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,
|
||||
0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,
|
||||
0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x20,0x3a,0x20,0x6d,0x61,
|
||||
0x74,0x34,0x78,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70,
|
||||
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x35,0x20,0x3a,0x20,0x76,
|
||||
0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,
|
||||
0x31,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
|
||||
0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,0x32,0x20,0x2a,0x20,0x78,0x5f,0x32,0x35,0x29,
|
||||
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x32,0x20,0x3a,0x20,0x6d,
|
||||
0x61,0x74,0x34,0x78,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x39,0x2e,0x74,0x6d,
|
||||
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x36,0x20,0x3a,0x20,0x76,
|
||||
0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,
|
||||
0x3b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x28,0x78,0x5f,0x33,0x32,0x20,0x2a,
|
||||
0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x33,0x36,0x2e,0x78,0x2c,0x20,0x78,
|
||||
0x5f,0x33,0x36,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,
|
||||
0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x35,0x20,
|
||||
0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,
|
||||
0x3b,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x78,0x5f,0x34,0x35,
|
||||
0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,
|
||||
0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,
|
||||
0x0a,0x20,0x20,0x40,0x62,0x75,0x69,0x6c,0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,
|
||||
0x74,0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,
|
||||
0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40,
|
||||
0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x75,0x76,
|
||||
0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c,
|
||||
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x0a,0x20,0x20,0x63,0x6f,0x6c,
|
||||
0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,
|
||||
0x0a,0x40,0x76,0x65,0x72,0x74,0x65,0x78,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,
|
||||
0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x70,0x6f,
|
||||
0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,
|
||||
0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,
|
||||
0x6e,0x28,0x31,0x29,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70,
|
||||
0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c,
|
||||
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x32,0x29,0x20,0x63,0x6f,0x6c,0x6f,0x72,
|
||||
0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,
|
||||
0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x33,0x29,0x20,0x70,0x73,
|
||||
0x69,0x7a,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x66,0x33,0x32,0x29,
|
||||
0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,
|
||||
0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x20,0x3d,0x20,0x70,0x6f,
|
||||
0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,
|
||||
0x20,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,0x20,0x74,0x65,
|
||||
0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,
|
||||
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,
|
||||
0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,
|
||||
0x3d,0x20,0x70,0x73,0x69,0x7a,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,
|
||||
0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,
|
||||
0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x67,0x6c,0x5f,
|
||||
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x75,0x76,0x2c,0x20,0x63,0x6f,
|
||||
0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||
};
|
||||
static const uint8_t _sgl_fs_bytecode_wgpu[936] = {
|
||||
0x03,0x02,0x23,0x07,0x00,0x00,0x01,0x00,0x08,0x00,0x08,0x00,0x1a,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x11,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x0b,0x00,0x06,0x00,
|
||||
0x02,0x00,0x00,0x00,0x47,0x4c,0x53,0x4c,0x2e,0x73,0x74,0x64,0x2e,0x34,0x35,0x30,
|
||||
0x00,0x00,0x00,0x00,0x0e,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x0f,0x00,0x08,0x00,0x04,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,
|
||||
0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x17,0x00,0x00,0x00,
|
||||
0x10,0x00,0x03,0x00,0x05,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x03,0x00,
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x05,0x00,0x07,0x00,0x00,0x00,
|
||||
0x73,0x67,0x6c,0x2e,0x67,0x6c,0x73,0x6c,0x00,0x00,0x00,0x00,0x03,0x00,0x37,0x00,
|
||||
0x02,0x00,0x00,0x00,0xc2,0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x2f,0x2f,0x20,0x4f,
|
||||
0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,
|
||||
0x20,0x63,0x6c,0x69,0x65,0x6e,0x74,0x20,0x76,0x75,0x6c,0x6b,0x61,0x6e,0x31,0x30,
|
||||
0x30,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,
|
||||
0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x63,0x6c,0x69,0x65,0x6e,0x74,0x20,0x6f,0x70,
|
||||
0x65,0x6e,0x67,0x6c,0x31,0x30,0x30,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,
|
||||
0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x74,0x61,0x72,
|
||||
0x67,0x65,0x74,0x2d,0x65,0x6e,0x76,0x20,0x76,0x75,0x6c,0x6b,0x61,0x6e,0x31,0x2e,
|
||||
0x30,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,
|
||||
0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x74,0x61,0x72,0x67,0x65,0x74,0x2d,0x65,0x6e,
|
||||
0x76,0x20,0x6f,0x70,0x65,0x6e,0x67,0x6c,0x0a,0x2f,0x2f,0x20,0x4f,0x70,0x4d,0x6f,
|
||||
0x64,0x75,0x6c,0x65,0x50,0x72,0x6f,0x63,0x65,0x73,0x73,0x65,0x64,0x20,0x65,0x6e,
|
||||
0x74,0x72,0x79,0x2d,0x70,0x6f,0x69,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x0a,0x23,
|
||||
0x6c,0x69,0x6e,0x65,0x20,0x31,0x0a,0x00,0x05,0x00,0x04,0x00,0x05,0x00,0x00,0x00,
|
||||
0x6d,0x61,0x69,0x6e,0x00,0x00,0x00,0x00,0x05,0x00,0x05,0x00,0x0b,0x00,0x00,0x00,
|
||||
0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x00,0x00,0x05,0x00,0x03,0x00,
|
||||
0x0f,0x00,0x00,0x00,0x74,0x65,0x78,0x00,0x05,0x00,0x03,0x00,0x12,0x00,0x00,0x00,
|
||||
0x75,0x76,0x00,0x00,0x05,0x00,0x04,0x00,0x17,0x00,0x00,0x00,0x63,0x6f,0x6c,0x6f,
|
||||
0x72,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x0b,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x0f,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x0f,0x00,0x00,0x00,0x22,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x0f,0x00,0x00,0x00,0x21,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x12,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x17,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x13,0x00,0x02,0x00,0x03,0x00,0x00,0x00,0x21,0x00,0x03,0x00,
|
||||
0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x16,0x00,0x03,0x00,0x08,0x00,0x00,0x00,
|
||||
0x20,0x00,0x00,0x00,0x17,0x00,0x04,0x00,0x09,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x04,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x0a,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
|
||||
0x09,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x0a,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,
|
||||
0x03,0x00,0x00,0x00,0x19,0x00,0x09,0x00,0x0c,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1b,0x00,0x03,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x0c,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x0d,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x0e,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x11,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x09,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x11,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x17,0x00,0x04,0x00,0x13,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x11,0x00,0x00,0x00,0x17,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x36,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xf8,0x00,0x02,0x00,0x06,0x00,0x00,0x00,
|
||||
0x08,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x3d,0x00,0x04,0x00,0x0d,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,
|
||||
0x3d,0x00,0x04,0x00,0x09,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x12,0x00,0x00,0x00,
|
||||
0x4f,0x00,0x07,0x00,0x13,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x14,0x00,0x00,0x00,
|
||||
0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x57,0x00,0x05,0x00,
|
||||
0x09,0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x15,0x00,0x00,0x00,
|
||||
0x3d,0x00,0x04,0x00,0x09,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x17,0x00,0x00,0x00,
|
||||
0x85,0x00,0x05,0x00,0x09,0x00,0x00,0x00,0x19,0x00,0x00,0x00,0x16,0x00,0x00,0x00,
|
||||
0x18,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,0x0b,0x00,0x00,0x00,0x19,0x00,0x00,0x00,
|
||||
0xfd,0x00,0x01,0x00,0x38,0x00,0x01,0x00,
|
||||
static const char _sgl_fs_source_wgsl[647] = {
|
||||
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
|
||||
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
|
||||
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
|
||||
0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
|
||||
0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,
|
||||
0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x33,0x32,
|
||||
0x29,0x20,0x76,0x61,0x72,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x74,0x65,0x78,0x74,
|
||||
0x75,0x72,0x65,0x5f,0x32,0x64,0x3c,0x66,0x33,0x32,0x3e,0x3b,0x0a,0x0a,0x40,0x67,
|
||||
0x72,0x6f,0x75,0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,
|
||||
0x28,0x34,0x38,0x29,0x20,0x76,0x61,0x72,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x73,
|
||||
0x61,0x6d,0x70,0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
|
||||
0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,
|
||||
0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,
|
||||
0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,
|
||||
0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,
|
||||
0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,
|
||||
0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,
|
||||
0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,
|
||||
0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x74,0x65,0x78,0x2c,0x20,0x73,
|
||||
0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x32,0x33,0x2e,0x78,
|
||||
0x2c,0x20,0x78,0x5f,0x32,0x33,0x2e,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,
|
||||
0x74,0x20,0x78,0x5f,0x32,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,
|
||||
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,
|
||||
0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,0x35,0x20,0x2a,0x20,0x78,
|
||||
0x5f,0x32,0x37,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,
|
||||
0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,
|
||||
0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,
|
||||
0x28,0x30,0x29,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
|
||||
0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,
|
||||
0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,
|
||||
0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x75,0x76,
|
||||
0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x20,
|
||||
0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x63,0x6f,0x6c,
|
||||
0x6f,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,
|
||||
0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,
|
||||
0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,
|
||||
0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,
|
||||
0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,
|
||||
0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,
|
||||
0x6e,0x5f,0x6f,0x75,0x74,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
|
||||
0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||
};
|
||||
#elif defined(SOKOL_DUMMY_BACKEND)
|
||||
static const char* _sgl_vs_source_dummy = "";
|
||||
@ -3344,7 +3278,7 @@ static void _sgl_setup_common(void) {
|
||||
shd_desc.fs.images[0].image_type = SG_IMAGETYPE_2D;
|
||||
shd_desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT;
|
||||
shd_desc.fs.samplers[0].used = true;
|
||||
shd_desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_SAMPLE;
|
||||
shd_desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING;
|
||||
shd_desc.fs.image_sampler_pairs[0].used = true;
|
||||
shd_desc.fs.image_sampler_pairs[0].image_slot = 0;
|
||||
shd_desc.fs.image_sampler_pairs[0].sampler_slot = 0;
|
||||
@ -3377,8 +3311,8 @@ static void _sgl_setup_common(void) {
|
||||
shd_desc.vs.bytecode = SG_RANGE(_sgl_vs_bytecode_hlsl4);
|
||||
shd_desc.fs.bytecode = SG_RANGE(_sgl_fs_bytecode_hlsl4);
|
||||
#elif defined(SOKOL_WGPU)
|
||||
shd_desc.vs.bytecode = SG_RANGE(_sgl_vs_bytecode_wgpu);
|
||||
shd_desc.fs.bytecode = SG_RANGE(_sgl_fs_bytecode_wgpu);
|
||||
shd_desc.vs.source = _sgl_vs_source_wgsl;
|
||||
shd_desc.fs.source = _sgl_fs_source_wgsl;
|
||||
#else
|
||||
shd_desc.vs.source = _sgl_vs_source_dummy;
|
||||
shd_desc.fs.source = _sgl_fs_source_dummy;
|
||||
|
@ -141,16 +141,18 @@ pub enum ImageSampleType as u32 {
|
||||
depth
|
||||
sint
|
||||
uint
|
||||
unfilterable_float
|
||||
_num
|
||||
_force_u32 = 0x7FFFFFFF
|
||||
_force_u32 = 0x7FFFFFFF
|
||||
}
|
||||
|
||||
pub enum SamplerType as u32 {
|
||||
_default
|
||||
sample
|
||||
compare
|
||||
filtering
|
||||
nonfiltering
|
||||
comparison
|
||||
_num
|
||||
_force_u32 = 0x7FFFFFFF
|
||||
_force_u32 = 0x7FFFFFFF
|
||||
}
|
||||
|
||||
pub enum CubeFace as u32 {
|
||||
|
@ -290,3 +290,29 @@ pub fn activate_context(ctx_id Context) {
|
||||
pub fn discard_context(ctx_id Context) {
|
||||
C.sg_discard_context(ctx_id)
|
||||
}
|
||||
|
||||
// frame stats
|
||||
|
||||
// enable_frame_stats enables the sokol frame statistics.
|
||||
[inline]
|
||||
pub fn enable_frame_stats() {
|
||||
C.sg_enable_frame_stats()
|
||||
}
|
||||
|
||||
// disable_frame_stats disables the sokol frame statistics.
|
||||
[inline]
|
||||
pub fn disable_frame_stats() {
|
||||
C.sg_disable_frame_stats()
|
||||
}
|
||||
|
||||
// frame_stats_enabled returns `true` if the sokol frame statistics is enabled.
|
||||
[inline]
|
||||
pub fn frame_stats_enabled() bool {
|
||||
return C.sg_frame_stats_enabled()
|
||||
}
|
||||
|
||||
// query_frame_stats returns the sokol frame statistics for the current frame.
|
||||
[inline]
|
||||
pub fn query_frame_stats() FrameStats {
|
||||
return C.sg_query_frame_stats()
|
||||
}
|
||||
|
@ -115,6 +115,12 @@ fn C.sg_fail_shader(shd C.sg_shader)
|
||||
fn C.sg_fail_pipeline(pip C.sg_pipeline)
|
||||
fn C.sg_fail_pass(pass C.sg_pass)
|
||||
|
||||
// frame stats
|
||||
fn C.sg_enable_frame_stats()
|
||||
fn C.sg_disable_frame_stats()
|
||||
fn C.sg_frame_stats_enabled() bool
|
||||
fn C.sg_query_frame_stats() C.sg_frame_stats
|
||||
|
||||
// rendering contexts (optional)
|
||||
fn C.sg_setup_context() C.sg_context
|
||||
fn C.sg_activate_context(ctx_id C.sg_context)
|
||||
|
@ -11,10 +11,11 @@ pub mut:
|
||||
pass_pool_size int
|
||||
context_pool_size int
|
||||
uniform_buffer_size int
|
||||
staging_buffer_size int
|
||||
max_commit_listeners int
|
||||
disable_validation bool // disable validation layer even in debug mode, useful for tests
|
||||
mtl_force_managed_storage_mode bool // for debugging: use Metal managed storage mode for resources even with UMA
|
||||
wgpu_disable_bindgroups_cache bool // set to true to disable the WebGPU backend BindGroup cache
|
||||
wgpu_bindgroups_cache_size int // number of slots in the WebGPU bindgroup cache (must be 2^N)
|
||||
//
|
||||
allocator C.sg_allocator
|
||||
logger C.sg_logger
|
||||
@ -364,6 +365,203 @@ pub struct C.sg_pass_info {
|
||||
|
||||
pub type PassInfo = C.sg_pass_info
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_gl {
|
||||
num_bind_buffer u32
|
||||
num_active_texture u32
|
||||
num_bind_texture u32
|
||||
num_bind_sampler u32
|
||||
num_use_program u32
|
||||
num_render_state u32
|
||||
num_vertex_attrib_pointer u32
|
||||
num_vertex_attrib_divisor u32
|
||||
num_enable_vertex_attrib_array u32
|
||||
num_disable_vertex_attrib_array u32
|
||||
num_uniform u32
|
||||
}
|
||||
|
||||
pub type FrameStatsGL = C.sg_frame_stats_gl
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_d3d11_pass {
|
||||
num_om_set_render_targets u32
|
||||
num_clear_render_target_view u32
|
||||
num_clear_depth_stencil_view u32
|
||||
num_resolve_subresource u32
|
||||
}
|
||||
|
||||
pub type FrameStatsD3D11Pass = C.sg_frame_stats_d3d11_pass
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_d3d11_pipeline {
|
||||
num_rs_set_state u32
|
||||
num_om_set_depth_stencil_state u32
|
||||
num_om_set_blend_state u32
|
||||
num_ia_set_primitive_topology u32
|
||||
num_ia_set_input_layout u32
|
||||
num_vs_set_shader u32
|
||||
num_vs_set_constant_buffers u32
|
||||
num_ps_set_shader u32
|
||||
num_ps_set_constant_buffers u32
|
||||
}
|
||||
|
||||
pub type FrameStatsD3D11Pipeline = C.sg_frame_stats_d3d11_pipeline
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_d3d11_bindings {
|
||||
num_ia_set_vertex_buffers u32
|
||||
num_ia_set_index_buffer u32
|
||||
num_vs_set_shader_resources u32
|
||||
num_ps_set_shader_resources u32
|
||||
num_vs_set_samplers u32
|
||||
num_ps_set_samplers u32
|
||||
}
|
||||
|
||||
pub type FrameStatsD3D11Bindings = C.sg_frame_stats_d3d11_bindings
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_d3d11_uniforms {
|
||||
num_update_subresource u32
|
||||
}
|
||||
|
||||
pub type FrameStatsD3D11Uniforms = C.sg_frame_stats_d3d11_uniforms
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_d3d11_draw {
|
||||
num_draw_indexed_instanced u32
|
||||
num_draw_indexed u32
|
||||
num_draw_instanced u32
|
||||
num_draw u32
|
||||
}
|
||||
|
||||
pub type FrameStatsD3D11Draw = C.sg_frame_stats_d3d11_draw
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_d3d11 {
|
||||
pass FrameStatsD3D11Pass
|
||||
pipeline FrameStatsD3D11Pipeline
|
||||
bindings FrameStatsD3D11Bindings
|
||||
uniforms FrameStatsD3D11Uniforms
|
||||
draw FrameStatsD3D11Draw
|
||||
num_map u32
|
||||
num_unmap u32
|
||||
}
|
||||
|
||||
pub type FrameStatsD3D11 = C.sg_frame_stats_d3d11
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_metal_idpool {
|
||||
num_added u32
|
||||
num_released u32
|
||||
num_garbage_collected u32
|
||||
}
|
||||
|
||||
pub type FrameStatsMetalIdpool = C.sg_frame_stats_metal_idpool
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_metal_pipeline {
|
||||
num_set_blend_color u32
|
||||
num_set_cull_mode u32
|
||||
num_set_front_facing_winding u32
|
||||
num_set_stencil_reference_value u32
|
||||
num_set_depth_bias u32
|
||||
num_set_render_pipeline_state u32
|
||||
num_set_depth_stencil_state u32
|
||||
}
|
||||
|
||||
pub type FrameStatsMetalPipeline = C.sg_frame_stats_metal_pipeline
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_metal_bindings {
|
||||
num_set_vertex_buffer u32
|
||||
num_set_vertex_texture u32
|
||||
num_set_vertex_sampler_state u32
|
||||
num_set_fragment_texture u32
|
||||
num_set_fragment_sampler_state u32
|
||||
}
|
||||
|
||||
pub type FrameStatsMetalBindings = C.sg_frame_stats_metal_bindings
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_metal_uniforms {
|
||||
num_set_vertex_buffer_offset u32
|
||||
num_set_fragment_buffer_offset u32
|
||||
}
|
||||
|
||||
pub type FrameStatsMetalUniforms = C.sg_frame_stats_metal_uniforms
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_metal {
|
||||
idpool FrameStatsMetalIdpool
|
||||
pipeline FrameStatsMetalPipeline
|
||||
bindings FrameStatsMetalBindings
|
||||
uniforms FrameStatsMetalUniforms
|
||||
}
|
||||
|
||||
pub type FrameStatsMetal = C.sg_frame_stats_metal
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_wgpu_uniforms {
|
||||
num_set_bindgroup u32
|
||||
size_write_buffer u32
|
||||
}
|
||||
|
||||
pub type FrameStatsWGPUUniforms = C.sg_frame_stats_wgpu_uniforms
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_wgpu_bindings {
|
||||
num_set_vertex_buffer u32
|
||||
num_skip_redundant_vertex_buffer u32
|
||||
num_set_index_buffer u32
|
||||
num_skip_redundant_index_buffer u32
|
||||
num_create_bindgroup u32
|
||||
num_discard_bindgroup u32
|
||||
num_set_bindgroup u32
|
||||
num_skip_redundant_bindgroup u32
|
||||
num_bindgroup_cache_hits u32
|
||||
num_bindgroup_cache_misses u32
|
||||
num_bindgroup_cache_collisions u32
|
||||
num_bindgroup_cache_hash_vs_key_mismatch u32
|
||||
}
|
||||
|
||||
pub type FrameStatsWGPUBindings = C.sg_frame_stats_wgpu_bindings
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats_wgpu {
|
||||
uniforms FrameStatsWGPUUniforms
|
||||
bindings FrameStatsWGPUBindings
|
||||
}
|
||||
|
||||
pub type FrameStatsWGPU = C.sg_frame_stats_wgpu
|
||||
|
||||
[typedef]
|
||||
pub struct C.sg_frame_stats {
|
||||
frame_index u32 // current frame counter, starts at 0
|
||||
//
|
||||
num_passes u32
|
||||
num_apply_viewport u32
|
||||
num_apply_scissor_rect u32
|
||||
num_apply_pipeline u32
|
||||
num_apply_bindings u32
|
||||
num_apply_uniforms u32
|
||||
num_draw u32
|
||||
num_update_buffer u32
|
||||
num_append_buffer u32
|
||||
num_update_image u32
|
||||
//
|
||||
size_apply_uniforms u32
|
||||
size_update_buffer u32
|
||||
size_append_buffer u32
|
||||
size_update_image u32
|
||||
//
|
||||
gl FrameStatsGL
|
||||
d3d11 FrameStatsD3D11
|
||||
metal FrameStatsMetal
|
||||
wgpu FrameStatsWGPU
|
||||
}
|
||||
|
||||
pub type FrameStats = C.sg_frame_stats
|
||||
|
||||
pub struct C.sg_pass_action {
|
||||
pub mut:
|
||||
colors [4]ColorAttachmentAction
|
||||
|
Loading…
x
Reference in New Issue
Block a user