From 1b39748b2b4b88f2991b64c21addd1abd38a3421 Mon Sep 17 00:00:00 2001 From: Misaki Kasumi Date: Fri, 17 May 2024 13:41:07 +0800 Subject: [PATCH] renderer: add option "no_compute" to forcibly disable the use of compute shaders --- src/include/libplacebo/renderer.h | 4 ++++ src/options.c | 1 + 2 files changed, 5 insertions(+) diff --git a/src/include/libplacebo/renderer.h b/src/include/libplacebo/renderer.h index 25025bee..f52a0ea6 100644 --- a/src/include/libplacebo/renderer.h +++ b/src/include/libplacebo/renderer.h @@ -349,6 +349,10 @@ struct pl_render_params { // user, but it should be set to false once those values are "dialed in". bool dynamic_constants; + // Disables the use of compute shaders. + // Can improve power saving and (even) performance on certain GPUs. + bool no_compute; + // This callback is invoked for every pass successfully executed in the // process of rendering a frame. Optional. // diff --git a/src/options.c b/src/options.c index 828cbafe..6702240a 100644 --- a/src/options.c +++ b/src/options.c @@ -1160,6 +1160,7 @@ const struct pl_opt_t pl_option_list[] = { OPT_BOOL("disable_fbos", "Disable FBOs", params.disable_fbos), OPT_BOOL("force_low_bit_depth_fbos", "Force 8-bit FBOs", params.force_low_bit_depth_fbos), OPT_BOOL("dynamic_constants", "Dynamic constants", params.dynamic_constants), + OPT_BOOL("no_compute", "Disable compute shaders", params.no_compute), {0}, };