The sample code just draw a triangle and sample texture.
both sample code can draw a correct triangle and sample texture as expected. there are no error message from terminal.
Sample code using constexpr Sampler can capture and replay well.
Sample code using a argumentTable to bind a MTLSamplerState was crashed when using Metal capture and replay on Xcode.
Here are sample codes.
Test Environment: M1 Pro MacOS 26.3 (25D125) Xcode Version 26.2 (17C52)
Feedback ID: FB22031701
Thanks for the detailed repro project and for filing FB22031701.
Your fix is correct — setting supportArgumentBuffers = true on the MTLSamplerDescriptor is required when the sampler will be encoded into an argument buffer. Without that flag, the sampler isn't guaranteed to work in that context. The fact that it rendered correctly at runtime without the flag was lenient behavior rather than something to rely on.
Regarding the capture crash: we've had trouble reproducing this with your repro project on more recent tools, so the crash may already be resolved. If you're still seeing it with the latest Xcode, please update FB22031701 with the version you're using and a fresh GPU trace, and we'll take another look.