mirror of
https://github.com/Ed94/VEFontCache-Odin.git
synced 2025-08-04 22:22:43 -07:00
update sokol & stb
This commit is contained in:
11
thirdparty/sokol/app/app.odin
vendored
11
thirdparty/sokol/app/app.odin
vendored
@@ -31,7 +31,8 @@ package sokol_app
|
|||||||
SOKOL_ASSERT(c) - your own assert macro (default: assert(c))
|
SOKOL_ASSERT(c) - your own assert macro (default: assert(c))
|
||||||
SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false))
|
SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false))
|
||||||
SOKOL_WIN32_FORCE_MAIN - define this on Win32 to add a main() entry point
|
SOKOL_WIN32_FORCE_MAIN - define this on Win32 to add a main() entry point
|
||||||
SOKOL_WIN32_FORCE_WINMAIN - define this on Win32 to add a WinMain() entry point (enabled by default unless SOKOL_WIN32_FORCE_MAIN or SOKOL_NO_ENTRY is defined)
|
SOKOL_WIN32_FORCE_WINMAIN - define this on Win32 to add a WinMain() entry point (enabled by default unless
|
||||||
|
SOKOL_WIN32_FORCE_MAIN or SOKOL_NO_ENTRY is defined)
|
||||||
SOKOL_NO_ENTRY - define this if sokol_app.h shouldn't "hijack" the main() function
|
SOKOL_NO_ENTRY - define this if sokol_app.h shouldn't "hijack" the main() function
|
||||||
SOKOL_APP_API_DECL - public function declaration prefix (default: extern)
|
SOKOL_APP_API_DECL - public function declaration prefix (default: extern)
|
||||||
SOKOL_API_DECL - same as SOKOL_APP_API_DECL
|
SOKOL_API_DECL - same as SOKOL_APP_API_DECL
|
||||||
@@ -83,6 +84,11 @@ package sokol_app
|
|||||||
|
|
||||||
On macOS and iOS, the implementation must be compiled as Objective-C.
|
On macOS and iOS, the implementation must be compiled as Objective-C.
|
||||||
|
|
||||||
|
On Emscripten:
|
||||||
|
- for WebGL2: add the linker option `-s USE_WEBGL2=1`
|
||||||
|
- for WebGPU: compile and link with `--use-port=emdawnwebgpu`
|
||||||
|
(for more exotic situations, read: https://dawn.googlesource.com/dawn/+/refs/heads/main/src/emdawnwebgpu/pkg/README.md)
|
||||||
|
|
||||||
FEATURE OVERVIEW
|
FEATURE OVERVIEW
|
||||||
================
|
================
|
||||||
sokol_app.h provides a minimalistic cross-platform API which
|
sokol_app.h provides a minimalistic cross-platform API which
|
||||||
@@ -1905,11 +1911,12 @@ Log_Item :: enum i32 {
|
|||||||
ANDROID_CREATE_THREAD_PIPE_FAILED,
|
ANDROID_CREATE_THREAD_PIPE_FAILED,
|
||||||
ANDROID_NATIVE_ACTIVITY_CREATE_SUCCESS,
|
ANDROID_NATIVE_ACTIVITY_CREATE_SUCCESS,
|
||||||
WGPU_SWAPCHAIN_CREATE_SURFACE_FAILED,
|
WGPU_SWAPCHAIN_CREATE_SURFACE_FAILED,
|
||||||
WGPU_SWAPCHAIN_CREATE_SWAPCHAIN_FAILED,
|
WGPU_SWAPCHAIN_SURFACE_GET_CAPABILITIES_FAILED,
|
||||||
WGPU_SWAPCHAIN_CREATE_DEPTH_STENCIL_TEXTURE_FAILED,
|
WGPU_SWAPCHAIN_CREATE_DEPTH_STENCIL_TEXTURE_FAILED,
|
||||||
WGPU_SWAPCHAIN_CREATE_DEPTH_STENCIL_VIEW_FAILED,
|
WGPU_SWAPCHAIN_CREATE_DEPTH_STENCIL_VIEW_FAILED,
|
||||||
WGPU_SWAPCHAIN_CREATE_MSAA_TEXTURE_FAILED,
|
WGPU_SWAPCHAIN_CREATE_MSAA_TEXTURE_FAILED,
|
||||||
WGPU_SWAPCHAIN_CREATE_MSAA_VIEW_FAILED,
|
WGPU_SWAPCHAIN_CREATE_MSAA_VIEW_FAILED,
|
||||||
|
WGPU_SWAPCHAIN_GETCURRENTTEXTURE_FAILED,
|
||||||
WGPU_REQUEST_DEVICE_STATUS_ERROR,
|
WGPU_REQUEST_DEVICE_STATUS_ERROR,
|
||||||
WGPU_REQUEST_DEVICE_STATUS_UNKNOWN,
|
WGPU_REQUEST_DEVICE_STATUS_UNKNOWN,
|
||||||
WGPU_REQUEST_ADAPTER_STATUS_UNAVAILABLE,
|
WGPU_REQUEST_ADAPTER_STATUS_UNAVAILABLE,
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
539
thirdparty/sokol/c/sokol_app.h
vendored
539
thirdparty/sokol/c/sokol_app.h
vendored
@@ -30,7 +30,8 @@
|
|||||||
SOKOL_ASSERT(c) - your own assert macro (default: assert(c))
|
SOKOL_ASSERT(c) - your own assert macro (default: assert(c))
|
||||||
SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false))
|
SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false))
|
||||||
SOKOL_WIN32_FORCE_MAIN - define this on Win32 to add a main() entry point
|
SOKOL_WIN32_FORCE_MAIN - define this on Win32 to add a main() entry point
|
||||||
SOKOL_WIN32_FORCE_WINMAIN - define this on Win32 to add a WinMain() entry point (enabled by default unless SOKOL_WIN32_FORCE_MAIN or SOKOL_NO_ENTRY is defined)
|
SOKOL_WIN32_FORCE_WINMAIN - define this on Win32 to add a WinMain() entry point (enabled by default unless
|
||||||
|
SOKOL_WIN32_FORCE_MAIN or SOKOL_NO_ENTRY is defined)
|
||||||
SOKOL_NO_ENTRY - define this if sokol_app.h shouldn't "hijack" the main() function
|
SOKOL_NO_ENTRY - define this if sokol_app.h shouldn't "hijack" the main() function
|
||||||
SOKOL_APP_API_DECL - public function declaration prefix (default: extern)
|
SOKOL_APP_API_DECL - public function declaration prefix (default: extern)
|
||||||
SOKOL_API_DECL - same as SOKOL_APP_API_DECL
|
SOKOL_API_DECL - same as SOKOL_APP_API_DECL
|
||||||
@@ -82,6 +83,11 @@
|
|||||||
|
|
||||||
On macOS and iOS, the implementation must be compiled as Objective-C.
|
On macOS and iOS, the implementation must be compiled as Objective-C.
|
||||||
|
|
||||||
|
On Emscripten:
|
||||||
|
- for WebGL2: add the linker option `-s USE_WEBGL2=1`
|
||||||
|
- for WebGPU: compile and link with `--use-port=emdawnwebgpu`
|
||||||
|
(for more exotic situations, read: https://dawn.googlesource.com/dawn/+/refs/heads/main/src/emdawnwebgpu/pkg/README.md)
|
||||||
|
|
||||||
FEATURE OVERVIEW
|
FEATURE OVERVIEW
|
||||||
================
|
================
|
||||||
sokol_app.h provides a minimalistic cross-platform API which
|
sokol_app.h provides a minimalistic cross-platform API which
|
||||||
@@ -1743,11 +1749,12 @@ typedef struct sapp_allocator {
|
|||||||
_SAPP_LOGITEM_XMACRO(ANDROID_CREATE_THREAD_PIPE_FAILED, "failed to create thread pipe") \
|
_SAPP_LOGITEM_XMACRO(ANDROID_CREATE_THREAD_PIPE_FAILED, "failed to create thread pipe") \
|
||||||
_SAPP_LOGITEM_XMACRO(ANDROID_NATIVE_ACTIVITY_CREATE_SUCCESS, "NativeActivity successfully created") \
|
_SAPP_LOGITEM_XMACRO(ANDROID_NATIVE_ACTIVITY_CREATE_SUCCESS, "NativeActivity successfully created") \
|
||||||
_SAPP_LOGITEM_XMACRO(WGPU_SWAPCHAIN_CREATE_SURFACE_FAILED, "wgpu: failed to create surface for swapchain") \
|
_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_SURFACE_GET_CAPABILITIES_FAILED, "wgpu: wgpuSurfaceGetCapabilities failed") \
|
||||||
_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_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_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_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_SWAPCHAIN_CREATE_MSAA_VIEW_FAILED, "wgpu: failed to create view object for swapchain msaa texture") \
|
||||||
|
_SAPP_LOGITEM_XMACRO(WGPU_SWAPCHAIN_GETCURRENTTEXTURE_FAILED, "wgpu: wgpuSurfaceGetCurrentTexture() failed") \
|
||||||
_SAPP_LOGITEM_XMACRO(WGPU_REQUEST_DEVICE_STATUS_ERROR, "wgpu: requesting device failed with status 'error'") \
|
_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_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_UNAVAILABLE, "wgpu: requesting adapter failed with 'unavailable'") \
|
||||||
@@ -2162,6 +2169,10 @@ inline void sapp_run(const sapp_desc& desc) { return sapp_run(&desc); }
|
|||||||
#define _SOKOL_UNUSED(x) (void)(x)
|
#define _SOKOL_UNUSED(x) (void)(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(SOKOL_WGPU)
|
||||||
|
#include <webgpu/webgpu.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_SAPP_APPLE)
|
#if defined(_SAPP_APPLE)
|
||||||
#if defined(SOKOL_METAL)
|
#if defined(SOKOL_METAL)
|
||||||
#import <Metal/Metal.h>
|
#import <Metal/Metal.h>
|
||||||
@@ -2185,9 +2196,6 @@ inline void sapp_run(const sapp_desc& desc) { return sapp_run(&desc); }
|
|||||||
#include <AvailabilityMacros.h>
|
#include <AvailabilityMacros.h>
|
||||||
#include <mach/mach_time.h>
|
#include <mach/mach_time.h>
|
||||||
#elif defined(_SAPP_EMSCRIPTEN)
|
#elif defined(_SAPP_EMSCRIPTEN)
|
||||||
#if defined(SOKOL_WGPU)
|
|
||||||
#include <webgpu/webgpu.h>
|
|
||||||
#endif
|
|
||||||
#if defined(SOKOL_GLES3)
|
#if defined(SOKOL_GLES3)
|
||||||
#include <GLES3/gl3.h>
|
#include <GLES3/gl3.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -2515,6 +2523,22 @@ _SOKOL_PRIVATE double _sapp_timing_get_avg(_sapp_timing_t* t) {
|
|||||||
// ███████ ██ ██ ██ ██████ ██████ ██ ███████
|
// ███████ ██ ██ ██ ██████ ██████ ██ ███████
|
||||||
//
|
//
|
||||||
// >> structs
|
// >> structs
|
||||||
|
#if defined(SOKOL_WGPU)
|
||||||
|
typedef struct {
|
||||||
|
WGPUInstance instance;
|
||||||
|
WGPUAdapter adapter;
|
||||||
|
WGPUDevice device;
|
||||||
|
WGPUSurface surface;
|
||||||
|
WGPUTextureFormat render_format;
|
||||||
|
WGPUTexture msaa_tex;
|
||||||
|
WGPUTextureView msaa_view;
|
||||||
|
WGPUTexture depth_stencil_tex;
|
||||||
|
WGPUTextureView depth_stencil_view;
|
||||||
|
WGPUTextureView swapchain_view;
|
||||||
|
bool async_init_done;
|
||||||
|
} _sapp_wgpu_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_SAPP_MACOS)
|
#if defined(_SAPP_MACOS)
|
||||||
@interface _sapp_macos_app_delegate : NSObject<NSApplicationDelegate>
|
@interface _sapp_macos_app_delegate : NSObject<NSApplicationDelegate>
|
||||||
@end
|
@end
|
||||||
@@ -2584,23 +2608,6 @@ typedef struct {
|
|||||||
|
|
||||||
#if defined(_SAPP_EMSCRIPTEN)
|
#if defined(_SAPP_EMSCRIPTEN)
|
||||||
|
|
||||||
#if defined(SOKOL_WGPU)
|
|
||||||
typedef struct {
|
|
||||||
WGPUInstance instance;
|
|
||||||
WGPUAdapter adapter;
|
|
||||||
WGPUDevice device;
|
|
||||||
WGPUTextureFormat render_format;
|
|
||||||
WGPUSurface surface;
|
|
||||||
WGPUSwapChain swapchain;
|
|
||||||
WGPUTexture msaa_tex;
|
|
||||||
WGPUTextureView msaa_view;
|
|
||||||
WGPUTexture depth_stencil_tex;
|
|
||||||
WGPUTextureView depth_stencil_view;
|
|
||||||
WGPUTextureView swapchain_view;
|
|
||||||
bool async_init_done;
|
|
||||||
} _sapp_wgpu_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool mouse_lock_requested;
|
bool mouse_lock_requested;
|
||||||
uint16_t mouse_buttons;
|
uint16_t mouse_buttons;
|
||||||
@@ -3005,15 +3012,15 @@ typedef struct {
|
|||||||
_sapp_drop_t drop;
|
_sapp_drop_t drop;
|
||||||
sapp_icon_desc default_icon_desc;
|
sapp_icon_desc default_icon_desc;
|
||||||
uint32_t* default_icon_pixels;
|
uint32_t* default_icon_pixels;
|
||||||
|
#if defined(SOKOL_WGPU)
|
||||||
|
_sapp_wgpu_t wgpu;
|
||||||
|
#endif
|
||||||
#if defined(_SAPP_MACOS)
|
#if defined(_SAPP_MACOS)
|
||||||
_sapp_macos_t macos;
|
_sapp_macos_t macos;
|
||||||
#elif defined(_SAPP_IOS)
|
#elif defined(_SAPP_IOS)
|
||||||
_sapp_ios_t ios;
|
_sapp_ios_t ios;
|
||||||
#elif defined(_SAPP_EMSCRIPTEN)
|
#elif defined(_SAPP_EMSCRIPTEN)
|
||||||
_sapp_emsc_t emsc;
|
_sapp_emsc_t emsc;
|
||||||
#if defined(SOKOL_WGPU)
|
|
||||||
_sapp_wgpu_t wgpu;
|
|
||||||
#endif
|
|
||||||
#elif defined(_SAPP_WIN32)
|
#elif defined(_SAPP_WIN32)
|
||||||
_sapp_win32_t win32;
|
_sapp_win32_t win32;
|
||||||
#if defined(SOKOL_D3D11)
|
#if defined(SOKOL_D3D11)
|
||||||
@@ -3512,6 +3519,273 @@ _SOKOL_PRIVATE void _sapp_setup_default_icon(void) {
|
|||||||
SOKOL_ASSERT(dst == dst_end);
|
SOKOL_ASSERT(dst == dst_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ██ ██ ██████ ██████ ██ ██
|
||||||
|
// ██ ██ ██ ██ ██ ██ ██
|
||||||
|
// ██ █ ██ ██ ███ ██████ ██ ██
|
||||||
|
// ██ ███ ██ ██ ██ ██ ██ ██
|
||||||
|
// ███ ███ ██████ ██ ██████
|
||||||
|
//
|
||||||
|
// >>wgpu
|
||||||
|
#if defined(SOKOL_WGPU)
|
||||||
|
|
||||||
|
_SOKOL_PRIVATE WGPUStringView _sapp_wgpu_stringview(const char* str) {
|
||||||
|
WGPUStringView res;
|
||||||
|
if (str) {
|
||||||
|
res.data = str;
|
||||||
|
res.length = strlen(str);
|
||||||
|
} else {
|
||||||
|
res.data = 0;
|
||||||
|
res.length = 0;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
_SOKOL_PRIVATE void _sapp_wgpu_create_swapchain(bool called_from_resize) {
|
||||||
|
SOKOL_ASSERT(_sapp.wgpu.instance);
|
||||||
|
SOKOL_ASSERT(_sapp.wgpu.device);
|
||||||
|
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);
|
||||||
|
|
||||||
|
if (!called_from_resize) {
|
||||||
|
SOKOL_ASSERT(0 == _sapp.wgpu.surface);
|
||||||
|
WGPUSurfaceDescriptor surf_desc;
|
||||||
|
_sapp_clear(&surf_desc, sizeof(surf_desc));
|
||||||
|
#if defined (_SAPP_EMSCRIPTEN)
|
||||||
|
WGPUEmscriptenSurfaceSourceCanvasHTMLSelector html_canvas_desc;
|
||||||
|
_sapp_clear(&html_canvas_desc, sizeof(html_canvas_desc));
|
||||||
|
html_canvas_desc.chain.sType = WGPUSType_EmscriptenSurfaceSourceCanvasHTMLSelector;
|
||||||
|
html_canvas_desc.selector = _sapp_wgpu_stringview(_sapp.html5_canvas_selector);
|
||||||
|
surf_desc.nextInChain = &html_canvas_desc.chain;
|
||||||
|
#else
|
||||||
|
#error "Unsupported platform for SOKOL_WGPU"
|
||||||
|
#endif
|
||||||
|
_sapp.wgpu.surface = wgpuInstanceCreateSurface(_sapp.wgpu.instance, &surf_desc);
|
||||||
|
if (0 == _sapp.wgpu.surface) {
|
||||||
|
_SAPP_PANIC(WGPU_SWAPCHAIN_CREATE_SURFACE_FAILED);
|
||||||
|
}
|
||||||
|
WGPUSurfaceCapabilities surf_caps;
|
||||||
|
_sapp_clear(&surf_caps, sizeof(surf_caps));
|
||||||
|
WGPUStatus caps_status = wgpuSurfaceGetCapabilities(_sapp.wgpu.surface, _sapp.wgpu.adapter, &surf_caps);
|
||||||
|
if (caps_status != WGPUStatus_Success) {
|
||||||
|
_SAPP_PANIC(WGPU_SWAPCHAIN_SURFACE_GET_CAPABILITIES_FAILED);
|
||||||
|
}
|
||||||
|
_sapp.wgpu.render_format = surf_caps.formats[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
SOKOL_ASSERT(_sapp.wgpu.surface);
|
||||||
|
WGPUSurfaceConfiguration surf_conf;
|
||||||
|
_sapp_clear(&surf_conf, sizeof(surf_conf));
|
||||||
|
surf_conf.device = _sapp.wgpu.device;
|
||||||
|
surf_conf.format = _sapp.wgpu.render_format;
|
||||||
|
surf_conf.usage = WGPUTextureUsage_RenderAttachment;
|
||||||
|
surf_conf.width = (uint32_t)_sapp.framebuffer_width;
|
||||||
|
surf_conf.height = (uint32_t)_sapp.framebuffer_height;
|
||||||
|
surf_conf.alphaMode = WGPUCompositeAlphaMode_Opaque;
|
||||||
|
#if defined(_SAPP_EMSCRIPTEN)
|
||||||
|
// FIXME: make this further configurable?
|
||||||
|
if (_sapp.desc.html5_premultiplied_alpha) {
|
||||||
|
surf_conf.alphaMode = WGPUCompositeAlphaMode_Premultiplied;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
surf_conf.presentMode = WGPUPresentMode_Fifo;
|
||||||
|
wgpuSurfaceConfigure(_sapp.wgpu.surface, &surf_conf);
|
||||||
|
|
||||||
|
WGPUTextureDescriptor ds_desc;
|
||||||
|
_sapp_clear(&ds_desc, sizeof(ds_desc));
|
||||||
|
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.depthOrArrayLayers = 1;
|
||||||
|
ds_desc.format = WGPUTextureFormat_Depth32FloatStencil8;
|
||||||
|
ds_desc.mipLevelCount = 1;
|
||||||
|
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_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.depthOrArrayLayers = 1;
|
||||||
|
msaa_desc.format = _sapp.wgpu.render_format;
|
||||||
|
msaa_desc.mipLevelCount = 1;
|
||||||
|
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_wgpu_discard_swapchain(bool called_from_resize) {
|
||||||
|
if (_sapp.wgpu.msaa_view) {
|
||||||
|
wgpuTextureViewRelease(_sapp.wgpu.msaa_view);
|
||||||
|
_sapp.wgpu.msaa_view = 0;
|
||||||
|
}
|
||||||
|
if (_sapp.wgpu.msaa_tex) {
|
||||||
|
wgpuTextureRelease(_sapp.wgpu.msaa_tex);
|
||||||
|
_sapp.wgpu.msaa_tex = 0;
|
||||||
|
}
|
||||||
|
if (_sapp.wgpu.depth_stencil_view) {
|
||||||
|
wgpuTextureViewRelease(_sapp.wgpu.depth_stencil_view);
|
||||||
|
_sapp.wgpu.depth_stencil_view = 0;
|
||||||
|
}
|
||||||
|
if (_sapp.wgpu.depth_stencil_tex) {
|
||||||
|
wgpuTextureRelease(_sapp.wgpu.depth_stencil_tex);
|
||||||
|
_sapp.wgpu.depth_stencil_tex = 0;
|
||||||
|
}
|
||||||
|
if (!called_from_resize) {
|
||||||
|
if (_sapp.wgpu.surface) {
|
||||||
|
wgpuSurfaceRelease(_sapp.wgpu.surface);
|
||||||
|
_sapp.wgpu.surface = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_SOKOL_PRIVATE WGPUTextureView _sapp_wgpu_swapchain_next(void) {
|
||||||
|
WGPUSurfaceTexture surf_tex;
|
||||||
|
_sapp_clear(&surf_tex, sizeof(surf_tex));
|
||||||
|
wgpuSurfaceGetCurrentTexture(_sapp.wgpu.surface, &surf_tex);
|
||||||
|
switch (surf_tex.status) {
|
||||||
|
case WGPUSurfaceGetCurrentTextureStatus_SuccessOptimal:
|
||||||
|
case WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal:
|
||||||
|
// all ok
|
||||||
|
break;
|
||||||
|
case WGPUSurfaceGetCurrentTextureStatus_Timeout:
|
||||||
|
case WGPUSurfaceGetCurrentTextureStatus_Outdated:
|
||||||
|
case WGPUSurfaceGetCurrentTextureStatus_Lost:
|
||||||
|
// skip this frame and reconfigure surface
|
||||||
|
if (surf_tex.texture) {
|
||||||
|
wgpuTextureRelease(surf_tex.texture);
|
||||||
|
}
|
||||||
|
_sapp_wgpu_discard_swapchain(false);
|
||||||
|
_sapp_wgpu_create_swapchain(false);
|
||||||
|
return 0;
|
||||||
|
case WGPUSurfaceGetCurrentTextureStatus_Error:
|
||||||
|
default:
|
||||||
|
_SAPP_PANIC(WGPU_SWAPCHAIN_GETCURRENTTEXTURE_FAILED);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return wgpuTextureCreateView(surf_tex.texture, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
_SOKOL_PRIVATE void _sapp_wgpu_size_changed(void) {
|
||||||
|
if (_sapp.wgpu.surface) {
|
||||||
|
_sapp_wgpu_discard_swapchain(true);
|
||||||
|
_sapp_wgpu_create_swapchain(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_SOKOL_PRIVATE void _sapp_wgpu_request_device_cb(WGPURequestDeviceStatus status, WGPUDevice device, WGPUStringView msg, void* userdata1, void* userdata2) {
|
||||||
|
_SOKOL_UNUSED(msg);
|
||||||
|
_SOKOL_UNUSED(userdata1);
|
||||||
|
_SOKOL_UNUSED(userdata2);
|
||||||
|
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_wgpu_create_swapchain(false);
|
||||||
|
_sapp.wgpu.async_init_done = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
_SOKOL_PRIVATE void _sapp_wgpu_request_adapter_cb(WGPURequestAdapterStatus status, WGPUAdapter adapter, WGPUStringView msg, void* userdata1, void* userdata2) {
|
||||||
|
_SOKOL_UNUSED(msg);
|
||||||
|
_SOKOL_UNUSED(userdata1);
|
||||||
|
_SOKOL_UNUSED(userdata2);
|
||||||
|
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;
|
||||||
|
#define _SAPP_WGPU_MAX_REQUESTED_FEATURES (8)
|
||||||
|
WGPUFeatureName requiredFeatures[_SAPP_WGPU_MAX_REQUESTED_FEATURES] = {
|
||||||
|
WGPUFeatureName_Depth32FloatStencil8,
|
||||||
|
};
|
||||||
|
// check for optional features we're interested in
|
||||||
|
if (wgpuAdapterHasFeature(adapter, WGPUFeatureName_TextureCompressionBC)) {
|
||||||
|
SOKOL_ASSERT(cur_feature_index < _SAPP_WGPU_MAX_REQUESTED_FEATURES);
|
||||||
|
requiredFeatures[cur_feature_index++] = WGPUFeatureName_TextureCompressionBC;
|
||||||
|
}
|
||||||
|
if (wgpuAdapterHasFeature(adapter, WGPUFeatureName_TextureCompressionETC2)) {
|
||||||
|
SOKOL_ASSERT(cur_feature_index < _SAPP_WGPU_MAX_REQUESTED_FEATURES);
|
||||||
|
requiredFeatures[cur_feature_index++] = WGPUFeatureName_TextureCompressionETC2;
|
||||||
|
}
|
||||||
|
if (wgpuAdapterHasFeature(adapter, WGPUFeatureName_TextureCompressionASTC)) {
|
||||||
|
SOKOL_ASSERT(cur_feature_index < _SAPP_WGPU_MAX_REQUESTED_FEATURES);
|
||||||
|
requiredFeatures[cur_feature_index++] = WGPUFeatureName_TextureCompressionASTC;
|
||||||
|
}
|
||||||
|
if (wgpuAdapterHasFeature(adapter, WGPUFeatureName_Float32Filterable)) {
|
||||||
|
SOKOL_ASSERT(cur_feature_index < _SAPP_WGPU_MAX_REQUESTED_FEATURES);
|
||||||
|
requiredFeatures[cur_feature_index++] = WGPUFeatureName_Float32Filterable;
|
||||||
|
}
|
||||||
|
#undef _SAPP_WGPU_MAX_REQUESTED_FEATURES
|
||||||
|
|
||||||
|
WGPURequestDeviceCallbackInfo cb_info;
|
||||||
|
_sapp_clear(&cb_info, sizeof(cb_info));
|
||||||
|
cb_info.mode = WGPUCallbackMode_AllowProcessEvents;
|
||||||
|
cb_info.callback = _sapp_wgpu_request_device_cb;
|
||||||
|
|
||||||
|
WGPUDeviceDescriptor dev_desc;
|
||||||
|
_sapp_clear(&dev_desc, sizeof(dev_desc));
|
||||||
|
dev_desc.requiredFeatureCount = cur_feature_index;
|
||||||
|
dev_desc.requiredFeatures = requiredFeatures,
|
||||||
|
wgpuAdapterRequestDevice(adapter, &dev_desc, cb_info);
|
||||||
|
}
|
||||||
|
|
||||||
|
_SOKOL_PRIVATE void _sapp_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?
|
||||||
|
WGPURequestAdapterCallbackInfo cb_info;
|
||||||
|
_sapp_clear(&cb_info, sizeof(cb_info));
|
||||||
|
cb_info.mode = WGPUCallbackMode_AllowProcessEvents;
|
||||||
|
cb_info.callback = _sapp_wgpu_request_adapter_cb;
|
||||||
|
wgpuInstanceRequestAdapter(_sapp.wgpu.instance, 0, cb_info);
|
||||||
|
}
|
||||||
|
|
||||||
|
_SOKOL_PRIVATE void _sapp_wgpu_frame(void) {
|
||||||
|
wgpuInstanceProcessEvents(_sapp.wgpu.instance);
|
||||||
|
if (_sapp.wgpu.async_init_done) {
|
||||||
|
_sapp.wgpu.swapchain_view = _sapp_wgpu_swapchain_next();
|
||||||
|
_sapp_frame();
|
||||||
|
wgpuTextureViewRelease(_sapp.wgpu.swapchain_view);
|
||||||
|
_sapp.wgpu.swapchain_view = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // SOKOL_WGPU
|
||||||
|
|
||||||
// █████ ██████ ██████ ██ ███████
|
// █████ ██████ ██████ ██ ███████
|
||||||
// ██ ██ ██ ██ ██ ██ ██ ██
|
// ██ ██ ██ ██ ██ ██ ██ ██
|
||||||
// ███████ ██████ ██████ ██ █████
|
// ███████ ██████ ██████ ██ █████
|
||||||
@@ -5325,10 +5599,6 @@ _SOKOL_PRIVATE uint32_t _sapp_emsc_touch_event_mods(const EmscriptenTouchEvent*
|
|||||||
return m;
|
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_PRIVATE EM_BOOL _sapp_emsc_size_changed(int event_type, const EmscriptenUiEvent* ui_event, void* user_data) {
|
||||||
_SOKOL_UNUSED(event_type);
|
_SOKOL_UNUSED(event_type);
|
||||||
_SOKOL_UNUSED(user_data);
|
_SOKOL_UNUSED(user_data);
|
||||||
@@ -5375,7 +5645,7 @@ _SOKOL_PRIVATE EM_BOOL _sapp_emsc_size_changed(int event_type, const EmscriptenU
|
|||||||
emscripten_set_canvas_element_size(_sapp.html5_canvas_selector, _sapp.framebuffer_width, _sapp.framebuffer_height);
|
emscripten_set_canvas_element_size(_sapp.html5_canvas_selector, _sapp.framebuffer_width, _sapp.framebuffer_height);
|
||||||
#if defined(SOKOL_WGPU)
|
#if defined(SOKOL_WGPU)
|
||||||
// on WebGPU: recreate size-dependent rendering surfaces
|
// on WebGPU: recreate size-dependent rendering surfaces
|
||||||
_sapp_emsc_wgpu_size_changed();
|
_sapp_wgpu_size_changed();
|
||||||
#endif
|
#endif
|
||||||
if (_sapp_events_enabled()) {
|
if (_sapp_events_enabled()) {
|
||||||
_sapp_init_event(SAPP_EVENTTYPE_RESIZED);
|
_sapp_init_event(SAPP_EVENTTYPE_RESIZED);
|
||||||
@@ -5778,198 +6048,6 @@ _SOKOL_PRIVATE void _sapp_emsc_webgl_init(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SOKOL_WGPU)
|
|
||||||
|
|
||||||
_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);
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
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_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.depthOrArrayLayers = 1;
|
|
||||||
ds_desc.format = WGPUTextureFormat_Depth32FloatStencil8;
|
|
||||||
ds_desc.mipLevelCount = 1;
|
|
||||||
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_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.depthOrArrayLayers = 1;
|
|
||||||
msaa_desc.format = _sapp.wgpu.render_format;
|
|
||||||
msaa_desc.mipLevelCount = 1;
|
|
||||||
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_discard_swapchain(void) {
|
|
||||||
if (_sapp.wgpu.msaa_view) {
|
|
||||||
wgpuTextureViewRelease(_sapp.wgpu.msaa_view);
|
|
||||||
_sapp.wgpu.msaa_view = 0;
|
|
||||||
}
|
|
||||||
if (_sapp.wgpu.msaa_tex) {
|
|
||||||
wgpuTextureRelease(_sapp.wgpu.msaa_tex);
|
|
||||||
_sapp.wgpu.msaa_tex = 0;
|
|
||||||
}
|
|
||||||
if (_sapp.wgpu.depth_stencil_view) {
|
|
||||||
wgpuTextureViewRelease(_sapp.wgpu.depth_stencil_view);
|
|
||||||
_sapp.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_size_changed(void) {
|
|
||||||
_sapp_emsc_wgpu_discard_swapchain();
|
|
||||||
_sapp_emsc_wgpu_create_swapchain();
|
|
||||||
}
|
|
||||||
|
|
||||||
_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;
|
|
||||||
#define _SAPP_WGPU_MAX_REQUESTED_FEATURES (8)
|
|
||||||
WGPUFeatureName requiredFeatures[_SAPP_WGPU_MAX_REQUESTED_FEATURES] = {
|
|
||||||
WGPUFeatureName_Depth32FloatStencil8,
|
|
||||||
};
|
|
||||||
// check for optional features we're interested in
|
|
||||||
if (wgpuAdapterHasFeature(adapter, WGPUFeatureName_TextureCompressionBC)) {
|
|
||||||
SOKOL_ASSERT(cur_feature_index < _SAPP_WGPU_MAX_REQUESTED_FEATURES);
|
|
||||||
requiredFeatures[cur_feature_index++] = WGPUFeatureName_TextureCompressionBC;
|
|
||||||
}
|
|
||||||
if (wgpuAdapterHasFeature(adapter, WGPUFeatureName_TextureCompressionETC2)) {
|
|
||||||
SOKOL_ASSERT(cur_feature_index < _SAPP_WGPU_MAX_REQUESTED_FEATURES);
|
|
||||||
requiredFeatures[cur_feature_index++] = WGPUFeatureName_TextureCompressionETC2;
|
|
||||||
}
|
|
||||||
if (wgpuAdapterHasFeature(adapter, WGPUFeatureName_TextureCompressionASTC)) {
|
|
||||||
SOKOL_ASSERT(cur_feature_index < _SAPP_WGPU_MAX_REQUESTED_FEATURES);
|
|
||||||
requiredFeatures[cur_feature_index++] = WGPUFeatureName_TextureCompressionASTC;
|
|
||||||
}
|
|
||||||
if (wgpuAdapterHasFeature(adapter, WGPUFeatureName_Float32Filterable)) {
|
|
||||||
SOKOL_ASSERT(cur_feature_index < _SAPP_WGPU_MAX_REQUESTED_FEATURES);
|
|
||||||
requiredFeatures[cur_feature_index++] = WGPUFeatureName_Float32Filterable;
|
|
||||||
}
|
|
||||||
#undef _SAPP_WGPU_MAX_REQUESTED_FEATURES
|
|
||||||
|
|
||||||
WGPUDeviceDescriptor dev_desc;
|
|
||||||
_sapp_clear(&dev_desc, sizeof(dev_desc));
|
|
||||||
dev_desc.requiredFeatureCount = 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) {
|
_SOKOL_PRIVATE void _sapp_emsc_register_eventhandlers(void) {
|
||||||
// NOTE: HTML canvas doesn't receive input focus, this is why key event handlers are added
|
// NOTE: HTML canvas doesn't receive input focus, this is why key event handlers are added
|
||||||
// to the window object (this could be worked around by adding a "tab index" to the
|
// to the window object (this could be worked around by adding a "tab index" to the
|
||||||
@@ -6043,7 +6121,7 @@ _SOKOL_PRIVATE EM_BOOL _sapp_emsc_frame_animation_loop(double time, void* userDa
|
|||||||
_sapp_timing_external(&_sapp.timing, time / 1000.0);
|
_sapp_timing_external(&_sapp.timing, time / 1000.0);
|
||||||
|
|
||||||
#if defined(SOKOL_WGPU)
|
#if defined(SOKOL_WGPU)
|
||||||
_sapp_emsc_wgpu_frame();
|
_sapp_wgpu_frame();
|
||||||
#else
|
#else
|
||||||
_sapp_frame();
|
_sapp_frame();
|
||||||
#endif
|
#endif
|
||||||
@@ -6058,6 +6136,9 @@ _SOKOL_PRIVATE EM_BOOL _sapp_emsc_frame_animation_loop(double time, void* userDa
|
|||||||
}
|
}
|
||||||
if (_sapp.quit_ordered) {
|
if (_sapp.quit_ordered) {
|
||||||
_sapp_emsc_unregister_eventhandlers();
|
_sapp_emsc_unregister_eventhandlers();
|
||||||
|
#if defined(SOKOL_WGPU)
|
||||||
|
_sapp_wgpu_discard_swapchain(false);
|
||||||
|
#endif
|
||||||
_sapp_call_cleanup();
|
_sapp_call_cleanup();
|
||||||
_sapp_discard_state();
|
_sapp_discard_state();
|
||||||
return EM_FALSE;
|
return EM_FALSE;
|
||||||
@@ -6096,7 +6177,7 @@ _SOKOL_PRIVATE void _sapp_emsc_run(const sapp_desc* desc) {
|
|||||||
#if defined(SOKOL_GLES3)
|
#if defined(SOKOL_GLES3)
|
||||||
_sapp_emsc_webgl_init();
|
_sapp_emsc_webgl_init();
|
||||||
#elif defined(SOKOL_WGPU)
|
#elif defined(SOKOL_WGPU)
|
||||||
_sapp_emsc_wgpu_init();
|
_sapp_wgpu_init();
|
||||||
#endif
|
#endif
|
||||||
_sapp.valid = true;
|
_sapp.valid = true;
|
||||||
_sapp_emsc_register_eventhandlers();
|
_sapp_emsc_register_eventhandlers();
|
||||||
@@ -11890,7 +11971,7 @@ SOKOL_API_IMPL float sapp_heightf(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SOKOL_API_IMPL int sapp_color_format(void) {
|
SOKOL_API_IMPL int sapp_color_format(void) {
|
||||||
#if defined(_SAPP_EMSCRIPTEN) && defined(SOKOL_WGPU)
|
#if defined(SOKOL_WGPU)
|
||||||
switch (_sapp.wgpu.render_format) {
|
switch (_sapp.wgpu.render_format) {
|
||||||
case WGPUTextureFormat_RGBA8Unorm:
|
case WGPUTextureFormat_RGBA8Unorm:
|
||||||
return _SAPP_PIXELFORMAT_RGBA8;
|
return _SAPP_PIXELFORMAT_RGBA8;
|
||||||
@@ -12348,7 +12429,7 @@ SOKOL_API_IMPL const void* sapp_win32_get_hwnd(void) {
|
|||||||
|
|
||||||
SOKOL_API_IMPL const void* sapp_wgpu_get_device(void) {
|
SOKOL_API_IMPL const void* sapp_wgpu_get_device(void) {
|
||||||
SOKOL_ASSERT(_sapp.valid);
|
SOKOL_ASSERT(_sapp.valid);
|
||||||
#if defined(_SAPP_EMSCRIPTEN) && defined(SOKOL_WGPU)
|
#if defined(SOKOL_WGPU)
|
||||||
return (const void*) _sapp.wgpu.device;
|
return (const void*) _sapp.wgpu.device;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
@@ -12357,7 +12438,7 @@ SOKOL_API_IMPL const void* sapp_wgpu_get_device(void) {
|
|||||||
|
|
||||||
SOKOL_API_IMPL const void* sapp_wgpu_get_render_view(void) {
|
SOKOL_API_IMPL const void* sapp_wgpu_get_render_view(void) {
|
||||||
SOKOL_ASSERT(_sapp.valid);
|
SOKOL_ASSERT(_sapp.valid);
|
||||||
#if defined(_SAPP_EMSCRIPTEN) && defined(SOKOL_WGPU)
|
#if defined(SOKOL_WGPU)
|
||||||
if (_sapp.sample_count > 1) {
|
if (_sapp.sample_count > 1) {
|
||||||
SOKOL_ASSERT(_sapp.wgpu.msaa_view);
|
SOKOL_ASSERT(_sapp.wgpu.msaa_view);
|
||||||
return (const void*) _sapp.wgpu.msaa_view;
|
return (const void*) _sapp.wgpu.msaa_view;
|
||||||
@@ -12372,7 +12453,7 @@ SOKOL_API_IMPL const void* sapp_wgpu_get_render_view(void) {
|
|||||||
|
|
||||||
SOKOL_API_IMPL const void* sapp_wgpu_get_resolve_view(void) {
|
SOKOL_API_IMPL const void* sapp_wgpu_get_resolve_view(void) {
|
||||||
SOKOL_ASSERT(_sapp.valid);
|
SOKOL_ASSERT(_sapp.valid);
|
||||||
#if defined(_SAPP_EMSCRIPTEN) && defined(SOKOL_WGPU)
|
#if defined(SOKOL_WGPU)
|
||||||
if (_sapp.sample_count > 1) {
|
if (_sapp.sample_count > 1) {
|
||||||
SOKOL_ASSERT(_sapp.wgpu.swapchain_view);
|
SOKOL_ASSERT(_sapp.wgpu.swapchain_view);
|
||||||
return (const void*) _sapp.wgpu.swapchain_view;
|
return (const void*) _sapp.wgpu.swapchain_view;
|
||||||
@@ -12386,7 +12467,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_API_IMPL const void* sapp_wgpu_get_depth_stencil_view(void) {
|
||||||
SOKOL_ASSERT(_sapp.valid);
|
SOKOL_ASSERT(_sapp.valid);
|
||||||
#if defined(_SAPP_EMSCRIPTEN) && defined(SOKOL_WGPU)
|
#if defined(SOKOL_WGPU)
|
||||||
return (const void*) _sapp.wgpu.depth_stencil_view;
|
return (const void*) _sapp.wgpu.depth_stencil_view;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
|
4
thirdparty/sokol/c/sokol_audio.h
vendored
4
thirdparty/sokol/c/sokol_audio.h
vendored
@@ -1480,7 +1480,7 @@ error:
|
|||||||
_saudio.backend.device = 0;
|
_saudio.backend.device = 0;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
}
|
||||||
|
|
||||||
_SOKOL_PRIVATE void _saudio_alsa_backend_shutdown(void) {
|
_SOKOL_PRIVATE void _saudio_alsa_backend_shutdown(void) {
|
||||||
SOKOL_ASSERT(_saudio.backend.device);
|
SOKOL_ASSERT(_saudio.backend.device);
|
||||||
@@ -1489,7 +1489,7 @@ _SOKOL_PRIVATE void _saudio_alsa_backend_shutdown(void) {
|
|||||||
snd_pcm_drain(_saudio.backend.device);
|
snd_pcm_drain(_saudio.backend.device);
|
||||||
snd_pcm_close(_saudio.backend.device);
|
snd_pcm_close(_saudio.backend.device);
|
||||||
_saudio_free(_saudio.backend.buffer);
|
_saudio_free(_saudio.backend.buffer);
|
||||||
};
|
}
|
||||||
|
|
||||||
// ██ ██ █████ ███████ █████ ██████ ██
|
// ██ ██ █████ ███████ █████ ██████ ██
|
||||||
// ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
// ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||||
|
2960
thirdparty/sokol/c/sokol_gfx.h
vendored
2960
thirdparty/sokol/c/sokol_gfx.h
vendored
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
70
thirdparty/sokol/gfx/gfx.odin
vendored
70
thirdparty/sokol/gfx/gfx.odin
vendored
@@ -67,6 +67,26 @@ package sokol_gfx
|
|||||||
|
|
||||||
SOKOL_DEBUG - by default this is defined if _DEBUG is defined
|
SOKOL_DEBUG - by default this is defined if _DEBUG is defined
|
||||||
|
|
||||||
|
Link with the following system libraries (note that sokol_app.h has
|
||||||
|
additional linker requirements):
|
||||||
|
|
||||||
|
- on macOS/iOS with Metal: Metal
|
||||||
|
- on macOS with GL: OpenGL
|
||||||
|
- on iOS with GL: OpenGLES
|
||||||
|
- on Linux with EGL: GL or GLESv2
|
||||||
|
- on Linux with GLX: GL
|
||||||
|
- on Android: GLESv3, log, android
|
||||||
|
- on Windows with the MSVC or Clang toolchains: no action needed, libs are defined in-source via pragma-comment-lib
|
||||||
|
- on Windows with MINGW/MSYS2 gcc: compile with '-mwin32' so that _WIN32 is defined
|
||||||
|
- with the D3D11 backend: -ld3d11
|
||||||
|
|
||||||
|
On macOS and iOS, the implementation must be compiled as Objective-C.
|
||||||
|
|
||||||
|
On Emscripten:
|
||||||
|
- for WebGL2: add the linker option `-s USE_WEBGL2=1`
|
||||||
|
- for WebGPU: compile and link with `--use-port=emdawnwebgpu`
|
||||||
|
(for more exotic situations, read: https://dawn.googlesource.com/dawn/+/refs/heads/main/src/emdawnwebgpu/pkg/README.md)
|
||||||
|
|
||||||
sokol_gfx DOES NOT:
|
sokol_gfx DOES NOT:
|
||||||
===================
|
===================
|
||||||
- create a window, swapchain or the 3D-API context/device, you must do this
|
- create a window, swapchain or the 3D-API context/device, you must do this
|
||||||
@@ -3608,6 +3628,8 @@ Sampler_Desc :: struct {
|
|||||||
source code, you can provide an optional target string via
|
source code, you can provide an optional target string via
|
||||||
sg_shader_stage_desc.d3d11_target, the default target is "vs_4_0" for the
|
sg_shader_stage_desc.d3d11_target, the default target is "vs_4_0" for the
|
||||||
vertex shader stage and "ps_4_0" for the pixel shader stage.
|
vertex shader stage and "ps_4_0" for the pixel shader stage.
|
||||||
|
You may optionally provide the file path to enable the default #include handler
|
||||||
|
behavior when compiling source code.
|
||||||
*/
|
*/
|
||||||
Shader_Stage :: enum i32 {
|
Shader_Stage :: enum i32 {
|
||||||
NONE,
|
NONE,
|
||||||
@@ -3621,6 +3643,7 @@ Shader_Function :: struct {
|
|||||||
bytecode : Range,
|
bytecode : Range,
|
||||||
entry : cstring,
|
entry : cstring,
|
||||||
d3d11_target : cstring,
|
d3d11_target : cstring,
|
||||||
|
d3d11_filepath : cstring,
|
||||||
}
|
}
|
||||||
|
|
||||||
Shader_Attr_Base_Type :: enum i32 {
|
Shader_Attr_Base_Type :: enum i32 {
|
||||||
@@ -3970,6 +3993,7 @@ Attachments_Desc :: struct {
|
|||||||
Slot_Info :: struct {
|
Slot_Info :: struct {
|
||||||
state : Resource_State,
|
state : Resource_State,
|
||||||
res_id : u32,
|
res_id : u32,
|
||||||
|
uninit_count : u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
Buffer_Info :: struct {
|
Buffer_Info :: struct {
|
||||||
@@ -4449,10 +4473,14 @@ Log_Item :: enum i32 {
|
|||||||
VALIDATE_BEGINPASS_ATTACHMENTS_VALID,
|
VALIDATE_BEGINPASS_ATTACHMENTS_VALID,
|
||||||
VALIDATE_BEGINPASS_COMPUTEPASS_STORAGE_ATTACHMENTS_ONLY,
|
VALIDATE_BEGINPASS_COMPUTEPASS_STORAGE_ATTACHMENTS_ONLY,
|
||||||
VALIDATE_BEGINPASS_RENDERPASS_RENDER_ATTACHMENTS_ONLY,
|
VALIDATE_BEGINPASS_RENDERPASS_RENDER_ATTACHMENTS_ONLY,
|
||||||
VALIDATE_BEGINPASS_COLOR_ATTACHMENT_IMAGE,
|
VALIDATE_BEGINPASS_COLOR_ATTACHMENT_IMAGE_ALIVE,
|
||||||
VALIDATE_BEGINPASS_RESOLVE_ATTACHMENT_IMAGE,
|
VALIDATE_BEGINPASS_COLOR_ATTACHMENT_IMAGE_VALID,
|
||||||
VALIDATE_BEGINPASS_DEPTHSTENCIL_ATTACHMENT_IMAGE,
|
VALIDATE_BEGINPASS_RESOLVE_ATTACHMENT_IMAGE_ALIVE,
|
||||||
VALIDATE_BEGINPASS_STORAGE_ATTACHMENT_IMAGE,
|
VALIDATE_BEGINPASS_RESOLVE_ATTACHMENT_IMAGE_VALID,
|
||||||
|
VALIDATE_BEGINPASS_DEPTHSTENCIL_ATTACHMENT_IMAGE_ALIVE,
|
||||||
|
VALIDATE_BEGINPASS_DEPTHSTENCIL_ATTACHMENT_IMAGE_VALID,
|
||||||
|
VALIDATE_BEGINPASS_STORAGE_ATTACHMENT_IMAGE_ALIVE,
|
||||||
|
VALIDATE_BEGINPASS_STORAGE_ATTACHMENT_IMAGE_VALID,
|
||||||
VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_WIDTH,
|
VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_WIDTH,
|
||||||
VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_WIDTH_NOTSET,
|
VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_WIDTH_NOTSET,
|
||||||
VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_HEIGHT,
|
VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_HEIGHT,
|
||||||
@@ -4487,39 +4515,45 @@ Log_Item :: enum i32 {
|
|||||||
VALIDATE_APIP_PIPELINE_EXISTS,
|
VALIDATE_APIP_PIPELINE_EXISTS,
|
||||||
VALIDATE_APIP_PIPELINE_VALID,
|
VALIDATE_APIP_PIPELINE_VALID,
|
||||||
VALIDATE_APIP_PASS_EXPECTED,
|
VALIDATE_APIP_PASS_EXPECTED,
|
||||||
VALIDATE_APIP_SHADER_EXISTS,
|
VALIDATE_APIP_PIPELINE_SHADER_ALIVE,
|
||||||
VALIDATE_APIP_SHADER_VALID,
|
VALIDATE_APIP_PIPELINE_SHADER_VALID,
|
||||||
VALIDATE_APIP_COMPUTEPASS_EXPECTED,
|
VALIDATE_APIP_COMPUTEPASS_EXPECTED,
|
||||||
VALIDATE_APIP_RENDERPASS_EXPECTED,
|
VALIDATE_APIP_RENDERPASS_EXPECTED,
|
||||||
VALIDATE_APIP_CURPASS_ATTACHMENTS_EXISTS,
|
VALIDATE_APIP_CURPASS_ATTACHMENTS_ALIVE,
|
||||||
VALIDATE_APIP_CURPASS_ATTACHMENTS_VALID,
|
VALIDATE_APIP_CURPASS_ATTACHMENTS_VALID,
|
||||||
VALIDATE_APIP_ATT_COUNT,
|
VALIDATE_APIP_ATT_COUNT,
|
||||||
|
VALIDATE_APIP_COLOR_ATTACHMENT_IMAGE_ALIVE,
|
||||||
|
VALIDATE_APIP_COLOR_ATTACHMENT_IMAGE_VALID,
|
||||||
|
VALIDATE_APIP_DEPTHSTENCIL_ATTACHMENT_IMAGE_ALIVE,
|
||||||
|
VALIDATE_APIP_DEPTHSTENCIL_ATTACHMENT_IMAGE_VALID,
|
||||||
VALIDATE_APIP_COLOR_FORMAT,
|
VALIDATE_APIP_COLOR_FORMAT,
|
||||||
VALIDATE_APIP_DEPTH_FORMAT,
|
VALIDATE_APIP_DEPTH_FORMAT,
|
||||||
VALIDATE_APIP_SAMPLE_COUNT,
|
VALIDATE_APIP_SAMPLE_COUNT,
|
||||||
VALIDATE_APIP_EXPECTED_STORAGE_ATTACHMENT_IMAGE,
|
VALIDATE_APIP_EXPECTED_STORAGE_ATTACHMENT_IMAGE,
|
||||||
VALIDATE_APIP_STORAGE_ATTACHMENT_IMAGE_EXISTS,
|
VALIDATE_APIP_STORAGE_ATTACHMENT_IMAGE_ALIVE,
|
||||||
VALIDATE_APIP_STORAGE_ATTACHMENT_IMAGE_VALID,
|
VALIDATE_APIP_STORAGE_ATTACHMENT_IMAGE_VALID,
|
||||||
VALIDATE_APIP_STORAGE_ATTACHMENT_PIXELFORMAT,
|
VALIDATE_APIP_STORAGE_ATTACHMENT_PIXELFORMAT,
|
||||||
VALIDATE_APIP_STORAGE_ATTACHMENT_IMAGE_TYPE,
|
VALIDATE_APIP_STORAGE_ATTACHMENT_IMAGE_TYPE,
|
||||||
VALIDATE_ABND_PASS_EXPECTED,
|
VALIDATE_ABND_PASS_EXPECTED,
|
||||||
VALIDATE_ABND_EMPTY_BINDINGS,
|
VALIDATE_ABND_EMPTY_BINDINGS,
|
||||||
VALIDATE_ABND_PIPELINE,
|
VALIDATE_ABND_NO_PIPELINE,
|
||||||
VALIDATE_ABND_PIPELINE_EXISTS,
|
VALIDATE_ABND_PIPELINE_ALIVE,
|
||||||
VALIDATE_ABND_PIPELINE_VALID,
|
VALIDATE_ABND_PIPELINE_VALID,
|
||||||
|
VALIDATE_ABND_PIPELINE_SHADER_ALIVE,
|
||||||
|
VALIDATE_ABND_PIPELINE_SHADER_VALID,
|
||||||
VALIDATE_ABND_COMPUTE_EXPECTED_NO_VBS,
|
VALIDATE_ABND_COMPUTE_EXPECTED_NO_VBS,
|
||||||
VALIDATE_ABND_COMPUTE_EXPECTED_NO_IB,
|
VALIDATE_ABND_COMPUTE_EXPECTED_NO_IB,
|
||||||
VALIDATE_ABND_EXPECTED_VB,
|
VALIDATE_ABND_EXPECTED_VB,
|
||||||
VALIDATE_ABND_VB_EXISTS,
|
VALIDATE_ABND_VB_ALIVE,
|
||||||
VALIDATE_ABND_VB_TYPE,
|
VALIDATE_ABND_VB_TYPE,
|
||||||
VALIDATE_ABND_VB_OVERFLOW,
|
VALIDATE_ABND_VB_OVERFLOW,
|
||||||
VALIDATE_ABND_NO_IB,
|
VALIDATE_ABND_NO_IB,
|
||||||
VALIDATE_ABND_IB,
|
VALIDATE_ABND_IB,
|
||||||
VALIDATE_ABND_IB_EXISTS,
|
VALIDATE_ABND_IB_ALIVE,
|
||||||
VALIDATE_ABND_IB_TYPE,
|
VALIDATE_ABND_IB_TYPE,
|
||||||
VALIDATE_ABND_IB_OVERFLOW,
|
VALIDATE_ABND_IB_OVERFLOW,
|
||||||
VALIDATE_ABND_EXPECTED_IMAGE_BINDING,
|
VALIDATE_ABND_EXPECTED_IMAGE_BINDING,
|
||||||
VALIDATE_ABND_IMG_EXISTS,
|
VALIDATE_ABND_IMG_ALIVE,
|
||||||
VALIDATE_ABND_IMAGE_TYPE_MISMATCH,
|
VALIDATE_ABND_IMAGE_TYPE_MISMATCH,
|
||||||
VALIDATE_ABND_EXPECTED_MULTISAMPLED_IMAGE,
|
VALIDATE_ABND_EXPECTED_MULTISAMPLED_IMAGE,
|
||||||
VALIDATE_ABND_IMAGE_MSAA,
|
VALIDATE_ABND_IMAGE_MSAA,
|
||||||
@@ -4529,9 +4563,10 @@ Log_Item :: enum i32 {
|
|||||||
VALIDATE_ABND_UNEXPECTED_SAMPLER_COMPARE_NEVER,
|
VALIDATE_ABND_UNEXPECTED_SAMPLER_COMPARE_NEVER,
|
||||||
VALIDATE_ABND_EXPECTED_SAMPLER_COMPARE_NEVER,
|
VALIDATE_ABND_EXPECTED_SAMPLER_COMPARE_NEVER,
|
||||||
VALIDATE_ABND_EXPECTED_NONFILTERING_SAMPLER,
|
VALIDATE_ABND_EXPECTED_NONFILTERING_SAMPLER,
|
||||||
VALIDATE_ABND_SMP_EXISTS,
|
VALIDATE_ABND_SMP_ALIVE,
|
||||||
|
VALIDATE_ABND_SMP_VALID,
|
||||||
VALIDATE_ABND_EXPECTED_STORAGEBUFFER_BINDING,
|
VALIDATE_ABND_EXPECTED_STORAGEBUFFER_BINDING,
|
||||||
VALIDATE_ABND_STORAGEBUFFER_EXISTS,
|
VALIDATE_ABND_STORAGEBUFFER_ALIVE,
|
||||||
VALIDATE_ABND_STORAGEBUFFER_BINDING_BUFFERTYPE,
|
VALIDATE_ABND_STORAGEBUFFER_BINDING_BUFFERTYPE,
|
||||||
VALIDATE_ABND_STORAGEBUFFER_READWRITE_IMMUTABLE,
|
VALIDATE_ABND_STORAGEBUFFER_READWRITE_IMMUTABLE,
|
||||||
VALIDATE_ABND_IMAGE_BINDING_VS_DEPTHSTENCIL_ATTACHMENT,
|
VALIDATE_ABND_IMAGE_BINDING_VS_DEPTHSTENCIL_ATTACHMENT,
|
||||||
@@ -4540,6 +4575,10 @@ Log_Item :: enum i32 {
|
|||||||
VALIDATE_ABND_IMAGE_BINDING_VS_STORAGE_ATTACHMENT,
|
VALIDATE_ABND_IMAGE_BINDING_VS_STORAGE_ATTACHMENT,
|
||||||
VALIDATE_AU_PASS_EXPECTED,
|
VALIDATE_AU_PASS_EXPECTED,
|
||||||
VALIDATE_AU_NO_PIPELINE,
|
VALIDATE_AU_NO_PIPELINE,
|
||||||
|
VALIDATE_AU_PIPELINE_ALIVE,
|
||||||
|
VALIDATE_AU_PIPELINE_VALID,
|
||||||
|
VALIDATE_AU_PIPELINE_SHADER_ALIVE,
|
||||||
|
VALIDATE_AU_PIPELINE_SHADER_VALID,
|
||||||
VALIDATE_AU_NO_UNIFORMBLOCK_AT_SLOT,
|
VALIDATE_AU_NO_UNIFORMBLOCK_AT_SLOT,
|
||||||
VALIDATE_AU_SIZE,
|
VALIDATE_AU_SIZE,
|
||||||
VALIDATE_DRAW_RENDERPASS_EXPECTED,
|
VALIDATE_DRAW_RENDERPASS_EXPECTED,
|
||||||
@@ -4783,7 +4822,6 @@ D3d11_Pipeline_Info :: struct {
|
|||||||
|
|
||||||
D3d11_Attachments_Info :: struct {
|
D3d11_Attachments_Info :: struct {
|
||||||
color_rtv : [4]rawptr,
|
color_rtv : [4]rawptr,
|
||||||
resolve_rtv : [4]rawptr,
|
|
||||||
dsv : rawptr,
|
dsv : rawptr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
thirdparty/sokol/sokol_dll_windows_x64_gl_debug.dll
vendored
BIN
thirdparty/sokol/sokol_dll_windows_x64_gl_debug.dll
vendored
Binary file not shown.
BIN
thirdparty/sokol/sokol_dll_windows_x64_gl_debug.exp
vendored
BIN
thirdparty/sokol/sokol_dll_windows_x64_gl_debug.exp
vendored
Binary file not shown.
BIN
thirdparty/sokol/sokol_dll_windows_x64_gl_debug.lib
vendored
BIN
thirdparty/sokol/sokol_dll_windows_x64_gl_debug.lib
vendored
Binary file not shown.
BIN
thirdparty/sokol/sokol_dll_windows_x64_gl_debug.pdb
vendored
BIN
thirdparty/sokol/sokol_dll_windows_x64_gl_debug.pdb
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
thirdparty/stb/lib/stb_truetype.lib
vendored
BIN
thirdparty/stb/lib/stb_truetype.lib
vendored
Binary file not shown.
Reference in New Issue
Block a user