mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
Add init_textures_reference
This commit is contained in:
parent
4f016b2c2c
commit
a4c9c738b8
@ -546,25 +546,6 @@ static void gl_init_textures_data(gl_t *gl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl_init_textures_reference(gl_t *gl, unsigned i,
|
|
||||||
GLenum internal_fmt, GLenum texture_fmt, GLenum texture_type)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_PSGL
|
|
||||||
glTextureReferenceSCE(GL_TEXTURE_2D, 1,
|
|
||||||
gl->tex_w, gl->tex_h, 0,
|
|
||||||
internal_fmt,
|
|
||||||
gl->tex_w * gl->base_size,
|
|
||||||
gl->tex_w * gl->tex_h * i * gl->base_size);
|
|
||||||
#else
|
|
||||||
if (gl->egl_images)
|
|
||||||
return;
|
|
||||||
|
|
||||||
gl_load_texture_image(GL_TEXTURE_2D,
|
|
||||||
0, internal_fmt, gl->tex_w, gl->tex_h, 0, texture_type,
|
|
||||||
texture_fmt, gl->empty_buf ? gl->empty_buf : NULL);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gl_init_textures(gl_t *gl, const video_info_t *video)
|
static void gl_init_textures(gl_t *gl, const video_info_t *video)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
@ -620,8 +601,10 @@ static void gl_init_textures(gl_t *gl, const video_info_t *video)
|
|||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl->tex_mag_filter);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl->tex_mag_filter);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl->tex_min_filter);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl->tex_min_filter);
|
||||||
|
|
||||||
gl_init_textures_reference(gl, i, internal_fmt,
|
if (gl->renderchain_driver->init_texture_reference)
|
||||||
texture_fmt, texture_type);
|
gl->renderchain_driver->init_texture_reference(
|
||||||
|
gl, i, internal_fmt,
|
||||||
|
texture_fmt, texture_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||||
|
@ -1432,7 +1432,34 @@ static void gl2_renderchain_fence_free(void *data)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void gl2_renderchain_init_textures_reference(
|
||||||
|
void *data, unsigned i,
|
||||||
|
unsigned internal_fmt, unsigned texture_fmt,
|
||||||
|
unsigned texture_type)
|
||||||
|
{
|
||||||
|
gl_t *gl = (gl_t*)data;
|
||||||
|
#ifdef HAVE_PSGL
|
||||||
|
glTextureReferenceSCE(GL_TEXTURE_2D, 1,
|
||||||
|
gl->tex_w, gl->tex_h, 0,
|
||||||
|
(GLenum)internal_fmt,
|
||||||
|
gl->tex_w * gl->base_size,
|
||||||
|
gl->tex_w * gl->tex_h * i * gl->base_size);
|
||||||
|
#else
|
||||||
|
if (gl->egl_images)
|
||||||
|
return;
|
||||||
|
|
||||||
|
gl_load_texture_image(GL_TEXTURE_2D,
|
||||||
|
0,
|
||||||
|
(GLenum)internal_fmt,
|
||||||
|
gl->tex_w, gl->tex_h, 0,
|
||||||
|
(GLenum)texture_type,
|
||||||
|
(GLenum)texture_fmt,
|
||||||
|
gl->empty_buf ? gl->empty_buf : NULL);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
gl_renderchain_driver_t gl2_renderchain = {
|
gl_renderchain_driver_t gl2_renderchain = {
|
||||||
|
gl2_renderchain_init_textures_reference,
|
||||||
#ifdef HAVE_OPENGLES
|
#ifdef HAVE_OPENGLES
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -827,6 +827,10 @@ typedef struct d3d_renderchain_driver
|
|||||||
|
|
||||||
typedef struct gl_renderchain_driver
|
typedef struct gl_renderchain_driver
|
||||||
{
|
{
|
||||||
|
void (*init_texture_reference)(
|
||||||
|
void *data, unsigned i,
|
||||||
|
unsigned internal_fmt, unsigned texture_fmt,
|
||||||
|
unsigned texture_type);
|
||||||
void (*fence_iterate)(void *data, unsigned hard_sync_frames);
|
void (*fence_iterate)(void *data, unsigned hard_sync_frames);
|
||||||
void (*fence_free)(void *data);
|
void (*fence_free)(void *data);
|
||||||
void (*readback)(void *data,
|
void (*readback)(void *data,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user