From 866a8dd2f2d54089b99a00b8ff89cd4dcea59484 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Fri, 27 Nov 2026 01:58:06 -0800 Subject: [PATCH] Replay player: a compute pipeline state takes the stream's openClMode The player refused a compute descriptor whose openClMode was true, so a stream that makes an OpenCL-mode pipeline (a guest running OpenCL C on Metal) stopped at its first one. The runtime's descriptor carries the mode (open_cl_mode_enabled), and the translator links the kernel for it: the three hidden buffers ahead of the kernel's own, its buffer indices 3 on, get_global_id with the dispatch's offset. The player now gives the stream's value to the descriptor, off where absent, and the stream doc says so. The previous commit's test is its check on lavapipe: red before this commit, green with it. --- crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs | 2 +- docs/REPLAY-STREAM.md | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs b/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs index 4f70a11ab..24da68240 100644 --- a/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs +++ b/crates/metal2vulkan-validation/src/replay/new_runtime/mod.rs @@ -1943,8 +1943,8 @@ impl NewRuntime { } } } - f.only("openClMode", Fields::bool, false)?; let mut d = rt::ComputePipelineDescriptor::new(rt::StageSource::Function(kernel)); + d.open_cl_mode_enabled = f.bool("openClMode")?.unwrap_or(false); d.stage_input = translator::stage_input(call, &f)?; if let Some(multiple) = f.bool("threadgroupSizeIsMultipleOfExecutionWidth")? { d.threadgroup_size_is_multiple_of_execution_width = multiple; diff --git a/docs/REPLAY-STREAM.md b/docs/REPLAY-STREAM.md index 0e0d73674..8806ec86d 100644 --- a/docs/REPLAY-STREAM.md +++ b/docs/REPLAY-STREAM.md @@ -463,7 +463,9 @@ and the (name id, value) answer pairs. indexType, indexBufferIndex}`: the layouts and attributes in the vertex descriptor's form, Metal's raw step functions and attribute formats, and the index type and index buffer as Metal's `MTLStageInputOutputDescriptor` holds them. A player gives it to the pipeline; an - attribute's buffer that no layout names takes Metal's unset layout. + attribute's buffer that no layout names takes Metal's unset layout. A player gives + `openClMode` to the pipeline too (off where absent), whose kernel then takes the three hidden + buffers ahead of its own buffers as Metal's OpenCL mode does. - **Keys that are not Metal's property names:** | key | Metal's |