Add a note that OpenVR overlays assume unpremultiplied alpha by default

This commit is contained in:
Sam Lantinga
2025-10-06 11:58:21 -07:00
parent ce1175724a
commit 87e3250518

View File

@@ -654,6 +654,14 @@ static bool OPENVR_InitializeOverlay(SDL_VideoDevice *_this,SDL_Window *window)
videodata->oOverlay->SetOverlayFlag(videodata->overlayID, 1<<23, true); //vr::VROverlayFlags_EnableControlBar
videodata->oOverlay->SetOverlayFlag(videodata->overlayID, 1<<24, true); //vr::VROverlayFlags_EnableControlBarKeyboard
videodata->oOverlay->SetOverlayFlag(videodata->overlayID, 1<<25, true); //vr::VROverlayFlags_EnableControlBarClose
#if 0
/* OpenVR overlays assume unpremultiplied alpha by default, set this flag to tag the source buffer as premultiplied.
* Note that (as of 2025) OpenVR overlay composition is higher quality when premultiplied buffers are provided,
* as texture samplers that blend energy (such as bilinear) do not yield sensical results when operating on natively
* unpremultiplied textures. It is thus preferable to hand openvr natively premultiplied buffers when accurate
* sampling / composition is required. */
videodata->oOverlay->SetOverlayFlag(videodata->overlayID, VROverlayFlags_IsPremultiplied, true );
#endif
videodata->oOverlay->SetOverlayName(videodata->overlayID, window->title);
videodata->bDidCreateOverlay = true;