diff --git a/gfx/drivers_display/gfx_display_d3d11.c b/gfx/drivers_display/gfx_display_d3d11.c index 55cde25d07..78aea5d9d4 100644 --- a/gfx/drivers_display/gfx_display_d3d11.c +++ b/gfx/drivers_display/gfx_display_d3d11.c @@ -290,15 +290,17 @@ void gfx_display_d3d11_scissor_begin(video_frame_info_t *video_info, int x, int void gfx_display_d3d11_scissor_end(video_frame_info_t *video_info) { D3D11_RECT rect; - d3d11_video_t *d3d11 = (d3d11_video_t*)video_info->userdata; + d3d11_video_t *d3d11 = (d3d11_video_t*)video_info->userdata; + unsigned video_width = video_info->width; + unsigned video_height = video_info->height; if (!d3d11) return; rect.left = 0; rect.top = 0; - rect.right = video_info->width; - rect.bottom = video_info->height; + rect.right = video_width; + rect.bottom = video_height; D3D11SetScissorRects(d3d11->context, 1, &rect); } diff --git a/gfx/drivers_display/gfx_display_d3d12.c b/gfx/drivers_display/gfx_display_d3d12.c index 1d8de1045e..4240aa9c1d 100644 --- a/gfx/drivers_display/gfx_display_d3d12.c +++ b/gfx/drivers_display/gfx_display_d3d12.c @@ -311,15 +311,17 @@ void gfx_display_d3d12_scissor_begin(video_frame_info_t *video_info, int x, int void gfx_display_d3d12_scissor_end(video_frame_info_t *video_info) { D3D12_RECT rect; - d3d12_video_t *d3d12 = (d3d12_video_t*)video_info->userdata; + d3d12_video_t *d3d12 = (d3d12_video_t*)video_info->userdata; + unsigned video_width = video_info->width; + unsigned video_height = video_info->height; if (!d3d12) return; rect.left = 0; rect.top = 0; - rect.right = video_info->width; - rect.bottom = video_info->height; + rect.right = video_width; + rect.bottom = video_height; D3D12RSSetScissorRects(d3d12->queue.cmd, 1, &rect); } diff --git a/gfx/drivers_display/gfx_display_gl.c b/gfx/drivers_display/gfx_display_gl.c index 7e5c9373d0..b03eb4d442 100644 --- a/gfx/drivers_display/gfx_display_gl.c +++ b/gfx/drivers_display/gfx_display_gl.c @@ -220,14 +220,16 @@ gfx_display_gl_discard_draw_rectangle(gfx_display_ctx_draw_t *draw, static void gfx_display_gl_draw(gfx_display_ctx_draw_t *draw, video_frame_info_t *video_info) { - gl_t *gl = (gl_t*)video_info->userdata; + gl_t *gl = (gl_t*)video_info->userdata; + unsigned video_width = video_info->width; + unsigned video_height = video_info->height; if (!gl || !draw) return; #ifdef MALI_BUG - if (gfx_display_gl_discard_draw_rectangle(draw, video_info->width, - video_info->height)) + if (gfx_display_gl_discard_draw_rectangle(draw, video_width, + video_height)) { /*RARCH_WARN("[Menu]: discarded draw rect: %.4i %.4i %.4i %.4i\n", (int)draw->x, (int)draw->y, (int)draw->width, (int)draw->height);*/ @@ -368,7 +370,8 @@ static void gfx_display_gl_scissor_begin( video_frame_info_t *video_info, int x, int y, unsigned width, unsigned height) { - glScissor(x, video_info->height - y - height, width, height); + unsigned video_height = video_info->height; + glScissor(x, video_height - y - height, width, height); glEnable(GL_SCISSOR_TEST); #ifdef MALI_BUG /* TODO/FIXME: If video width/height changes between @@ -385,10 +388,12 @@ static void gfx_display_gl_scissor_begin( static void gfx_display_gl_scissor_end(video_frame_info_t *video_info) { - glScissor(0, 0, video_info->width, video_info->height); + unsigned video_width = video_info->width; + unsigned video_height = video_info->height; + glScissor(0, 0, video_width, video_height); glDisable(GL_SCISSOR_TEST); #ifdef MALI_BUG - scissor_set_rectangle(0, video_info->width - 1, 0, video_info->height - 1, 0); + scissor_set_rectangle(0, video_width - 1, 0, video_height - 1, 0); #endif } diff --git a/gfx/drivers_display/gfx_display_gl1.c b/gfx/drivers_display/gfx_display_gl1.c index 95c6facd82..124b80a5d6 100644 --- a/gfx/drivers_display/gfx_display_gl1.c +++ b/gfx/drivers_display/gfx_display_gl1.c @@ -204,13 +204,17 @@ static bool gfx_display_gl1_font_init_first( static void gfx_display_gl1_scissor_begin(video_frame_info_t *video_info, int x, int y, unsigned width, unsigned height) { - glScissor(x, video_info->height - y - height, width, height); + unsigned video_width = video_info->width; + unsigned video_height = video_info->height; + glScissor(x, video_height - y - height, width, height); glEnable(GL_SCISSOR_TEST); } static void gfx_display_gl1_scissor_end(video_frame_info_t *video_info) { - glScissor(0, 0, video_info->width, video_info->height); + unsigned video_width = video_info->width; + unsigned video_height = video_info->height; + glScissor(0, 0, video_width, video_height); glDisable(GL_SCISSOR_TEST); } diff --git a/gfx/drivers_display/gfx_display_gl_core.c b/gfx/drivers_display/gfx_display_gl_core.c index 9fe616876c..b4c1c79726 100644 --- a/gfx/drivers_display/gfx_display_gl_core.c +++ b/gfx/drivers_display/gfx_display_gl_core.c @@ -89,6 +89,8 @@ static void gfx_display_gl_core_draw_pipeline(gfx_display_ctx_draw_t *draw, float yflip = 0.0f; video_coord_array_t *ca = NULL; gl_core_t *gl_core = (gl_core_t*)video_info->userdata; + unsigned video_width = video_info->width; + unsigned video_height = video_info->height; if (!gl_core || !draw) return; @@ -97,8 +99,8 @@ static void gfx_display_gl_core_draw_pipeline(gfx_display_ctx_draw_t *draw, draw->y = 0; draw->matrix_data = NULL; - output_size[0] = (float)video_info->width; - output_size[1] = (float)video_info->height; + output_size[0] = (float)video_width; + output_size[1] = (float)video_height; switch (draw->pipeline.id) { @@ -158,7 +160,8 @@ static void gfx_display_gl_core_draw(gfx_display_ctx_draw_t *draw, const float *color = NULL; GLuint texture = 0; gl_core_t *gl = (gl_core_t*)video_info->userdata; - const struct gl_core_buffer_locations *loc = NULL; + const struct + gl_core_buffer_locations *loc = NULL; if (!gl || !draw) return; @@ -332,7 +335,8 @@ static bool gfx_display_gl_core_font_init_first( static void gfx_display_gl_core_scissor_begin(video_frame_info_t *video_info, int x, int y, unsigned width, unsigned height) { - glScissor(x, video_info->height - y - height, width, height); + unsigned video_height = video_info->height; + glScissor(x, video_height - y - height, width, height); glEnable(GL_SCISSOR_TEST); } diff --git a/gfx/drivers_display/gfx_display_vita2d.c b/gfx/drivers_display/gfx_display_vita2d.c index 6f40b522f6..f56928d609 100644 --- a/gfx/drivers_display/gfx_display_vita2d.c +++ b/gfx/drivers_display/gfx_display_vita2d.c @@ -191,7 +191,9 @@ static bool gfx_display_vita2d_font_init_first( static void gfx_display_vita2d_scissor_end(video_frame_info_t *video_info) { - vita2d_set_region_clip(SCE_GXM_REGION_CLIP_NONE, 0, 0, video_info->width, video_info->height); + unsigned video_width = video_info->width; + unsigned video_height = video_info->height; + vita2d_set_region_clip(SCE_GXM_REGION_CLIP_NONE, 0, 0, video_width, video_height); vita2d_disable_clipping(); }