From a19cad56fd4988076baf30b91bac2b0951b55c27 Mon Sep 17 00:00:00 2001 From: Jinlei Li Date: Tue, 25 Jan 2022 17:25:59 +0800 Subject: [PATCH] Fix msaa-line example's unnecessary MSAA data store --- wgpu/examples/msaa-line/main.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wgpu/examples/msaa-line/main.rs b/wgpu/examples/msaa-line/main.rs index 529ac49a37..5178f32a27 100644 --- a/wgpu/examples/msaa-line/main.rs +++ b/wgpu/examples/msaa-line/main.rs @@ -250,21 +250,25 @@ impl framework::Example for Example { let mut encoder = device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None }); { - let ops = wgpu::Operations { - load: wgpu::LoadOp::Clear(wgpu::Color::BLACK), - store: true, - }; let rpass_color_attachment = if self.sample_count == 1 { wgpu::RenderPassColorAttachment { view, resolve_target: None, - ops, + ops: wgpu::Operations { + load: wgpu::LoadOp::Clear(wgpu::Color::BLACK), + store: true, + }, } } else { wgpu::RenderPassColorAttachment { view: &self.multisampled_framebuffer, resolve_target: Some(view), - ops, + ops: wgpu::Operations { + load: wgpu::LoadOp::Clear(wgpu::Color::BLACK), + // Storing pre-resolve MSAA data is unnecessary if it isn't used later. + // On tile-based GPU, avoid store can reduce your app's memory footprint. + store: false, + }, } };