Skip to content

Commit 6da57dd

Browse files
authored
Add type annotation to render pass code, for rust-analyzer. (#2773)
This is a workaround for a limitation in rust-analyzer: rust-lang/rust-analyzer#12247
1 parent 915be10 commit 6da57dd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

wgpu-core/src/command/render.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {
730730
let mut depth_stencil = None;
731731

732732
if let Some(at) = depth_stencil_attachment {
733-
let view = cmd_buf
733+
let view: &TextureView<A> = cmd_buf
734734
.trackers
735735
.views
736736
.add_single(&*view_guard, at.view)
@@ -840,7 +840,7 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {
840840
}
841841

842842
for at in color_attachments {
843-
let color_view = cmd_buf
843+
let color_view: &TextureView<A> = cmd_buf
844844
.trackers
845845
.views
846846
.add_single(&*view_guard, at.view)
@@ -870,7 +870,7 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {
870870

871871
let mut hal_resolve_target = None;
872872
if let Some(resolve_target) = at.resolve_target {
873-
let resolve_view = cmd_buf
873+
let resolve_view: &TextureView<A> = cmd_buf
874874
.trackers
875875
.views
876876
.add_single(&*view_guard, resolve_target)
@@ -1191,7 +1191,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
11911191
);
11921192
dynamic_offset_count += num_dynamic_offsets as usize;
11931193

1194-
let bind_group = cmd_buf
1194+
let bind_group: &crate::binding_model::BindGroup<A> = cmd_buf
11951195
.trackers
11961196
.bind_groups
11971197
.add_single(&*bind_group_guard, bind_group_id)
@@ -1255,7 +1255,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
12551255
let scope = PassErrorScope::SetPipelineRender(pipeline_id);
12561256
state.pipeline = Some(pipeline_id);
12571257

1258-
let pipeline = cmd_buf
1258+
let pipeline: &pipeline::RenderPipeline<A> = cmd_buf
12591259
.trackers
12601260
.render_pipelines
12611261
.add_single(&*render_pipeline_guard, pipeline_id)

0 commit comments

Comments
 (0)