Skip to content

Commit

Permalink
_sg_mtl_begin_pass: explicit store action for depth and stencil attac…
Browse files Browse the repository at this point in the history
…hments (MTLStoreActionStore) (non-default pass only)
  • Loading branch information
allcreater committed Apr 3, 2023
1 parent 956a0d8 commit 66cac7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sokol_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -11727,8 +11729,10 @@ _SOKOL_PRIVATE void _sg_mtl_begin_pass(_sg_pass_t* pass, const sg_pass_action* a
sg_color c = action->colors[0].value;
pass_desc.colorAttachments[0].clearColor = MTLClearColorMake(c.r, c.g, c.b, c.a);
pass_desc.depthAttachment.loadAction = _sg_mtl_load_action(action->depth.action);
pass_desc.depthAttachment.storeAction = MTLStoreActionStore;
pass_desc.depthAttachment.clearDepth = action->depth.value;
pass_desc.stencilAttachment.loadAction = _sg_mtl_load_action(action->stencil.action);
pass_desc.stencilAttachment.storeAction = MTLStoreActionStore;
pass_desc.stencilAttachment.clearStencil = action->stencil.value;
}

Expand Down

0 comments on commit 66cac7b

Please sign in to comment.