mirror of https://github.com/mpv-player/mpv
vo_gpu/d3d11: enable access to the underlying ra_ctx swap chain
This enables us to utilize it from gpu-next.
This commit is contained in:
parent
3c4b8433dc
commit
13d0df7c21
|
@ -24,6 +24,7 @@
|
||||||
#include "video/out/gpu/d3d11_helpers.h"
|
#include "video/out/gpu/d3d11_helpers.h"
|
||||||
#include "video/out/gpu/spirv.h"
|
#include "video/out/gpu/spirv.h"
|
||||||
#include "video/out/w32_common.h"
|
#include "video/out/w32_common.h"
|
||||||
|
#include "context.h"
|
||||||
#include "ra_d3d11.h"
|
#include "ra_d3d11.h"
|
||||||
|
|
||||||
static int d3d11_validate_adapter(struct mp_log *log,
|
static int d3d11_validate_adapter(struct mp_log *log,
|
||||||
|
@ -526,6 +527,18 @@ error:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IDXGISwapChain *ra_d3d11_ctx_get_swapchain(struct ra_ctx *ra)
|
||||||
|
{
|
||||||
|
if (ra->swapchain->fns != &d3d11_swapchain)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
struct priv *p = ra->priv;
|
||||||
|
|
||||||
|
IDXGISwapChain_AddRef(p->swapchain);
|
||||||
|
|
||||||
|
return p->swapchain;
|
||||||
|
}
|
||||||
|
|
||||||
const struct ra_ctx_fns ra_ctx_d3d11 = {
|
const struct ra_ctx_fns ra_ctx_d3d11 = {
|
||||||
.type = "d3d11",
|
.type = "d3d11",
|
||||||
.name = "d3d11",
|
.name = "d3d11",
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <dxgi.h>
|
||||||
|
|
||||||
|
#include "video/out/gpu/context.h"
|
||||||
|
|
||||||
|
// Get the underlying D3D11 swap chain from an RA context. The returned swap chain is
|
||||||
|
// refcounted and must be released by the caller.
|
||||||
|
IDXGISwapChain *ra_d3d11_ctx_get_swapchain(struct ra_ctx *ra);
|
Loading…
Reference in New Issue