[client] render: reduce software surface queue overhead

This commit is contained in:
Geoffrey McRae
2026-08-12 03:40:06 +10:00
parent f9a60bd2d1
commit f68bf8f0d5
4 changed files with 233 additions and 183 deletions

View File

@@ -1936,34 +1936,32 @@ static void swSurfaceDrawFill(LG_VideoSource source, int x, int y,
int width, int height, uint32_t color)
{
LG_LOCK(g_state.videoSourceLock);
if (!swSurfaceEventAdmitted(source))
{
LG_UNLOCK(g_state.videoSourceLock);
return;
}
const bool admitted = swSurfaceEventAdmitted(source);
const uint64_t generation = admitted ? atomic_load_explicit(
&g_state.videoSource[source].generation, memory_order_acquire) : 0;
LG_UNLOCK(g_state.videoSourceLock);
if (!admitted)
return;
const uint64_t generation = atomic_load_explicit(
&g_state.videoSource[source].generation, memory_order_acquire);
renderQueue_sourceSwSurfaceDrawFill(renderQueueSource(source), generation,
x, y, width, height, color);
LG_UNLOCK(g_state.videoSourceLock);
}
static void swSurfaceDrawBitmap(LG_VideoSource source, bool topDown,
int x, int y, int width, int height, int stride, const void * data)
{
LG_LOCK(g_state.videoSourceLock);
if (!swSurfaceEventAdmitted(source))
{
LG_UNLOCK(g_state.videoSourceLock);
return;
}
const bool admitted = swSurfaceEventAdmitted(source);
const uint64_t generation = admitted ? atomic_load_explicit(
&g_state.videoSource[source].generation, memory_order_acquire) : 0;
LG_UNLOCK(g_state.videoSourceLock);
if (!admitted)
return;
const uint64_t generation = atomic_load_explicit(
&g_state.videoSource[source].generation, memory_order_acquire);
renderQueue_sourceSwSurfaceDrawBitmap(renderQueueSource(source), generation,
x, y, width, height, stride, data, topDown);
LG_UNLOCK(g_state.videoSourceLock);
}
static void swSurfacePointer(LG_VideoSource source,