Fix EGL context sharing
It seems contexts must be part of the same display to be shared, and that using default display with window isn't an issue on Windows/X11
This commit is contained in:
@@ -71,6 +71,7 @@ namespace Nz::GL
|
||||
|
||||
std::unordered_set<std::string> m_supportedPlatformExtensions;
|
||||
EGLContext m_handle;
|
||||
bool m_ownsDisplay;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ namespace Nz::GL
|
||||
m_loader(loader),
|
||||
m_display(EGL_NO_DISPLAY),
|
||||
m_surface(EGL_NO_SURFACE),
|
||||
m_handle(EGL_NO_CONTEXT)
|
||||
m_handle(EGL_NO_CONTEXT),
|
||||
m_ownsDisplay(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,11 +20,13 @@ namespace Nz::GL
|
||||
{
|
||||
public:
|
||||
EGLLoader();
|
||||
~EGLLoader() = default;
|
||||
~EGLLoader();
|
||||
|
||||
std::unique_ptr<Context> CreateContext(const OpenGLDevice* device, const ContextParams& params, Context* shareContext) const override;
|
||||
std::unique_ptr<Context> CreateContext(const OpenGLDevice* device, const ContextParams& params, WindowHandle handle, Context* shareContext) const override;
|
||||
|
||||
inline EGLDisplay GetDefaultDisplay() const;
|
||||
|
||||
GLFunction LoadFunction(const char* name) const override;
|
||||
|
||||
#define NAZARA_OPENGLRENDERER_FUNC(name, sig) sig name = nullptr;
|
||||
@@ -40,6 +42,7 @@ namespace Nz::GL
|
||||
static const char* TranslateError(EGLint errorId);
|
||||
|
||||
private:
|
||||
EGLDisplay m_defaultDisplay;
|
||||
DynLib m_eglLib;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,8 +5,12 @@
|
||||
#include <Nazara/OpenGLRenderer/Wrapper/EGL/EGLLoader.hpp>
|
||||
#include <Nazara/OpenGLRenderer/Debug.hpp>
|
||||
|
||||
namespace Nz::Vk
|
||||
namespace Nz::GL
|
||||
{
|
||||
inline EGLDisplay EGLLoader::GetDefaultDisplay() const
|
||||
{
|
||||
return m_defaultDisplay;
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/OpenGLRenderer/DebugOff.hpp>
|
||||
|
||||
Reference in New Issue
Block a user