gallium/noop: implement fences

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>
This commit is contained in:
Marek Olšák
2021-08-06 02:36:09 -04:00
committed by Marge Bot
parent 59fe704c45
commit f2c04c9378

View File

@@ -310,8 +310,13 @@ static void noop_flush(struct pipe_context *ctx,
struct pipe_fence_handle **fence,
unsigned flags)
{
if (fence)
*fence = NULL;
if (fence) {
struct pipe_reference *f = MALLOC_STRUCT(pipe_reference);
f->count = 1;
ctx->screen->fence_reference(ctx->screen, fence, NULL);
*fence = (struct pipe_fence_handle*)f;
}
}
static void noop_destroy_context(struct pipe_context *ctx)
@@ -488,6 +493,11 @@ static void noop_fence_reference(struct pipe_screen *screen,
struct pipe_fence_handle **ptr,
struct pipe_fence_handle *fence)
{
if (pipe_reference((struct pipe_reference*)*ptr,
(struct pipe_reference*)fence))
FREE(*ptr);
*ptr = fence;
}
static bool noop_fence_finish(struct pipe_screen *screen,