1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Correct GLInfo initialization.

This commit is contained in:
Sergey Lipskiy 2017-01-17 21:39:02 +07:00
parent 5757b646f3
commit 97ba028a6c
2 changed files with 22 additions and 18 deletions

View File

@ -21,23 +21,26 @@ void GLInfo::init() {
LOG(LOG_VERBOSE, "%s major version: %d\n", isGLESX ? "OpenGL ES" : "OpenGL", majorVersion);
LOG(LOG_VERBOSE, "%s minor version: %d\n", isGLESX ? "OpenGL ES" : "OpenGL", minorVersion);
if (isGLES2)
imageTextures = false;
else if (isGLESX)
imageTextures = (majorVersion >= 3) && (minorVersion >= 1) && (glBindImageTexture != nullptr);
else
imageTextures = (((majorVersion >= 4) && (minorVersion >= 3)) || Utils::isExtensionSupported("GL_ARB_shader_image_load_store")) && (glBindImageTexture != nullptr);
if (isGLES2) {
imageTextures = false;
msaa = false;
} else if (isGLESX) {
imageTextures = (majorVersion * 10 + minorVersion >= 31) && (glBindImageTexture != nullptr);
msaa = majorVersion * 10 + minorVersion >= 31;
} else {
imageTextures = ((majorVersion * 10 + minorVersion >= 43) || Utils::isExtensionSupported("GL_ARB_shader_image_load_store")) && (glBindImageTexture != nullptr);
msaa = true;
}
#ifdef GL_NUM_PROGRAM_BINARY_FORMATS
GLint numBinaryFormats = 0;
glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &numBinaryFormats);
const char * strGetProgramBinary = isGLESX
? "GL_OES_get_program_binary"
: "GL_ARB_get_program_binary";
shaderStorage = numBinaryFormats > 0 &&
config.generalEmulation.enableShadersStorage != 0 &&
Utils::isExtensionSupported(strGetProgramBinary);
#else
shaderStorage =false;
#endif
shaderStorage = false;
if (config.generalEmulation.enableShadersStorage != 0) {
const char * strGetProgramBinary = isGLESX
? "GL_OES_get_program_binary"
: "GL_ARB_get_program_binary";
if (Utils::isExtensionSupported(strGetProgramBinary)) {
GLint numBinaryFormats = 0;
glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &numBinaryFormats);
shaderStorage = numBinaryFormats > 0;
}
}
}

View File

@ -10,6 +10,7 @@ namespace opengl {
bool isGLESX = false;
bool imageTextures = false;
bool shaderStorage = false;
bool msaa = false;
void init();
};