// Minimal WebGPU type definitions for size measurement builds. // All types are opaque pointers, all descriptor structs are empty. // This file is only used when STRIP_EXTERNAL_LIBS is defined. #pragma once #if defined(STRIP_EXTERNAL_LIBS) #include #include // Opaque handle types typedef void* WGPUInstance; typedef void* WGPUAdapter; typedef void* WGPUSurface; typedef void* WGPUDevice; typedef void* WGPUQueue; typedef void* WGPUBuffer; typedef void* WGPUTexture; typedef void* WGPUTextureView; typedef void* WGPUSampler; typedef void* WGPUShaderModule; typedef void* WGPUBindGroupLayout; typedef void* WGPUPipelineLayout; typedef void* WGPUBindGroup; typedef void* WGPURenderPipeline; typedef void* WGPUComputePipeline; typedef void* WGPUCommandEncoder; typedef void* WGPURenderPassEncoder; typedef void* WGPUComputePassEncoder; typedef void* WGPUCommandBuffer; typedef void* WGPUQuerySet; typedef void* WGPURenderBundle; typedef void* WGPURenderBundleEncoder; // Enums (minimal values) typedef enum { WGPUTextureFormat_Undefined = 0, WGPUTextureFormat_BGRA8Unorm = 1, WGPUTextureFormat_RGBA8Unorm = 2, } WGPUTextureFormat; typedef enum { WGPUBufferBindingType_Uniform = 0, WGPUBufferBindingType_Storage = 1, WGPUBufferBindingType_ReadOnlyStorage = 2, } WGPUBufferBindingType; typedef enum { WGPULoadOp_Undefined = 0, WGPULoadOp_Load = 1, WGPULoadOp_Clear = 2, } WGPULoadOp; typedef enum { WGPUStoreOp_Store = 0, WGPUStoreOp_Discard = 1, } WGPUStoreOp; typedef enum { WGPUSurfaceGetCurrentTextureStatus_Success = 0, WGPUSurfaceGetCurrentTextureStatus_Timeout = 1, WGPUSurfaceGetCurrentTextureStatus_Outdated = 2, WGPUSurfaceGetCurrentTextureStatus_Lost = 3, } WGPUSurfaceGetCurrentTextureStatus; // Buffer usage flags #define WGPUBufferUsage_MapRead 0x00000001 #define WGPUBufferUsage_MapWrite 0x00000002 #define WGPUBufferUsage_CopySrc 0x00000004 #define WGPUBufferUsage_CopyDst 0x00000008 #define WGPUBufferUsage_Index 0x00000010 #define WGPUBufferUsage_Vertex 0x00000020 #define WGPUBufferUsage_Uniform 0x00000040 #define WGPUBufferUsage_Storage 0x00000080 #define WGPUBufferUsage_Indirect 0x00000100 #define WGPUBufferUsage_QueryResolve 0x00000200 // Descriptor structs (all empty) struct WGPUInstanceDescriptor {}; struct WGPUAdapterInfo {}; struct WGPUSurfaceConfiguration {}; struct WGPUDeviceDescriptor {}; struct WGPUBufferDescriptor {}; struct WGPUTextureDescriptor {}; struct WGPUTextureViewDescriptor {}; struct WGPUSamplerDescriptor {}; struct WGPUShaderModuleDescriptor {}; struct WGPUShaderSourceWGSL {}; struct WGPUShaderModuleWGSLDescriptor {}; struct WGPUBindGroupLayoutDescriptor {}; struct WGPUBindGroupLayoutEntry {}; struct WGPUPipelineLayoutDescriptor {}; struct WGPUBindGroupDescriptor {}; struct WGPUBindGroupEntry {}; struct WGPURenderPipelineDescriptor {}; struct WGPUComputePipelineDescriptor {}; struct WGPUVertexState {}; struct WGPUFragmentState {}; struct WGPUColorTargetState {}; struct WGPUBlendState {}; struct WGPUPrimitiveState {}; struct WGPUMultisampleState {}; struct WGPUDepthStencilState {}; struct WGPURenderPassDescriptor {}; struct WGPURenderPassColorAttachment { WGPUTextureView view; WGPULoadOp loadOp; WGPUStoreOp storeOp; struct { float r, g, b, a; } clearValue; uint32_t depthSlice; }; struct WGPUComputePassDescriptor {}; struct WGPUCommandEncoderDescriptor {}; struct WGPUCommandBufferDescriptor {}; struct WGPUSurfaceTexture { WGPUTexture texture; WGPUSurfaceGetCurrentTextureStatus status; }; struct WGPUColor { float r, g, b, a; }; struct WGPUExtent3D { uint32_t width, height, depthOrArrayLayers; }; struct WGPUOrigin3D { uint32_t x, y, z; }; struct WGPUImageCopyTexture {}; struct WGPUImageCopyBuffer {}; struct WGPUTextureDataLayout {}; struct WGPUBufferBindingLayout {}; struct WGPUSamplerBindingLayout {}; struct WGPUTextureBindingLayout {}; struct WGPUStorageTextureBindingLayout {}; // String view helper (for compatibility) struct WGPUStringView { const char* data; size_t length; }; static inline WGPUStringView str_view(const char* str) { if (!str) return {nullptr, 0}; return {str, strlen(str)}; } static inline WGPUStringView label_view(const char* str) { (void)str; return {nullptr, 0}; } // Platform shims (no-ops) static inline void platform_wgpu_wait_any(WGPUInstance) { } static inline void platform_wgpu_set_error_callback(WGPUDevice, void*) { } // Constants #define WGPU_DEPTH_SLICE_UNDEFINED 0xffffffff #define WGPUOptionalBool_True true #define WGPUOptionalBool_False false // Callback types (empty) typedef void (*WGPUErrorCallback)(void*, void*, const char*); typedef void (*WGPUUncapturedErrorCallback)(void*, void*, const char*); #endif // STRIP_EXTERNAL_LIBS