From 04b2ffcb9e39b4ca16f37a23417aa9bf889c68e5 Mon Sep 17 00:00:00 2001 From: natinusala Date: Mon, 28 Jan 2019 19:23:46 +0100 Subject: [PATCH] Fix scissoring for d3d10 and d3d11 --- gfx/drivers/d3d10.c | 14 ++++++-------- gfx/drivers/d3d11.c | 14 +++++++------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/gfx/drivers/d3d10.c b/gfx/drivers/d3d10.c index ad389744e17..79b8fe526d6 100644 --- a/gfx/drivers/d3d10.c +++ b/gfx/drivers/d3d10.c @@ -68,14 +68,14 @@ d3d10_overlay_vertex_geom(void* data, unsigned index, float x, float y, float w, D3D10UnmapBuffer(d3d10->overlays.vbo); } -static void d3d10_clear_scissor(d3d10_video_t *d3d10) +static void d3d10_clear_scissor(d3d10_video_t *d3d10, video_frame_info_t *video_info) { D3D10_RECT scissor_rect = {0}; - scissor_rect.left = d3d10->vp.x; - scissor_rect.top = d3d10->vp.y; - scissor_rect.right = d3d10->vp.width; - scissor_rect.bottom = d3d10->vp.height; + scissor_rect.left = 0; + scissor_rect.top = 0; + scissor_rect.right = video_info->width; + scissor_rect.bottom = video_info->height; D3D10SetScissorRects(d3d10->device, 1, &scissor_rect); } @@ -269,8 +269,6 @@ static void d3d10_update_viewport(void* data, bool force_full) d3d10->frame.output_size.w = 1.0f / d3d10->vp.height; d3d10->resize_viewport = false; - - d3d10_clear_scissor(d3d10); } static void d3d10_free_shader_preset(d3d10_video_t* d3d10) @@ -1333,7 +1331,7 @@ static bool d3d10_gfx_frame( D3D10ClearRenderTargetView(context, d3d10->renderTargetView, d3d10->clearcolor); D3D10SetViewports(context, 1, &d3d10->frame.viewport); - d3d10_clear_scissor(d3d10); + d3d10_clear_scissor(d3d10, video_info); D3D10Draw(context, 4, 0); diff --git a/gfx/drivers/d3d11.c b/gfx/drivers/d3d11.c index 188eb784c42..f4b5a1699d6 100644 --- a/gfx/drivers/d3d11.c +++ b/gfx/drivers/d3d11.c @@ -81,14 +81,14 @@ d3d11_overlay_vertex_geom(void* data, unsigned index, float x, float y, float w, D3D11UnmapBuffer(d3d11->context, d3d11->overlays.vbo, 0); } -static void d3d11_clear_scissor(d3d11_video_t *d3d11) +static void d3d11_clear_scissor(d3d11_video_t *d3d11, video_frame_info_t *video_info) { D3D11_RECT scissor_rect = {0}; - scissor_rect.left = d3d11->vp.x; - scissor_rect.top = d3d11->vp.y; - scissor_rect.right = d3d11->vp.width; - scissor_rect.bottom = d3d11->vp.height; + scissor_rect.left = 0; + scissor_rect.top = 0; + scissor_rect.right = video_info->width; + scissor_rect.bottom = video_info->height; D3D11SetScissorRects(d3d11->context, 1, &scissor_rect); } @@ -284,8 +284,6 @@ static void d3d11_update_viewport(void* data, bool force_full) d3d11->frame.output_size.w = 1.0f / d3d11->vp.height; d3d11->resize_viewport = false; - - d3d11_clear_scissor(d3d11); } static void d3d11_free_shader_preset(d3d11_video_t* d3d11) @@ -1393,6 +1391,8 @@ static bool d3d11_gfx_frame( D3D11ClearRenderTargetView(context, d3d11->renderTargetView, d3d11->clearcolor); D3D11SetViewports(context, 1, &d3d11->frame.viewport); + d3d11_clear_scissor(d3d11, video_info); + D3D11Draw(context, 4, 0); D3D11SetBlendState(context, d3d11->blend_enable, NULL, D3D11_DEFAULT_SAMPLE_MASK);