@@ -1214,7 +1214,7 @@ def create_view(
12141214 )
12151215 id = _lib .wgpu_texture_create_view (self ._internal , struct )
12161216
1217- return base .GPUTextureView (label , id , self ._device , self )
1217+ return base .GPUTextureView (label , id , self ._device , self , self . texture_size )
12181218
12191219 # wgpu.help('texturedestroy', dev=True)
12201220 def destroy (self ):
@@ -1811,19 +1811,20 @@ def __enter__(self):
18111811 # Get the current texture view, and make sure it is presented when done
18121812 self ._create_native_swap_chain_if_needed ()
18131813 sc_output = _lib .wgpu_swap_chain_get_next_texture (self ._internal )
1814- if sc_output .status == _lib .WGPUSwapChainStatus_Good :
1814+ status , view_id = sc_output .status , sc_output .view_id
1815+ if status == _lib .WGPUSwapChainStatus_Good :
18151816 pass
1816- elif sc_output . status == _lib .WGPUSwapChainStatus_Suboptimal : # no-cover
1817+ elif status == _lib .WGPUSwapChainStatus_Suboptimal : # no-cover
18171818 if not getattr (self , "_warned_swap_chain_suboptimal" , False ):
18181819 logger .warning (f"Swap chain status of { self } is suboptimal" )
18191820 self ._warned_swap_chain_suboptimal = True
18201821 else : # no-cover
1821- status = sc_output .status
18221822 status_str = swap_chain_status_map .get (status , "" )
18231823 raise RuntimeError (
18241824 f"Swap chain status is not good: { status_str } ({ status } )"
18251825 )
1826- return base .GPUTextureView ("swap_chain" , sc_output .view_id , self ._device , None )
1826+ size = self ._surface_size [0 ], self ._surface_size [1 ], 1
1827+ return base .GPUTextureView ("swap_chain" , view_id , self ._device , None , size )
18271828
18281829 def __exit__ (self , type , value , tb ):
18291830 # Present the current texture
0 commit comments