diff --git a/main.c b/main.c index 2f625ee..7d3740c 100644 --- a/main.c +++ b/main.c @@ -2743,7 +2743,7 @@ void create_screenspace_gfx_state() state.threedee_pass_image = sg_make_image(&desc); desc.label = "threedee-pass-depth-render-target"; - desc.pixel_format = SG_PIXELFORMAT_DEPTH; + desc.pixel_format = sapp_depth_format(); state.threedee_pass_depth_image = sg_make_image(&desc); state.threedee_pass = sg_make_pass(&(sg_pass_desc){ @@ -3307,7 +3307,7 @@ void init(void) [ATTR_threedee_vs_uv_in].format = SG_VERTEXFORMAT_FLOAT2, }}, .depth = { - .pixel_format = SG_PIXELFORMAT_DEPTH, + .pixel_format = sapp_depth_format(), .compare = SG_COMPAREFUNC_LESS_EQUAL, .write_enabled = true, }, @@ -3332,7 +3332,7 @@ void init(void) { .shader = shd, .depth = { - .pixel_format = SG_PIXELFORMAT_DEPTH, + .pixel_format = sapp_depth_format(), .compare = SG_COMPAREFUNC_LESS_EQUAL, .write_enabled = true }, diff --git a/thirdparty/sokol_app.h b/thirdparty/sokol_app.h index 0142947..30db44d 100644 --- a/thirdparty/sokol_app.h +++ b/thirdparty/sokol_app.h @@ -11930,7 +11930,11 @@ SOKOL_API_IMPL int sapp_color_format(void) { } SOKOL_API_IMPL int sapp_depth_format(void) { + #ifdef SOKOL_GLES2 + return _SAPP_PIXELFORMAT_DEPTH; + #else return _SAPP_PIXELFORMAT_DEPTH_STENCIL; + #endif } SOKOL_API_IMPL int sapp_sample_count(void) {