Skip to content

Commit

Permalink
Add type annotation to render pass code, for rust-analyzer. (#2773)
Browse files Browse the repository at this point in the history
This is a workaround for a limitation in rust-analyzer:
rust-lang/rust-analyzer#12247
  • Loading branch information
jimblandy authored Jun 15, 2022
1 parent 915be10 commit 6da57dd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wgpu-core/src/command/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {
let mut depth_stencil = None;

if let Some(at) = depth_stencil_attachment {
let view = cmd_buf
let view: &TextureView<A> = cmd_buf
.trackers
.views
.add_single(&*view_guard, at.view)
Expand Down Expand Up @@ -840,7 +840,7 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {
}

for at in color_attachments {
let color_view = cmd_buf
let color_view: &TextureView<A> = cmd_buf
.trackers
.views
.add_single(&*view_guard, at.view)
Expand Down Expand Up @@ -870,7 +870,7 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {

let mut hal_resolve_target = None;
if let Some(resolve_target) = at.resolve_target {
let resolve_view = cmd_buf
let resolve_view: &TextureView<A> = cmd_buf
.trackers
.views
.add_single(&*view_guard, resolve_target)
Expand Down Expand Up @@ -1191,7 +1191,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
);
dynamic_offset_count += num_dynamic_offsets as usize;

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

let pipeline = cmd_buf
let pipeline: &pipeline::RenderPipeline<A> = cmd_buf
.trackers
.render_pipelines
.add_single(&*render_pipeline_guard, pipeline_id)
Expand Down

0 comments on commit 6da57dd

Please sign in to comment.