diff --git a/crates/reims-vgpu-vulkan/src/rt_platform/blit.rs b/crates/reims-vgpu-vulkan/src/rt_platform/blit.rs index 590d7bc45..d1c872911 100644 --- a/crates/reims-vgpu-vulkan/src/rt_platform/blit.rs +++ b/crates/reims-vgpu-vulkan/src/rt_platform/blit.rs @@ -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 = (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, diff --git a/crates/reims-vgpu/src/graphics/decode/function_table.rs b/crates/reims-vgpu/src/graphics/decode/function_table.rs index b4b9e371a..a1dad92c8 100644 --- a/crates/reims-vgpu/src/graphics/decode/function_table.rs +++ b/crates/reims-vgpu/src/graphics/decode/function_table.rs @@ -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::(); - 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]); } }