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

opengl: fix Qt warnings #14249

Merged
merged 6 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions rpcs3/rpcs3qt/gl_gs_frame.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "gl_gs_frame.h"

#include "Emu/System.h"
#include "Emu/system_config.h"

#include <QOpenGLContext>
Expand Down Expand Up @@ -31,7 +32,11 @@ draw_context_t gl_gs_frame::make_context()
{
auto surface = new QOffscreenSurface();
surface->setFormat(m_format);
surface->create();
// Workaround for the Qt warning: "Attempting to create QWindow-based QOffscreenSurface outside the gui thread. Expect failures."
Emu.BlockingCallFromMainThread([&]()
{
surface->create();
oltolm marked this conversation as resolved.
Show resolved Hide resolved
});

// Share resources with the first created context
context->handle->setShareContext(m_primary_context->handle);
Expand Down Expand Up @@ -117,5 +122,8 @@ void gl_gs_frame::flip(draw_context_t context, bool skip_frame)

const auto gl_ctx = static_cast<GLContext*>(context);

gl_ctx->handle->swapBuffers(gl_ctx->surface);
if (auto window = dynamic_cast<QWindow*>(gl_ctx->surface); window && window->isExposed())
{
gl_ctx->handle->swapBuffers(gl_ctx->surface);
}
}
8 changes: 4 additions & 4 deletions rpcs3/util/vm_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace utils
#ifdef MAP_NORESERVE
constexpr int c_map_noreserve = MAP_NORESERVE;
#else
constexpr int c_map_noreserve = 0;
[[maybe_unused]] constexpr int c_map_noreserve = 0;
#endif

#ifdef MADV_FREE
Expand All @@ -66,7 +66,7 @@ namespace utils
#ifdef MADV_HUGEPAGE
constexpr int c_madv_hugepage = MADV_HUGEPAGE;
#else
constexpr int c_madv_hugepage = 0;
[[maybe_unused]] constexpr int c_madv_hugepage = 0;
#endif

#if defined(MADV_DONTDUMP) && defined(MADV_DODUMP)
Expand All @@ -76,8 +76,8 @@ namespace utils
constexpr int c_madv_no_dump = MADV_NOCORE;
constexpr int c_madv_dump = MADV_CORE;
#else
constexpr int c_madv_no_dump = 0;
constexpr int c_madv_dump = 0;
[[maybe_unused]] constexpr int c_madv_no_dump = 0;
[[maybe_unused]] constexpr int c_madv_dump = 0;
#endif

#if defined(MFD_HUGETLB) && defined(MFD_HUGE_2MB)
Expand Down