Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions plume_metal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,12 @@ namespace plume {
uint64_t gpuAddress = nativeBuffer->gpuAddress() + bufferDescriptor->offset;
*reinterpret_cast<uint64_t*>(bufferPtr + argumentOffset) = gpuAddress;
} else {
// On Tier 2 devices without direct buffer addresses (e.g. Intel Mac AMD on macOS 11+),
// the argument encoder's backing buffer must be set before encoding arguments.
// macOS 11+ reports all GPUs as Tier 2, but Intel AMD GPUs skip setArgumentBuffer
// in the constructor because useArgumentBuffersTier2 is true. Without this call
// the encoder has no backing buffer, causing a SIGSEGV in AMDMTLBronzeDriver.
argumentBuffer.argumentEncoder->setArgumentBuffer(argumentBuffer.mtl, argumentBuffer.offset);
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.

I think this makes sense to me, but I think we only need to call this once for the descriptor set, if there's some way we can make sure of that.

argumentBuffer.argumentEncoder->setBuffer(nativeBuffer, bufferDescriptor->offset, argumentIndex);
}
nativeBuffer->retain();
Expand Down