Two faults found on the first run against a real DXGI multi-monitor host, each of which left the composed view black while every geometry check passed: - Compose setup ran on the frame thread via onFrameFormat, but the VAO and FBO it creates are container objects that only exist in the creating context. The render thread drew with empty ones. Setup is now deferred to the render thread and picked up before the next draw (composeSetupPending), and a post-process pass is forced afterwards so a frame that arrived before setup completed is not presented stale. - A DMA-imported atlas is an external image and must be sampled with samplerExternalOES. Compose only compiled the plain sampler2D variant, so the DMA path sampled black. Both variants are now compiled and setup selects one, mirroring what the desktop shaders already do. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WxYTZ8oBdHX3YrHGgdLKwC
64 lines
2.2 KiB
C
64 lines
2.2 KiB
C
/**
|
|
* Looking Glass
|
|
* Copyright © 2017-2026 The Looking Glass Authors
|
|
* https://looking-glass.io
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the Free
|
|
* Software Foundation; either version 2 of the License, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, write to the Free Software Foundation, Inc., 59
|
|
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "texture.h"
|
|
#include "interface/renderer.h"
|
|
|
|
/* Composes a packed multi-display atlas frame into a single image of the
|
|
* guest's virtual desktop, or of one display within it.
|
|
*
|
|
* Running this as its own pass, rather than folding it into the desktop
|
|
* shader, keeps every stage downstream (post processing, HDR handling, the
|
|
* cursor, damage tracking and input mapping) working on one conventional
|
|
* frame. Those stages then need no knowledge of multi-display at all. */
|
|
|
|
typedef struct EGL_Compose EGL_Compose;
|
|
|
|
bool egl_composeInit(EGL_Compose ** compose);
|
|
void egl_composeFree(EGL_Compose ** compose);
|
|
|
|
/**
|
|
* Configure the composition for a frame format.
|
|
*
|
|
* Returns false if the format cannot be composed, in which case the caller
|
|
* should fall back to presenting the raw atlas rather than showing nothing.
|
|
*/
|
|
bool egl_composeSetup(EGL_Compose * compose, const LG_RendererFormat * format,
|
|
bool useDMA);
|
|
|
|
/**
|
|
* Compose `atlas` into the configured view.
|
|
*
|
|
* Returns the composed texture, or NULL if composition is not configured or
|
|
* failed, in which case the caller should present the atlas unchanged.
|
|
*/
|
|
EGL_Texture * egl_composeRun(EGL_Compose * compose, EGL_Texture * atlas);
|
|
|
|
/**
|
|
* The dimensions of the composed output. Only valid after a successful
|
|
* egl_composeSetup.
|
|
*/
|
|
void egl_composeGetSize(EGL_Compose * compose,
|
|
unsigned int * width, unsigned int * height);
|