Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshot taken always from the main window backbuffer on MacOS/Metal #3249

Open
alemuntoni opened this issue Feb 8, 2024 · 0 comments
Open
Labels

Comments

@alemuntoni
Copy link

alemuntoni commented Feb 8, 2024

I was trying to capture screenshots from multiple windows, and I encountered unexpected behavior on MacOS (using the Metal backend).

When I invoke bgfx::requestScreenShot(fbh, "screen");, it appears that the back buffer of the main window is always used, regardless of the value of fbh.

You can reproduce the issue by adding the following lines in the window loop of the 22-windows example:

if (m_frame % 300 == 0) {
    uint32_t cnt = m_frame / 300;
    std::string filename = "temp/frame_" + std::to_string(cnt) + "_" + std::to_string(ii);
    bgfx::requestScreenShot(m_fbh[ii], filename.c_str());
}

were m_frame is just a frame counter.

Modified example here and diff here.

The screenshot capturing works as expected on Windows (using DX11) and Linux (using Vulkan), but on MacOS, all the screenshots are taken from the main window.

This is the patch: screenshot.patch.zip

@bkaradzic bkaradzic added the bug label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants