Fix the Bed texture gone missing issue on AMD systems

patch picked from PrusaSlicer, thanks to Prusa3D

Windows specific: Use mipmaps generated through OpenGL for AMD graphics cards with drivers newer than 22.6.1.

Since AMD driver version 22.7.1,
there is probably some bug in the driver that causes the issue with the missing texture of the bed.
It seems that this issue only triggers when mipmaps are generated manually (combined with a texture compression)
and when mipmaps are generated through OpenGL glGenerateMipmap is working.

This workaround detects the AMD driver version and generates mipmaps through OpenGL for driver versions newer than 22.6.1.

Change-Id: I679dd61efec8f4baf97e5bf4868cb93db5184dcf
This commit is contained in:
lane.wei 2022-09-15 19:44:04 +08:00 committed by Lane.Wei
parent bf927f5adc
commit cb3c9503d0
3 changed files with 35 additions and 3 deletions

View file

@ -84,6 +84,7 @@ private:
static EMultisampleState s_multisample;
static EFramebufferType s_framebuffers_type;
static bool m_use_manually_generated_mipmaps;
public:
OpenGLManager() = default;
~OpenGLManager();
@ -100,6 +101,7 @@ public:
static EFramebufferType get_framebuffers_type() { return s_framebuffers_type; }
static wxGLCanvas* create_wxglcanvas(wxWindow& parent);
static const GLInfo& get_gl_info() { return s_gl_info; }
static bool use_manually_generated_mipmaps() { return m_use_manually_generated_mipmaps; }
private:
static void detect_multisample(int* attribList);