summaryrefslogtreecommitdiff
path: root/src/render/renderer_libplacebo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/renderer_libplacebo.c')
-rw-r--r--src/render/renderer_libplacebo.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/render/renderer_libplacebo.c b/src/render/renderer_libplacebo.c
index 80a71a6..704aebe 100644
--- a/src/render/renderer_libplacebo.c
+++ b/src/render/renderer_libplacebo.c
@@ -15,7 +15,7 @@
#ifdef AL_DEBUG
// vkQueueSubmit2: VK_ERROR_VALIDATION_FAILED_EXT leads to an annoying deadlock.
-#define RENDERER_DEBUG 0
+#define RENDERER_DEBUG 1
#else
#define RENDERER_DEBUG 0
#endif
@@ -433,7 +433,7 @@ static bool renderer_lp_render(struct camu_renderer *renderer, struct camu_scree
enum {
RESULT_SUBMIT = 1,
- RESULT_SUBMIT_AND_WAIT = 1 << 1
+ RESULT_WAIT = 1 << 1
};
u8 result = 0;
@@ -447,8 +447,8 @@ static bool renderer_lp_render(struct camu_renderer *renderer, struct camu_scree
if (camu_video_buffer_read(video->buf, &mix, &weighted)) {
// If mix.frames is NULL, read() returned QUEUE_MORE.
if (mix.frames) {
- // weighted is only set when read() returns QUEUE_OK.
- result |= (1 | 1 << weighted);
+ // weighted can only be set when read() returns QUEUE_OK.
+ result |= (RESULT_SUBMIT | (RESULT_WAIT * weighted));
// Terrible hack. Lets us distinguish static video buffers with the same dimensions.
// Tied to a libplacebo patch to consider info_priv in the hash.
intptr_t hash = (intptr_t)video->buf;
@@ -493,9 +493,15 @@ static bool renderer_lp_render(struct camu_renderer *renderer, struct camu_scree
*/
#ifdef CRT_BACKGROUND
if (!lr->frame_cleared) {
- clear_color[0] = 0.03f;
- clear_color[1] = 0.03f;
- clear_color[2] = 0.03f;
+ if (lr->params.background != PL_CLEAR_SKIP) {
+ clear_color[0] = 0.025f;
+ clear_color[1] = 0.025f;
+ clear_color[2] = 0.025f;
+ } else {
+ clear_color[0] = 0.f;
+ clear_color[1] = 0.f;
+ clear_color[2] = 0.f;
+ }
pl_frame_clear_rgba(lr->gpu, &lr->target, clear_color);
lr->frame_cleared = true;
}
@@ -554,7 +560,7 @@ static bool renderer_lp_render(struct camu_renderer *renderer, struct camu_scree
log_trace("swap_buffers(), (interval: %f).", tick - lr->last_swap_tick);
lr->last_swap_tick = tick;
- if (result & RESULT_SUBMIT_AND_WAIT) {
+ if (result & RESULT_WAIT) {
pl_gpu_finish(lr->gpu);
}
@@ -564,6 +570,10 @@ static bool renderer_lp_render(struct camu_renderer *renderer, struct camu_scree
void renderer_lp_free(struct camu_renderer **renderer)
{
struct camu_renderer_lp *lr = (struct camu_renderer_lp *)*renderer;
+#ifdef CAMU_HAVE_SUBTITLES
+ if (lr->ass) ass_library_done(lr->ass);
+#endif
+ if (lr->vr_emulation_hook[0]) pl_mpv_user_shader_destroy(&lr->vr_emulation_hook[0]);
if (lr->renderer) pl_renderer_destroy(&lr->renderer);
if (lr->swapchain) pl_swapchain_destroy(&lr->swapchain);
#if defined STELA_API_VULKAN
@@ -578,10 +588,6 @@ void renderer_lp_free(struct camu_renderer **renderer)
if (lr->gl) pl_opengl_destroy(&lr->gl);
#endif
if (lr->logger) pl_log_destroy(&lr->logger);
- if (lr->vr_emulation_hook[0]) pl_mpv_user_shader_destroy(&lr->vr_emulation_hook[0]);
-#ifdef CAMU_HAVE_SUBTITLES
- if (lr->ass) ass_library_done(lr->ass);
-#endif
al_free(lr);
*renderer = NULL;
}