BUGZ-753: bad skyboxes on intel GPUs

This commit is contained in:
Brad Davis 2019-07-16 13:42:39 -07:00
parent bee8ba489a
commit 11f47ddeed
3 changed files with 18 additions and 2 deletions

View file

@ -26,13 +26,19 @@ size_t evalGLFormatSwapchainPixelSize(const QSurfaceFormat& format) {
return pixelSize;
}
static bool FORCE_DISABLE_OPENGL_45 = false;
void gl::setDisableGl45(bool disable) {
FORCE_DISABLE_OPENGL_45 = disable;
}
bool gl::disableGl45() {
#if defined(USE_GLES)
return false;
#else
static const QString DEBUG_FLAG("HIFI_DISABLE_OPENGL_45");
static bool disableOpenGL45 = QProcessEnvironment::systemEnvironment().contains(DEBUG_FLAG);
return disableOpenGL45;
return FORCE_DISABLE_OPENGL_45 || disableOpenGL45;
#endif
}
@ -202,6 +208,15 @@ uint16_t gl::getAvailableVersion() {
return;
}
gl::initModuleGl();
std::string glvendor{ (const char*)glGetString(GL_VENDOR) };
std::transform(glvendor.begin(), glvendor.end(), glvendor.begin(), ::tolower);
// Intel has *notoriously* buggy DSA implementations, especially around cubemaps
if (std::string::npos != glvendor.find("intel")) {
gl::setDisableGl45(true);
}
wglMakeCurrent(0, 0);
hGLRC.reset();
if (!wglChoosePixelFormatARB || !wglCreateContextAttribsARB) {

View file

@ -55,6 +55,7 @@ namespace gl {
bool checkGLErrorDebug(const char* name);
bool disableGl45();
void setDisableGl45(bool disable);
uint16_t getTargetVersion();

View file

@ -6,7 +6,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/")
link_hifi_libraries(
shared task networking gl
ktx shaders gpu procedural octree image
graphics model-networking fbx hfm animation
graphics model-networking fbx hfm animation material-networking
script-engine render render-utils
${PLATFORM_GL_BACKEND}
)