Update GLSM

This commit is contained in:
twinaphex 2018-10-06 17:05:06 +02:00
parent 9b68aa23a9
commit 31ba215c94
2 changed files with 18 additions and 2 deletions

View File

@ -200,6 +200,7 @@ struct gl_cached_state
int cap_translate[SGL_CAP_MAX];
};
static GLuint default_framebuffer;
static GLint glsm_max_textures;
struct retro_hw_render_callback hw_render;
static struct gl_cached_state gl_state;
@ -2094,6 +2095,18 @@ void rglTexStorage2D(GLenum target, GLsizei levels, GLenum internalFormat,
glTexStorage2D(target, levels, internalFormat, width, height);
#endif
}
/*
*
* Core in:
* OpenGL : 3.2
* OpenGLES : 3.2
*/
void rglDrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid *indices, GLint basevertex)
{
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) && defined(HAVE_OPENGLES_3_2)
glDrawRangeElementsBaseVertex(mode, start, end, count, type, indices, basevertex);
#endif
}
/*
*
@ -2585,7 +2598,8 @@ static void glsm_state_setup(void)
gl_state.bind_textures.ids = (GLuint*)calloc(glsm_max_textures, sizeof(GLuint));
gl_state.framebuf = hw_render.get_current_framebuffer();
default_framebuffer = glsm_get_current_framebuffer();
gl_state.framebuf = default_framebuffer;
gl_state.cullface.mode = GL_BACK;
gl_state.frontface.mode = GL_CCW;
@ -2643,7 +2657,7 @@ static void glsm_state_bind(void)
}
}
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, hw_render.get_current_framebuffer());
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, default_framebuffer);
if (gl_state.blendfunc.used)
glBlendFunc(

View File

@ -33,6 +33,7 @@ RETRO_BEGIN_DECLS
#define glTexCoord2f rglTexCoord2f
/* more forward-compatible GL subset symbols */
#define glDrawRangeElementsBaseVertex rglDrawRangeElementsBaseVertex
#define glProvokingVertex rglProvokingVertex
#define glGetInteger64v rglGetInteger64v
#define glGenSamplers rglGenSamplers
@ -471,6 +472,7 @@ void rglUniform2iv( GLint location,
GLsizei count,
const GLint *value);
void rglProvokingVertex( GLenum provokeMode);
void rglDrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid *indices, GLint basevertex);
RETRO_END_DECLS