summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/options.rst5
-rw-r--r--video/out/d3d11/context.c10
-rw-r--r--video/out/d3d11/context.h4
-rw-r--r--video/out/gpu_next/context.c1
4 files changed, 20 insertions, 0 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index 801383d943..14d848ec56 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -5767,6 +5767,11 @@ them.
from Windows 10. Thus on older systems it will only automatically
utilize the rgba8 output format.
+ .. note::
+
+ For ``--vo=gpu-next``, this is used as a best-effort hint and
+ libplacebo has the last say on which format is utilized.
+
``--d3d11-output-csp=<auto|srgb|linear|pq|bt.2020>``
Select a specific D3D11 output color space to utilize for D3D11 rendering.
"auto" is the default, which will select the color space of the desktop
diff --git a/video/out/d3d11/context.c b/video/out/d3d11/context.c
index 96d37ff5d5..6b7f475b4b 100644
--- a/video/out/d3d11/context.c
+++ b/video/out/d3d11/context.c
@@ -521,6 +521,16 @@ IDXGISwapChain *ra_d3d11_ctx_get_swapchain(struct ra_ctx *ra)
return p->swapchain;
}
+bool ra_d3d11_ctx_prefer_8bit_output_format(struct ra_ctx *ra)
+{
+ if (ra->swapchain->fns != &d3d11_swapchain)
+ return false;
+
+ struct priv *p = ra->priv;
+
+ return p->opts->output_format == DXGI_FORMAT_R8G8B8A8_UNORM;
+}
+
const struct ra_ctx_fns ra_ctx_d3d11 = {
.type = "d3d11",
.name = "d3d11",
diff --git a/video/out/d3d11/context.h b/video/out/d3d11/context.h
index 8a9ef4cc0d..25488f2cbd 100644
--- a/video/out/d3d11/context.h
+++ b/video/out/d3d11/context.h
@@ -7,3 +7,7 @@
// 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);
+
+// Returns true if an 8-bit output format is explicitly requested for
+// d3d11-output-format for an RA context.
+bool ra_d3d11_ctx_prefer_8bit_output_format(struct ra_ctx *ra);
diff --git a/video/out/gpu_next/context.c b/video/out/gpu_next/context.c
index 2887cff938..75d3a47056 100644
--- a/video/out/gpu_next/context.c
+++ b/video/out/gpu_next/context.c
@@ -88,6 +88,7 @@ static bool d3d11_pl_init(struct vo *vo, struct gpu_ctx *ctx,
ctx->swapchain = pl_d3d11_create_swapchain(d3d11,
pl_d3d11_swapchain_params(
.swapchain = swapchain,
+ .disable_10bit_sdr = ra_d3d11_ctx_prefer_8bit_output_format(ctx->ra_ctx),
)
);
if (!ctx->swapchain) {