diff options
Diffstat (limited to 'src/gpu/gpu.h')
| -rw-r--r-- | src/gpu/gpu.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h index dd4fbd7..8aa290a 100644 --- a/src/gpu/gpu.h +++ b/src/gpu/gpu.h @@ -13,19 +13,27 @@ #include <webgpu/webgpu.h> #include <webgpu/wgpu.h> using WGPUStringView = const char *; -static inline const char *str_view(const char *str) { return str; } -static inline const char *label_view(const char *str) { return str; } +static inline const char *str_view(const char *str) { + return str; +} +static inline const char *label_view(const char *str) { + return str; +} +#define WGPUSType_ShaderSourceWGSL WGPUSType_ShaderModuleWGSLDescriptor +using WGPUShaderSourceWGSL = WGPUShaderModuleWGSLDescriptor; #else // Native (macOS/Linux) using newer wgpu-native #include <webgpu.h> #include <wgpu.h> static inline WGPUStringView str_view(const char *str) { - if (!str) return {nullptr, 0}; + if (!str) + return {nullptr, 0}; return {str, strlen(str)}; } static inline WGPUStringView label_view(const char *str) { #ifndef STRIP_ALL - if (!str) return {nullptr, 0}; + if (!str) + return {nullptr, 0}; return {str, strlen(str)}; #else (void)str; @@ -78,7 +86,8 @@ GpuBuffer gpu_create_buffer(WGPUDevice device, size_t size, uint32_t usage, ComputePass gpu_create_compute_pass(WGPUDevice device, const char *shader_code, ResourceBinding *bindings, int num_bindings); -RenderPass gpu_create_render_pass(WGPUDevice device, - WGPUTextureFormat format, // Needed for render pipeline - const char *shader_code, - ResourceBinding *bindings, int num_bindings); +RenderPass +gpu_create_render_pass(WGPUDevice device, + WGPUTextureFormat format, // Needed for render pipeline + const char *shader_code, ResourceBinding *bindings, + int num_bindings); |
