From e97641ff45e2baa5af297609e792a1206e7ea394 Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Wed, 2 Oct 2024 13:40:51 +0200 Subject: sokol_gfx.h wgpu: deal with new WGPUOptionalBool type --- sokol_gfx.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sokol_gfx.h b/sokol_gfx.h index b00fab1c..f2d266c6 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -13397,8 +13397,12 @@ _SOKOL_PRIVATE WGPUStringView _sg_wgpu_stringview(const char* str) { } return res; } +_SOKOL_PRIVATE WGPUOptionalBool _sg_wgpu_optional_bool(bool b) { + return b ? WGPUOptionalBool_True : WGPUOptionalBool_False; +} #else #define _sg_wgpu_stringview(str) str +#define _sg_wgpu_optional_bool(bool b) (b) #endif _SOKOL_PRIVATE WGPUBufferUsage _sg_wgpu_buffer_usage(sg_buffer_type t, sg_usage u) { @@ -14936,7 +14940,7 @@ _SOKOL_PRIVATE sg_resource_state _sg_wgpu_create_pipeline(_sg_pipeline_t* pip, _ wgpu_pip_desc.primitive.cullMode = _sg_wgpu_cullmode(desc->cull_mode); if (SG_PIXELFORMAT_NONE != desc->depth.pixel_format) { wgpu_ds_state.format = _sg_wgpu_textureformat(desc->depth.pixel_format); - wgpu_ds_state.depthWriteEnabled = desc->depth.write_enabled; + wgpu_ds_state.depthWriteEnabled = _sg_wgpu_optional_bool(desc->depth.write_enabled); wgpu_ds_state.depthCompare = _sg_wgpu_comparefunc(desc->depth.compare); wgpu_ds_state.stencilFront.compare = _sg_wgpu_comparefunc(desc->stencil.front.compare); wgpu_ds_state.stencilFront.failOp = _sg_wgpu_stencilop(desc->stencil.front.fail_op); -- cgit v1.2.3