Another project
0

Configure Feed

Select the types of activity you want to include in your feed.

at main 962 B View raw
1use bone_render::{IconInstance, IconPipeline, Style}; 2 3mod common; 4 5use common::{extent_square, make_context}; 6 7#[test] 8fn icon_pipeline_draws_visible_pixels() { 9 let extent = extent_square(64); 10 let ctx = make_context(extent); 11 let mut pipeline = IconPipeline::new(ctx.gpu(), ctx.color_format()); 12 13 let style = Style::light(); 14 let Ok(cleared) = ctx.render_clear(&style) else { 15 panic!("render_clear failed"); 16 }; 17 18 let viewport_px = [64.0, 64.0]; 19 let instance = IconInstance::new([8.0, 8.0, 48.0, 48.0], 0, [1.0, 1.0, 1.0, 1.0]); 20 pipeline.upload(viewport_px, &[instance]); 21 ctx.render_passes(|encoder, color, _pick, _depth| { 22 pipeline.draw_range(encoder, color, 0..1); 23 }); 24 let Ok(drawn) = ctx.capture() else { 25 panic!("capture failed"); 26 }; 27 28 assert_ne!( 29 cleared.rgba(), 30 drawn.rgba(), 31 "icon draw left the framebuffer unchanged; shader or sampling regressed", 32 ); 33}