Fix msaa-line example's unnecessary MSAA data store

This commit is contained in:
Jinlei Li authored and Dzmitry Malyshau committed 2022-01-25 09:09:06 -05:00
1 parent 39a0256bcb
commit 77b2c25684
1 file changed
+10 -6
+10 -6
View File
@@ -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,
},
}
};