diff --git a/crates/metal2vulkan-rt/src/command.rs b/crates/metal2vulkan-rt/src/command.rs index 0078284e1..c84bf4c63 100644 --- a/crates/metal2vulkan-rt/src/command.rs +++ b/crates/metal2vulkan-rt/src/command.rs @@ -245,7 +245,7 @@ impl Pushed { } /// The bytes held. - #[cfg(test)] + #[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] pub(crate) fn bytes(&self) -> &[u8] { &self.bytes } @@ -1226,7 +1226,7 @@ impl Building { } /// The push bytes the current command buffer holds. - #[cfg(test)] + #[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] pub(crate) fn pushed(&self) -> &[u8] { self.pushed.bytes() } diff --git a/crates/metal2vulkan-rt/src/encoder.rs b/crates/metal2vulkan-rt/src/encoder.rs index 5e1198ad2..36f3282b5 100644 --- a/crates/metal2vulkan-rt/src/encoder.rs +++ b/crates/metal2vulkan-rt/src/encoder.rs @@ -1560,7 +1560,7 @@ struct Parameters { /// A dispatch's facts and fields: the slots that reach a device copy and that write what the host /// reads, the push bytes with the block's address zeroed (each fill writes its own block), and /// the block's bytes. -#[cfg(test)] +#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] #[derive(Debug, PartialEq)] pub(crate) struct DispatchFilled { facts: [Slots; 2], @@ -1570,7 +1570,7 @@ pub(crate) struct DispatchFilled { /// An encoder's facts and fields beside a find and fill of every slot /// ([`ComputeCommandEncoder::refilled`]). -#[cfg(test)] +#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] pub(crate) struct DispatchRefilled { /// The facts and fields the encoder's dispatches left, found and filled slot by slot since /// the pipeline state was set. @@ -1584,7 +1584,7 @@ pub(crate) struct DispatchRefilled { pub(crate) held: Vec, } -#[cfg(test)] +#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] impl ComputeCommandEncoder { /// Its facts and fields beside a find and fill of every slot of what is bound now, after a /// dispatch filled its parameters. diff --git a/crates/metal2vulkan-rt/src/render_encoder.rs b/crates/metal2vulkan-rt/src/render_encoder.rs index 805bb2ce5..a5749ce11 100644 --- a/crates/metal2vulkan-rt/src/render_encoder.rs +++ b/crates/metal2vulkan-rt/src/render_encoder.rs @@ -2682,7 +2682,7 @@ impl Drop for RenderCommandEncoder { /// What a draw's facts and fields hold: the vertex buffers it binds, whether it reads an /// attachment, reaches a device copy and writes what the host reads, its push bytes with each /// parameter block's address zeroed, and its blocks. -#[cfg(test)] +#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] #[derive(Debug, PartialEq)] pub(crate) struct Filled { vertex: Vec<(u32, vk::Buffer, u64)>, @@ -2692,7 +2692,7 @@ pub(crate) struct Filled { } /// An encoder's facts and fields beside a find and fill of every slot ([`RenderCommandEncoder::refilled`]). -#[cfg(test)] +#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] pub(crate) struct Refilled { /// The facts and fields the encoder's draws left, found and filled slot by slot since the /// pipeline state was set. @@ -2706,7 +2706,7 @@ pub(crate) struct Refilled { pub(crate) held: Vec, } -#[cfg(test)] +#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] impl RenderCommandEncoder { /// Its facts and fields beside a find and fill of every slot of what is bound now. pub(crate) fn refilled(&self) -> Refilled {