mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-02 05:12:02 +00:00
[client] egl: fix streamed texture post-processing race
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
This commit is contained in:
@@ -431,12 +431,14 @@ bool egl_desktopUpdate(EGL_Desktop * desktop, const FrameBuffer * frame, int dma
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Streamed textures trigger post-processing when the render context submits
|
||||||
|
* the upload. Signalling here can race with that submission and process the
|
||||||
|
* previous texture contents instead.
|
||||||
|
*/
|
||||||
if (likely(egl_textureUpdateFromFrame(desktop->texture, frame,
|
if (likely(egl_textureUpdateFromFrame(desktop->texture, frame,
|
||||||
damageRects, damageRectsCount)))
|
damageRects, damageRectsCount)))
|
||||||
{
|
|
||||||
atomic_store(&desktop->processFrame, true);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -474,8 +476,9 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth,
|
|||||||
if (unlikely(outputWidth == 0 || outputHeight == 0))
|
if (unlikely(outputWidth == 0 || outputHeight == 0))
|
||||||
DEBUG_FATAL("outputWidth || outputHeight == 0");
|
DEBUG_FATAL("outputWidth || outputHeight == 0");
|
||||||
|
|
||||||
enum EGL_TexStatus status;
|
const enum EGL_TexStatus status = egl_textureProcess(tex);
|
||||||
if (unlikely((status = egl_textureProcess(tex)) != EGL_TEX_STATUS_OK))
|
const bool textureUpdated = status == EGL_TEX_STATUS_UPDATED;
|
||||||
|
if (unlikely(status != EGL_TEX_STATUS_OK && !textureUpdated))
|
||||||
{
|
{
|
||||||
if (status != EGL_TEX_STATUS_NOTREADY)
|
if (status != EGL_TEX_STATUS_NOTREADY)
|
||||||
DEBUG_ERROR("Failed to process the desktop texture");
|
DEBUG_ERROR("Failed to process the desktop texture");
|
||||||
@@ -501,8 +504,9 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth,
|
|||||||
HDR_PEAK_LUMINANCE_MIN, HDR_PEAK_LUMINANCE_MAX);
|
HDR_PEAK_LUMINANCE_MIN, HDR_PEAK_LUMINANCE_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool processFrame = atomic_exchange(&desktop->processFrame, false) ||
|
bool processFrame = textureUpdated;
|
||||||
egl_postProcessConfigModified(desktop->pp);
|
processFrame |= atomic_exchange(&desktop->processFrame, false);
|
||||||
|
processFrame |= egl_postProcessConfigModified(desktop->pp);
|
||||||
if (processFrame &&
|
if (processFrame &&
|
||||||
egl_postProcessRun(desktop->pp, tex, desktop->mesh,
|
egl_postProcessRun(desktop->pp, tex, desktop->mesh,
|
||||||
width, height, outputWidth, outputHeight, dma,
|
width, height, outputWidth, outputHeight, dma,
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ typedef enum EGL_TexStatus
|
|||||||
{
|
{
|
||||||
EGL_TEX_STATUS_NOTREADY,
|
EGL_TEX_STATUS_NOTREADY,
|
||||||
EGL_TEX_STATUS_OK,
|
EGL_TEX_STATUS_OK,
|
||||||
|
EGL_TEX_STATUS_UPDATED,
|
||||||
EGL_TEX_STATUS_ERROR
|
EGL_TEX_STATUS_ERROR
|
||||||
}
|
}
|
||||||
EGL_TexStatus;
|
EGL_TexStatus;
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ EGL_TexStatus egl_texBufferStreamProcess(EGL_Texture * texture)
|
|||||||
if (keepLocked)
|
if (keepLocked)
|
||||||
LG_UNLOCK(this->copyLock);
|
LG_UNLOCK(this->copyLock);
|
||||||
|
|
||||||
return EGL_TEX_STATUS_OK;
|
return EGL_TEX_STATUS_UPDATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
EGL_TexStatus egl_texBufferStreamGet(EGL_Texture * texture, GLuint * tex,
|
EGL_TexStatus egl_texBufferStreamGet(EGL_Texture * texture, GLuint * tex,
|
||||||
|
|||||||
Reference in New Issue
Block a user