mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 20:45:43 +00:00
* fix(display): copy the game and the window above it in one GPU submit When a game's frames go on the layer-copy path and a window sits above the game, each scene copied the game frame and then the window above it with two separate submits and two CPU waits. Each wait queued behind the game's own GPU work, so a GPU-bound game lost on-screen frames to the second wait. Record both copies in one command buffer, merge their release fences, and wait once per scene. The zero-copy path and the single-layer copy path are unchanged. * Check overlay eligibility against the frame's own game geometry and keep both release waits when a fence merge fails
58 lines
2.1 KiB
C
58 lines
2.1 KiB
C
#ifndef SC_LAYER_H
|
|
#define SC_LAYER_H
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <android/hardware_buffer.h>
|
|
|
|
struct vkp_image;
|
|
struct vkp_draw;
|
|
struct droiddeck_color;
|
|
struct vkp_hdr_frame;
|
|
|
|
enum sc_layer_id { SC_LAYER_GAME = 0, SC_LAYER_OVERLAY = 1, SC_LAYER_COUNT = 2 };
|
|
|
|
int sc_layer_available(void);
|
|
#define SC_LAYER_AHB_USAGE_VENDOR_UBWC (1ULL << 28)
|
|
int sc_layer_ahb_fd(AHardwareBuffer *ahb, uint64_t need);
|
|
|
|
void sc_layer_probe_dmabuf_fd(int fd);
|
|
|
|
int sc_layer_can_tag_hdr(void);
|
|
void sc_layer_hdr_symbols(char *out, size_t size);
|
|
|
|
|
|
int sc_layer_present(struct vkp_image *src, int scene_w, int scene_h, const struct vkp_draw *draw,
|
|
const struct droiddeck_color *color, const struct vkp_draw *over, int *over_shown);
|
|
|
|
int sc_layer_present_pass(const struct vkp_draw *draws, int n, int scene_w, int scene_h);
|
|
int sc_layer_present_generated(const struct vkp_draw *draws, int n_draws, const struct vkp_hdr_frame *hf,
|
|
int scene_w, int scene_h, int composed, const struct droiddeck_color *color);
|
|
|
|
int sc_layer_present_hdr_scene(const struct vkp_draw *draws, int n, const struct vkp_hdr_frame *hf,
|
|
int scene_w, int scene_h, const struct droiddeck_color *color);
|
|
|
|
int sc_layer_present_ahb(AHardwareBuffer *ahb, int w, int h, int acquire_fd, void *token,
|
|
int scene_w, int scene_h, const struct vkp_draw *draw, const struct droiddeck_color *color, uint32_t ahb_format);
|
|
|
|
void sc_layer_set_frame_rate(float fps);
|
|
|
|
int sc_layer_overlay_affordable(void);
|
|
|
|
int sc_layer_queues(void);
|
|
|
|
int sc_layer_present_overlay(struct vkp_image *src, const int geo[8], int translucent);
|
|
|
|
void sc_layer_hide(void);
|
|
int sc_layer_base_black(int width, int height);
|
|
void sc_layer_hide_base(void);
|
|
void sc_layer_hide_overlay(void);
|
|
|
|
void sc_layer_window_gone(void);
|
|
|
|
void sc_layer_frame_timeline(int64_t present_ns, int64_t deadline_ns, int64_t period_ns);
|
|
void sc_layer_aim_take(unsigned *next, unsigned *later, unsigned *even);
|
|
unsigned sc_layer_frames_take(void);
|
|
unsigned sc_layer_drops_take(void);
|
|
|
|
#endif
|