Get rid of video_shader_driver_scale

This commit is contained in:
twinaphex 2019-02-03 17:39:25 +01:00
parent 85708b7ef8
commit 256b28fa2a
3 changed files with 20 additions and 34 deletions

View File

@ -1099,17 +1099,24 @@ static void gl2_renderchain_init(
video_driver_get_size(&width, &height);
scaler.idx = 1;
scaler.scale = &scale;
scale.valid = false;
scaler.idx = 1;
scaler.scale = &scale;
video_shader_driver_scale(&scaler);
if (gl->shader->shader_scale)
gl->shader->shader_scale(gl->shader_data,
1, scaler.scale);
scaler.idx = shader_info.num;
scaler.scale = &scale_last;
scale_last.valid = false;
scaler.idx = shader_info.num;
scaler.scale = &scale_last;
video_shader_driver_scale(&scaler);
if (gl->shader->shader_scale)
gl->shader->shader_scale(gl->shader_data,
shader_info.num, scaler.scale);
/* we always want FBO to be at least initialized on startup for consoles */
/* we always want FBO to be at least initialized
* on startup for consoles */
if (shader_info.num == 1 && !scale.valid)
return;
@ -1135,10 +1142,13 @@ static void gl2_renderchain_init(
for (i = 1; i < chain->fbo_pass; i++)
{
scaler.idx = i + 1;
scaler.scale = &chain->fbo_scale[i];
chain->fbo_scale[i].valid = false;
scaler.idx = i + 1;
scaler.scale = &chain->fbo_scale[i];
video_shader_driver_scale(&scaler);
if (gl->shader->shader_scale)
gl->shader->shader_scale(gl->shader_data,
i + 1, scaler.scale);
if (!chain->fbo_scale[i].valid)
{

View File

@ -3502,13 +3502,6 @@ static bool video_driver_cb_set_mvp(void *data,
return true;
}
static void video_shader_driver_scale_null(void *data,
unsigned idx, struct gfx_fbo_scale *scale)
{
(void)idx;
(void)scale;
}
static void video_shader_driver_reset_to_defaults(void)
{
if (!current_shader)
@ -3523,9 +3516,6 @@ static void video_shader_driver_reset_to_defaults(void)
}
if (!current_shader->set_coords)
current_shader->set_coords = video_driver_cb_set_coords;
if (!current_shader->shader_scale)
current_shader->shader_scale = video_shader_driver_scale_null;
}
/* Finds first suitable shader context driver. */
@ -3572,18 +3562,6 @@ bool video_shader_driver_init(video_shader_ctx_init_t *init)
return true;
}
bool video_shader_driver_scale(video_shader_ctx_scale_t *scaler)
{
if (!scaler || !scaler->scale)
return false;
scaler->scale->valid = false;
current_shader->shader_scale(current_shader_data,
scaler->idx, scaler->scale);
return true;
}
bool video_shader_driver_info(video_shader_ctx_info_t *shader_info)
{
if (!shader_info)

View File

@ -1192,8 +1192,6 @@ bool video_shader_driver_init(video_shader_ctx_init_t *init);
void video_driver_set_coords(video_shader_ctx_coords_t *coords);
bool video_shader_driver_scale(video_shader_ctx_scale_t *scaler);
bool video_shader_driver_info(video_shader_ctx_info_t *shader_info);
void video_driver_set_mvp(video_shader_ctx_mvp_t *mvp);