mirror of
https://github.com/utmapp/virglrenderer.git
synced 2026-12-01 14:02:17 -10:00
Metal does not have the concept of sharing GPU resources between processes so we have to do rendering in the same process that handles the commands. When 'thread' render server worker is selected, we will now support init with !VIRGL_RENDERER_RENDER_SERVER by creating a new thread in the host process to act as the server.
56 lines
970 B
C
56 lines
970 B
C
/*
|
|
* Copyright 2021 Google LLC
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#ifndef RENDER_CONTEXT_H
|
|
#define RENDER_CONTEXT_H
|
|
|
|
#include "render_common.h"
|
|
|
|
#include <stdatomic.h>
|
|
|
|
struct render_context {
|
|
uint32_t ctx_id;
|
|
struct render_socket socket;
|
|
struct list_head head;
|
|
|
|
char *name;
|
|
size_t name_len;
|
|
|
|
int shmem_fd;
|
|
size_t shmem_size;
|
|
void *shmem_ptr;
|
|
atomic_uint *shmem_timelines;
|
|
|
|
int timeline_count;
|
|
|
|
bool in_process;
|
|
|
|
/* optional */
|
|
int fence_eventfd;
|
|
};
|
|
|
|
struct render_context_args {
|
|
bool valid;
|
|
bool in_process;
|
|
|
|
uint32_t init_flags;
|
|
|
|
uint32_t ctx_id;
|
|
char ctx_name[32];
|
|
|
|
/* render_context_main always takes ownership even on errors */
|
|
int ctx_fd;
|
|
};
|
|
|
|
bool
|
|
render_context_main(const struct render_context_args *args);
|
|
|
|
void
|
|
render_context_update_timeline(struct render_context *ctx,
|
|
uint32_t ring_idx,
|
|
uint32_t val);
|
|
|
|
#endif /* RENDER_CONTEXT_H */
|