mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 06:03:09 +00:00
Metal: fix out of bounds crash when using debug draw modes
This commit is contained in:
parent
97ef3c8372
commit
34190fc360
@ -560,10 +560,10 @@ void MDCommandBuffer::_render_clear_render_area() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
uint32_t ds_index = subpass.depth_stencil_reference.attachment;
|
uint32_t ds_index = subpass.depth_stencil_reference.attachment;
|
||||||
MDAttachment const &attachment = pass.attachments[ds_index];
|
bool shouldClearDepth = (ds_index != RDD::AttachmentReference::UNUSED && pass.attachments[ds_index].shouldClear(subpass, false));
|
||||||
bool shouldClearDepth = (ds_index != RDD::AttachmentReference::UNUSED && attachment.shouldClear(subpass, false));
|
bool shouldClearStencil = (ds_index != RDD::AttachmentReference::UNUSED && pass.attachments[ds_index].shouldClear(subpass, true));
|
||||||
bool shouldClearStencil = (ds_index != RDD::AttachmentReference::UNUSED && attachment.shouldClear(subpass, true));
|
|
||||||
if (shouldClearDepth || shouldClearStencil) {
|
if (shouldClearDepth || shouldClearStencil) {
|
||||||
|
MDAttachment const &attachment = pass.attachments[ds_index];
|
||||||
BitField<RDD::TextureAspectBits> bits;
|
BitField<RDD::TextureAspectBits> bits;
|
||||||
if (shouldClearDepth && attachment.type & MDAttachmentType::Depth) {
|
if (shouldClearDepth && attachment.type & MDAttachmentType::Depth) {
|
||||||
bits.set_flag(RDD::TEXTURE_ASPECT_DEPTH_BIT);
|
bits.set_flag(RDD::TEXTURE_ASPECT_DEPTH_BIT);
|
||||||
|
Loading…
Reference in New Issue
Block a user