Skip to content

Commit 16661df

Browse files
committed
Reformat and stuff
1 parent 9ae5125 commit 16661df

2 files changed

Lines changed: 25 additions & 13 deletions

File tree

src/conv.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,9 @@ pub fn map_display_hdr_info(info: wgt::DisplayHdrInfo) -> native::WGPUDisplayHdr
10521052
let coarse = match info.coarse {
10531053
Some(c) => {
10541054
let (has_gamut, gamut) = match c.gamut {
1055-
Some(wgt::DisplayGamut::Srgb) => (true as native::WGPUBool, native::WGPUDisplayGamut_Srgb),
1055+
Some(wgt::DisplayGamut::Srgb) => {
1056+
(true as native::WGPUBool, native::WGPUDisplayGamut_Srgb)
1057+
}
10561058
Some(wgt::DisplayGamut::DisplayP3) => {
10571059
(true as native::WGPUBool, native::WGPUDisplayGamut_DisplayP3)
10581060
}
@@ -1104,9 +1106,11 @@ pub fn map_load_op<T>(
11041106
//
11051107
// SAFETY: `DontCare` was explicitly requested by the C caller, opting in
11061108
// to its documented undefined-contents semantics at their own risk.
1107-
other if other == native::WGPULoadOp_DontCare as native::WGPULoadOp => Some(
1108-
wgc::command::LoadOp::DontCare(unsafe { wgt::LoadOpDontCare::enabled() }),
1109-
),
1109+
other if other == native::WGPULoadOp_DontCare as native::WGPULoadOp => {
1110+
Some(wgc::command::LoadOp::DontCare(unsafe {
1111+
wgt::LoadOpDontCare::enabled()
1112+
}))
1113+
}
11101114
_ => None,
11111115
}
11121116
}
@@ -2306,7 +2310,9 @@ pub fn map_surface_color_space(cs: native::WGPUSurfaceColorSpace) -> wgt::Surfac
23062310
native::WGPUSurfaceColorSpace_Bt2100Pq => wgt::SurfaceColorSpace::Bt2100Pq,
23072311
native::WGPUSurfaceColorSpace_Bt2100Hlg => wgt::SurfaceColorSpace::Bt2100Hlg,
23082312
native::WGPUSurfaceColorSpace_ExtendedSrgb => wgt::SurfaceColorSpace::ExtendedSrgb,
2309-
native::WGPUSurfaceColorSpace_ExtendedDisplayP3 => wgt::SurfaceColorSpace::ExtendedDisplayP3,
2313+
native::WGPUSurfaceColorSpace_ExtendedDisplayP3 => {
2314+
wgt::SurfaceColorSpace::ExtendedDisplayP3
2315+
}
23102316
// WGPUSurfaceColorSpace_Auto and any unknown value.
23112317
_ => wgt::SurfaceColorSpace::Auto,
23122318
}

src/lib.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use utils::{
2727
string_view_into_label, string_view_into_str, texture_format_has_depth,
2828
};
2929
use wgc::{
30-
command::{bundle_ffi, ComputePass, RenderPass},
30+
command::{ComputePass, RenderPass},
3131
id, resource, Label,
3232
};
3333

@@ -3869,10 +3869,11 @@ pub unsafe extern "C" fn wgpuRenderBundleEncoderDrawIndirect(
38693869
let encoder = encoder.expect("invalid render bundle");
38703870
let encoder = encoder.as_mut().unwrap();
38713871

3872-
let _ =
3873-
bundle
3874-
.context
3875-
.render_bundle_encoder_draw_indirect(encoder, indirect_buffer_id, indirect_offset);
3872+
let _ = bundle.context.render_bundle_encoder_draw_indirect(
3873+
encoder,
3874+
indirect_buffer_id,
3875+
indirect_offset,
3876+
);
38763877
}
38773878

38783879
#[no_mangle]
@@ -3895,8 +3896,7 @@ pub unsafe extern "C-unwind" fn wgpuRenderBundleEncoderFinish(
38953896

38963897
// v30 takes the encoder by `&mut` instead of consuming it; the `Box` is
38973898
// still dropped at end of scope, freeing the reclaimed raw pointer.
3898-
let (render_bundle_id, error) =
3899-
context.render_bundle_encoder_finish(&mut encoder, &desc, None);
3899+
let (render_bundle_id, error) = context.render_bundle_encoder_finish(&mut encoder, &desc, None);
39003900
if let Some(cause) = error {
39013901
handle_error_fatal(cause, "wgpuRenderBundleEncoderFinish");
39023902
}
@@ -5416,7 +5416,13 @@ pub unsafe extern "C" fn wgpuRenderBundleEncoderSetImmediates(
54165416
let encoder = encoder.expect("invalid render bundle");
54175417
let encoder = encoder.as_mut().unwrap();
54185418

5419-
bundle_ffi::wgpu_render_bundle_set_immediates(encoder, offset, size, data);
5419+
if let Err(cause) = bundle.context.render_bundle_encoder_set_immediates(
5420+
encoder,
5421+
offset,
5422+
make_slice(data, size as usize),
5423+
) {
5424+
handle_error_fatal(cause, "wgpuRenderBundleEncoderSetImmediates");
5425+
}
54205426
}
54215427

54225428
#[no_mangle]

0 commit comments

Comments
 (0)