summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-09-11 12:35:20 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-09-11 12:35:20 +0200
commit62717f2953a781258c56aa2eb6dffefc9dd53257 (patch)
tree350105d324f3d9ba0301096109387a786bf21b83 /drivers
parent292caed7d3f02dea9321108f8a423ebf30a56496 (diff)
parent34190fc3609c073a81d069b67109232d8fbdf1b0 (diff)
downloadredot-engine-62717f2953a781258c56aa2eb6dffefc9dd53257.tar.gz
Merge pull request #96822 from stuartcarnie/sgc/metal_out_of_bounds
Metal: Fix out of bounds crash when using debug draw modes
Diffstat (limited to 'drivers')
-rw-r--r--drivers/metal/metal_objects.mm6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/metal/metal_objects.mm b/drivers/metal/metal_objects.mm
index abdcccf00c..d3c3d2b232 100644
--- a/drivers/metal/metal_objects.mm
+++ b/drivers/metal/metal_objects.mm
@@ -560,10 +560,10 @@ void MDCommandBuffer::_render_clear_render_area() {
}
}
uint32_t ds_index = subpass.depth_stencil_reference.attachment;
- MDAttachment const &attachment = pass.attachments[ds_index];
- bool shouldClearDepth = (ds_index != RDD::AttachmentReference::UNUSED && attachment.shouldClear(subpass, false));
- bool shouldClearStencil = (ds_index != RDD::AttachmentReference::UNUSED && attachment.shouldClear(subpass, true));
+ bool shouldClearDepth = (ds_index != RDD::AttachmentReference::UNUSED && pass.attachments[ds_index].shouldClear(subpass, false));
+ bool shouldClearStencil = (ds_index != RDD::AttachmentReference::UNUSED && pass.attachments[ds_index].shouldClear(subpass, true));
if (shouldClearDepth || shouldClearStencil) {
+ MDAttachment const &attachment = pass.attachments[ds_index];
BitField<RDD::TextureAspectBits> bits;
if (shouldClearDepth && attachment.type & MDAttachmentType::Depth) {
bits.set_flag(RDD::TEXTURE_ASPECT_DEPTH_BIT);