Skip to content

Commit f2dfad4

Browse files
committed
backend: Add support for deferred backends
So we can eg. init Gamescope headlessly then transition into a backend that only uses SAMPLED modifiers like SteamVR. This way we can init VRWebHelper in a Gamescope before SteamVR fully comes up.
1 parent c411208 commit f2dfad4

File tree

12 files changed

+589
-54
lines changed

12 files changed

+589
-54
lines changed

src/Backends/DRMBackend.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ void finish_drm(struct drm_t *drm)
15231523
// page-flip handler thread.
15241524
}
15251525

1526-
gamescope::OwningRc<gamescope::IBackendFb> drm_fbid_from_dmabuf( struct drm_t *drm, struct wlr_buffer *buf, struct wlr_dmabuf_attributes *dma_buf )
1526+
gamescope::OwningRc<gamescope::IBackendFb> drm_fbid_from_dmabuf( struct drm_t *drm, struct wlr_dmabuf_attributes *dma_buf )
15271527
{
15281528
gamescope::OwningRc<gamescope::IBackendFb> pBackendFb;
15291529
uint32_t fb_id = 0;
@@ -2525,7 +2525,7 @@ drm_prepare_liftoff( struct drm_t *drm, const struct FrameInfo_t *frameInfo, boo
25252525
if ( i < frameInfo->layerCount )
25262526
{
25272527
const FrameInfo_t::Layer_t *pLayer = &frameInfo->layers[ i ];
2528-
gamescope::CDRMFb *pDrmFb = static_cast<gamescope::CDRMFb *>( pLayer->tex ? pLayer->tex->GetBackendFb() : nullptr );
2528+
gamescope::CDRMFb *pDrmFb = static_cast<gamescope::CDRMFb *>( pLayer->tex ? pLayer->tex->GetBackendFb()->Unwrap() : nullptr );
25292529

25302530
if ( pDrmFb == nullptr )
25312531
{
@@ -3710,9 +3710,9 @@ namespace gamescope
37103710
return std::make_shared<BackendBlob>( data, uBlob, true );
37113711
}
37123712

3713-
virtual OwningRc<IBackendFb> ImportDmabufToBackend( wlr_buffer *pBuffer, wlr_dmabuf_attributes *pDmaBuf ) override
3713+
virtual OwningRc<IBackendFb> ImportDmabufToBackend( wlr_dmabuf_attributes *pDmaBuf ) override
37143714
{
3715-
return drm_fbid_from_dmabuf( &g_DRM, pBuffer, pDmaBuf );
3715+
return drm_fbid_from_dmabuf( &g_DRM, pDmaBuf );
37163716
}
37173717

37183718
virtual bool UsesModifiers() const override

0 commit comments

Comments
 (0)