File tree Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ pub fn op_webgpu_surface_get_current_texture(
96
96
97
97
match output. status {
98
98
wgpu_types:: SurfaceStatus :: Good | wgpu_types:: SurfaceStatus :: Suboptimal => {
99
- let id = output. texture_id . unwrap ( ) ;
99
+ let id = output. texture . unwrap ( ) ;
100
100
let rid = state. resource_table . add ( crate :: texture:: WebGpuTexture {
101
101
instance : instance. clone ( ) ,
102
102
id,
Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ impl GlobalPlay for wgc::global::Global {
289
289
Action :: GetSurfaceTexture { id, parent_id } => {
290
290
self . surface_get_current_texture ( parent_id, Some ( id) )
291
291
. unwrap ( )
292
- . texture_id
292
+ . texture
293
293
. unwrap ( ) ;
294
294
}
295
295
Action :: CreateBindGroupLayout ( id, desc) => {
Original file line number Diff line number Diff line change @@ -103,17 +103,13 @@ impl From<WaitIdleError> for ConfigureSurfaceError {
103
103
}
104
104
}
105
105
106
- #[ derive( Debug ) ]
107
- pub struct ResolvedSurfaceOutput {
108
- pub status : Status ,
109
- pub texture : Option < Arc < resource:: Texture > > ,
110
- }
106
+ pub type ResolvedSurfaceOutput = SurfaceOutput < Arc < resource:: Texture > > ;
111
107
112
108
#[ repr( C ) ]
113
109
#[ derive( Debug ) ]
114
- pub struct SurfaceOutput {
110
+ pub struct SurfaceOutput < T = id :: TextureId > {
115
111
pub status : Status ,
116
- pub texture_id : Option < id :: TextureId > ,
112
+ pub texture : Option < T > ,
117
113
}
118
114
119
115
impl Surface {
@@ -337,7 +333,10 @@ impl Global {
337
333
. texture
338
334
. map ( |texture| fid. assign ( resource:: Fallible :: Valid ( texture) ) ) ;
339
335
340
- Ok ( SurfaceOutput { status, texture_id } )
336
+ Ok ( SurfaceOutput {
337
+ status,
338
+ texture : texture_id,
339
+ } )
341
340
}
342
341
343
342
pub fn surface_present ( & self , surface_id : id:: SurfaceId ) -> Result < Status , SurfaceError > {
Original file line number Diff line number Diff line change @@ -3484,7 +3484,10 @@ impl dispatch::SurfaceInterface for CoreSurface {
3484
3484
. into ( ) ;
3485
3485
3486
3486
match self . context . 0 . surface_get_current_texture ( self . id , None ) {
3487
- Ok ( wgc:: present:: SurfaceOutput { status, texture_id } ) => {
3487
+ Ok ( wgc:: present:: SurfaceOutput {
3488
+ status,
3489
+ texture : texture_id,
3490
+ } ) => {
3488
3491
let data = texture_id
3489
3492
. map ( |id| CoreTexture {
3490
3493
context : self . context . clone ( ) ,
You can’t perform that action at this time.
0 commit comments