Skip to content

[Metal] MTLDevice BufferCreateDesc needs to be fully initalized#1312

Merged
farzonl merged 1 commit into
llvm:mainfrom
farzonl:fix_mtl_build
Jun 15, 2026
Merged

[Metal] MTLDevice BufferCreateDesc needs to be fully initalized#1312
farzonl merged 1 commit into
llvm:mainfrom
farzonl:fix_mtl_build

Conversation

@farzonl

@farzonl farzonl commented Jun 15, 2026

Copy link
Copy Markdown
Member

The Metal\Mac runner builds are failing because we can't create a buffer description. This change full initalize it so we fix the warnings and build errors.

The Metal\Mac runner builds are failing because we can't create a buffer
description. This change full initalize it so we fix the warnings and
build errors.

@bogner bogner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to fix the build, but I think we need to follow up on this - I also see a couple of places where we're creating BufferCreateDesc with {} elsewhere. I'll follow up with some post-commit comments on #1306

Comment thread lib/API/MTL/MTLDevice.cpp
Comment on lines 1416 to +1421
const BufferCreateDesc Desc{MemoryLocation::GpuToCpu,
BufferUsage::Storage};
MemoryBacking::Automatic,
BufferUsage::Storage,
BufferShaderAccessType::Raw,
{},
false};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this use one of the static BufferCreateDesc helper functions instead? BufferCreateDesc::readBackBuffer I guess?

@farzonl farzonl merged commit aa99e85 into llvm:main Jun 15, 2026
25 of 27 checks passed
@farzonl farzonl deleted the fix_mtl_build branch June 15, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants