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

Fix GLES2 shader storage support

This commit is contained in:
Logan McNaughton 2018-03-27 19:59:08 -06:00 committed by Sergey Lipskiy
parent b6b4083982
commit ee906a217c
2 changed files with 14 additions and 8 deletions

View File

@ -2238,8 +2238,10 @@ graphics::CombinerProgram * CombinerProgramBuilder::buildCombinerProgram(Combine
else
glAttachShader(program, bUseTextures ? m_vertexShaderTexturedTriangle : m_vertexShaderTriangle);
glAttachShader(program, fragmentShader);
if (CombinerInfo::get().isShaderCacheSupported())
glProgramParameteri(program, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE);
if (CombinerInfo::get().isShaderCacheSupported()) {
if (IS_GL_FUNCTION_VALID(glProgramParameteri))
glProgramParameteri(program, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE);
}
glLinkProgram(program);
assert(Utils::checkProgramLinkStatus(program));
glDeleteShader(fragmentShader);

View File

@ -64,11 +64,6 @@ void GLInfo::init() {
bufferStorage = (!isGLESX && (numericVersion >= 44)) || Utils::isExtensionSupported(*this, "GL_ARB_buffer_storage") ||
Utils::isExtensionSupported(*this, "GL_EXT_buffer_storage");
#ifdef EGL
if (isGLESX && bufferStorage)
g_glBufferStorage = (PFNGLBUFFERSTORAGEPROC) eglGetProcAddress("glBufferStorageEXT");
#endif
texStorage = (isGLESX && (numericVersion >= 30)) || (!isGLESX && numericVersion >= 42) ||
Utils::isExtensionSupported(*this, "GL_ARB_texture_storage");
@ -77,12 +72,21 @@ void GLInfo::init() {
const char * strGetProgramBinary = isGLESX
? "GL_OES_get_program_binary"
: "GL_ARB_get_program_binary";
if (Utils::isExtensionSupported(*this, strGetProgramBinary)) {
if ((isGLESX && numericVersion >= 30) || (!isGLESX && numericVersion >= 41) || Utils::isExtensionSupported(*this, strGetProgramBinary)) {
GLint numBinaryFormats = 0;
glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &numBinaryFormats);
shaderStorage = numBinaryFormats > 0;
}
}
#ifdef EGL
if (isGLESX && bufferStorage)
g_glBufferStorage = (PFNGLBUFFERSTORAGEPROC) eglGetProcAddress("glBufferStorageEXT");
if (isGLES2 && shaderStorage) {
g_glProgramBinary = (PFNGLPROGRAMBINARYPROC) eglGetProcAddress("glProgramBinaryOES");
g_glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC) eglGetProcAddress("glGetProgramBinaryOES");
}
#endif
#ifndef OS_ANDROID
if (isGLES2 && config.frameBufferEmulation.copyToRDRAM > Config::ctSync) {
config.frameBufferEmulation.copyToRDRAM = Config::ctDisable;