aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2024-10-02 13:40:51 +0200
committerAndre Weissflog <floooh@gmail.com>2024-10-14 17:31:38 +0200
commite97641ff45e2baa5af297609e792a1206e7ea394 (patch)
tree92a6d3b7ebd278b1c692ddeb07f4ffa1b0850e24
parent6fe5603e3a4c1eb4a5a011a196fba8b9402e14cb (diff)
sokol_gfx.h wgpu: deal with new WGPUOptionalBool type
-rw-r--r--sokol_gfx.h6
1 files changed, 5 insertions, 1 deletions
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);