✅ Expect the float depth upload and the table kernel rt now makes

metal2vulkan a8c1acc9a1 makes an upload into a 32-bit float depth the
device's copy into the depth aspect, and makes the pipeline of a kernel
that calls through a visible function table bound at a buffer index. The
plane copy test now uploads 0.5, a value every device keeps exactly, and
reads it back with no gap refusal counted; the PVRTC rows stay unbuilt.
The function table test now expects table_kernel's pipeline made and
table_arg_kernel's, whose table is in an argument buffer, still refused
under rt-refused-translation. The guest's function-pointer answer is
unchanged: it stays NO until the table calls are routed.
This commit is contained in:
Anees Iqbal committed 2026-11-22 23:02:09 -08:00
1 parent c332f2b155
commit 09d9615fa2
2 files changed
+21 -25

No files matched your search

@@ -1101,8 +1101,10 @@ mod tests {
assert_eq!(read(&stencil_out, 16), written);
assert_eq!((counted(gap), counted(unbuilt)), before);
// A depth in, and PVRTC rows: nothing copied, counted.
let depth_in = buffer(&[0; 64]);
// A depth in, the device's copy into the depth plane (a value within [0, 1] kept exactly
// on every device); then PVRTC rows: not copied, counted.
let half: Vec<u8> = (0..16).flat_map(|_| 0.5f32.to_le_bytes()).collect();
let depth_in = buffer(&half);
let (depth_out, stencil_out) = (buffer(&[0xee; 64]), buffer(&[0xee; 16]));
let cmds = vec![
plane(true, &depth_in, &both, depth),
@@ -1111,12 +1113,9 @@ mod tests {
plane(false, &stencil_out, &both, stencil),
];
assert_eq!(blit(&queue, cmds), done);
assert_eq!(read(&depth_out, 64), quarter);
assert_eq!(read(&depth_out, 64), half);
assert_eq!(read(&stencil_out, 16), written);
assert_eq!(
(counted(gap), counted(unbuilt)),
(before.0 + 1, before.1 + 1)
);
assert_eq!((counted(gap), counted(unbuilt)), (before.0, before.1 + 1));
}
/// Blits on the GPU the test holds: buffer fills, a pattern of one byte value among them,
@@ -186,8 +186,8 @@ mod tests {
use reims_vgpu_graphics::wire::{
RGFX_CMD_FUNCTION_TABLE_SET, RGFX_CMD_LIBRARY_CREATE, RGFX_LIBRARY_BYTES_OFFSET,
RGFX_LINKED_PRIVATE_FUNCTIONS, RGFX_PIPELINE_REFUSED, RgfxComputePipelineCreate,
RgfxLibraryCreate, RgfxLinkedFunction,
RGFX_LINKED_PRIVATE_FUNCTIONS, RGFX_PIPELINE_OK, RGFX_PIPELINE_REFUSED,
RgfxComputePipelineCreate, RgfxLibraryCreate, RgfxLinkedFunction,
};
use reims_vgpu_vulkan::core::platform::Handle as _;
use reims_vgpu_vulkan::core::testkit::FakePlatform;
@@ -468,29 +468,26 @@ mod tests {
(answers, replies.lock().clone())
}
/// On the rt platform the pipelines of kernels that call through the guest's visible function
/// tables are refused, each answered refused and counted under rt's code: `table_kernel`'s,
/// which reads an input rt's compute encoder does not supply yet (`rt-refused-gap`), and
/// `table_arg_kernel`'s, which holds its table in an argument buffer, a resource bound
/// through a descriptor, which rt's translator makes none of (`rt-refused-translation`). (On
/// the AMD Radeon Pro 5300M they call the functions their pipelines link through a table the
/// guest made and set, bound at a buffer index or held by its resource id in an argument
/// buffer: measured, macOS 26.7.1, oracle_fnptr, 11 22 13 26 15 16 and, with useResource:,
/// 20 12 24 14 28 30.)
/// On the rt platform the pipeline of a kernel that calls through a visible function table
/// the encoder binds at a buffer index is made: `table_kernel`'s, linking the functions the
/// guest's tables would hold. The pipeline of a kernel that holds its table in an argument
/// buffer is refused, answered refused and counted under rt's code: `table_arg_kernel`'s,
/// a resource bound through a descriptor, which rt's translator makes none of
/// (`rt-refused-translation`). (On the AMD Radeon Pro 5300M both call the functions their
/// pipelines link through a table the guest made and set, bound at a buffer index or held by
/// its resource id in an argument buffer: measured, macOS 26.7.1, oracle_fnptr, 11 22 13 26
/// 15 16 and, with useResource:, 20 12 24 14 28 30.)
#[test]
fn on_vulkan_rt_refuses_the_kernels_that_call_through_the_guest_s_tables() {
fn on_vulkan_rt_makes_a_table_kernel_and_refuses_one_holding_its_table_in_an_argument_buffer() {
let counted = || ["rt-refused-gap", "rt-refused-translation"].map(crate::platform::counted);
let before = counted();
let (answers, replies) = table_pipelines::<reims_vgpu_vulkan::RtPlatform>();
assert_eq!(
answers,
[Err(DecodeError::Refused), Err(DecodeError::Refused)]
);
assert_eq!(answers, [Ok(()), Err(DecodeError::Refused)]);
assert_eq!(
replies,
[(100, RGFX_PIPELINE_REFUSED), (101, RGFX_PIPELINE_REFUSED)]
[(100, RGFX_PIPELINE_OK), (101, RGFX_PIPELINE_REFUSED)]
);
let after = counted();
assert_eq!([after[0] - before[0], after[1] - before[1]], [1, 1]);
assert_eq!([after[0] - before[0], after[1] - before[1]], [0, 1]);
}
}