@@ -112,7 +112,7 @@ impl Example {
112
112
sample_count,
113
113
dimension : wgpu:: TextureDimension :: D2 ,
114
114
format : config. view_formats [ 0 ] ,
115
- usage : wgpu:: TextureUsages :: RENDER_ATTACHMENT ,
115
+ usage : wgpu:: TextureUsages :: RENDER_ATTACHMENT | wgpu :: TextureUsages :: TRANSIENT ,
116
116
label : None ,
117
117
view_formats : & [ ] ,
118
118
} ;
@@ -128,6 +128,10 @@ impl crate::framework::Example for Example {
128
128
wgpu:: Features :: TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES
129
129
}
130
130
131
+ fn required_features ( ) -> wgpu:: Features {
132
+ wgpu:: Features :: TRANSIENT_ATTACHMENTS
133
+ }
134
+
131
135
fn init (
132
136
config : & wgpu:: SurfaceConfiguration ,
133
137
_adapter : & wgpu:: Adapter ,
@@ -214,6 +218,17 @@ impl crate::framework::Example for Example {
214
218
}
215
219
}
216
220
221
+ fn resize (
222
+ & mut self ,
223
+ config : & wgpu:: SurfaceConfiguration ,
224
+ device : & wgpu:: Device ,
225
+ _queue : & wgpu:: Queue ,
226
+ ) {
227
+ self . config = config. clone ( ) ;
228
+ self . multisampled_framebuffer =
229
+ Example :: create_multisampled_framebuffer ( device, config, self . sample_count ) ;
230
+ }
231
+
217
232
#[ expect( clippy:: single_match) ]
218
233
fn update ( & mut self , event : winit:: event:: WindowEvent ) {
219
234
match event {
@@ -246,17 +261,6 @@ impl crate::framework::Example for Example {
246
261
}
247
262
}
248
263
249
- fn resize (
250
- & mut self ,
251
- config : & wgpu:: SurfaceConfiguration ,
252
- device : & wgpu:: Device ,
253
- _queue : & wgpu:: Queue ,
254
- ) {
255
- self . config = config. clone ( ) ;
256
- self . multisampled_framebuffer =
257
- Example :: create_multisampled_framebuffer ( device, config, self . sample_count ) ;
258
- }
259
-
260
264
fn render ( & mut self , view : & wgpu:: TextureView , device : & wgpu:: Device , queue : & wgpu:: Queue ) {
261
265
if self . rebuild_bundle {
262
266
self . bundle = Example :: create_bundle (
0 commit comments