File tree 5 files changed +12
-0
lines changed
5 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1715,6 +1715,7 @@ sigs = {
1715
1715
wgpuSurfaceGetPreferredFormat__sig : 'ipp' ,
1716
1716
wgpuSurfaceReference__sig : 'vp' ,
1717
1717
wgpuSurfaceRelease__sig : 'vp' ,
1718
+ wgpuSwapChainGetCurrentTexture__sig : 'pp' ,
1718
1719
wgpuSwapChainGetCurrentTextureView__sig : 'pp' ,
1719
1720
wgpuSwapChainPresent__sig : 'vp' ,
1720
1721
wgpuSwapChainReference__sig : 'vp' ,
Original file line number Diff line number Diff line change @@ -2710,6 +2710,10 @@ var LibraryWebGPU = {
2710
2710
return WebGPU . mgrSwapChain . create ( context ) ;
2711
2711
} ,
2712
2712
2713
+ wgpuSwapChainGetCurrentTexture : ( swapChainId ) => {
2714
+ var context = WebGPU . mgrSwapChain . get ( swapChainId ) ;
2715
+ return WebGPU . mgrTexture . create ( context [ "getCurrentTexture" ] ( ) ) ;
2716
+ } ,
2713
2717
wgpuSwapChainGetCurrentTextureView : ( swapChainId ) => {
2714
2718
var context = WebGPU . mgrSwapChain . get ( swapChainId ) ;
2715
2719
return WebGPU . mgrTextureView . create ( context [ "getCurrentTexture" ] ( ) [ "createView" ] ( ) ) ;
Original file line number Diff line number Diff line change @@ -1537,6 +1537,7 @@ typedef void (*WGPUProcSurfaceReference)(WGPUSurface surface) WGPU_FUNCTION_ATTR
1537
1537
typedef void (* WGPUProcSurfaceRelease )(WGPUSurface surface ) WGPU_FUNCTION_ATTRIBUTE ;
1538
1538
1539
1539
// Procs of SwapChain
1540
+ typedef WGPUTexture (* WGPUProcSwapChainGetCurrentTexture )(WGPUSwapChain swapChain ) WGPU_FUNCTION_ATTRIBUTE ;
1540
1541
typedef WGPUTextureView (* WGPUProcSwapChainGetCurrentTextureView )(WGPUSwapChain swapChain ) WGPU_FUNCTION_ATTRIBUTE ;
1541
1542
typedef void (* WGPUProcSwapChainPresent )(WGPUSwapChain swapChain ) WGPU_FUNCTION_ATTRIBUTE ;
1542
1543
typedef void (* WGPUProcSwapChainReference )(WGPUSwapChain swapChain ) WGPU_FUNCTION_ATTRIBUTE ;
@@ -1775,6 +1776,7 @@ WGPU_EXPORT void wgpuSurfaceReference(WGPUSurface surface) WGPU_FUNCTION_ATTRIBU
1775
1776
WGPU_EXPORT void wgpuSurfaceRelease (WGPUSurface surface ) WGPU_FUNCTION_ATTRIBUTE ;
1776
1777
1777
1778
// Methods of SwapChain
1779
+ WGPU_EXPORT WGPUTexture wgpuSwapChainGetCurrentTexture (WGPUSwapChain swapChain ) WGPU_FUNCTION_ATTRIBUTE ;
1778
1780
WGPU_EXPORT WGPUTextureView wgpuSwapChainGetCurrentTextureView (WGPUSwapChain swapChain ) WGPU_FUNCTION_ATTRIBUTE ;
1779
1781
WGPU_EXPORT void wgpuSwapChainPresent (WGPUSwapChain swapChain ) WGPU_FUNCTION_ATTRIBUTE ;
1780
1782
WGPU_EXPORT void wgpuSwapChainReference (WGPUSwapChain swapChain ) WGPU_FUNCTION_ATTRIBUTE ;
Original file line number Diff line number Diff line change @@ -1137,6 +1137,7 @@ namespace wgpu {
1137
1137
using ObjectBase::ObjectBase;
1138
1138
using ObjectBase::operator =;
1139
1139
1140
+ Texture GetCurrentTexture () const ;
1140
1141
TextureView GetCurrentTextureView () const ;
1141
1142
void Present () const ;
1142
1143
Original file line number Diff line number Diff line change @@ -2585,6 +2585,10 @@ template <typename T>
2585
2585
static_assert (sizeof (SwapChain) == sizeof (WGPUSwapChain), " sizeof mismatch for SwapChain" );
2586
2586
static_assert (alignof(SwapChain) == alignof(WGPUSwapChain), " alignof mismatch for SwapChain" );
2587
2587
2588
+ Texture SwapChain::GetCurrentTexture () const {
2589
+ auto result = wgpuSwapChainGetCurrentTexture (Get ());
2590
+ return Texture::Acquire (result);
2591
+ }
2588
2592
TextureView SwapChain::GetCurrentTextureView () const {
2589
2593
auto result = wgpuSwapChainGetCurrentTextureView (Get ());
2590
2594
return TextureView::Acquire (result);
You can’t perform that action at this time.
0 commit comments