aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2023-04-03 16:22:13 +0200
committerAndre Weissflog <floooh@gmail.com>2023-04-03 16:22:13 +0200
commite56c596810d8be80772314d1a99378ae0b998e6a (patch)
tree6b51cf38757b58b9e1e5ed3fbd932a2bef56da80
parentf09b19011f63459b0baa04d770b6d6eb9f3f91fa (diff)
sokol_gfx.h metal: store content of offscreen depth/stencil surface.
Excplicitly sets MTLStoreActionStore on offscreen depth/stencil surfaces, not great from perspective point of view, but addresses https://github.com/floooh/sokol/pull/815. Also see https://github.com/floooh/sokol/issues/816 for a proper cleanup proposal.
-rw-r--r--sokol_gfx.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sokol_gfx.h b/sokol_gfx.h
index eb1da33e..ecd79d9b 100644
--- a/sokol_gfx.h
+++ b/sokol_gfx.h
@@ -11713,10 +11713,12 @@ _SOKOL_PRIVATE void _sg_mtl_begin_pass(_sg_pass_t* pass, const sg_pass_action* a
SOKOL_ASSERT(ds_att_img->mtl.depth_tex != _SG_MTL_INVALID_SLOT_INDEX);
pass_desc.depthAttachment.texture = _sg_mtl_id(ds_att_img->mtl.depth_tex);
pass_desc.depthAttachment.loadAction = _sg_mtl_load_action(action->depth.action);
+ pass_desc.depthAttachment.storeAction = MTLStoreActionStore;
pass_desc.depthAttachment.clearDepth = action->depth.value;
if (_sg_is_depth_stencil_format(ds_att_img->cmn.pixel_format)) {
pass_desc.stencilAttachment.texture = _sg_mtl_id(ds_att_img->mtl.depth_tex);
pass_desc.stencilAttachment.loadAction = _sg_mtl_load_action(action->stencil.action);
+ pass_desc.stencilAttachment.storeAction = MTLStoreActionStore;
pass_desc.stencilAttachment.clearStencil = action->stencil.value;
}
}