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:
parent
b6b4083982
commit
ee906a217c
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user