From 72e6909aaa42468921b0881b044ed284a05615c7 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Mon, 12 Feb 2018 03:25:37 +0100 Subject: [PATCH] (D3D) better handling of frame duping. --- gfx/drivers/d3d11.c | 3 +++ gfx/drivers/d3d12.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gfx/drivers/d3d11.c b/gfx/drivers/d3d11.c index acbbb37f5f..be27f43cc3 100644 --- a/gfx/drivers/d3d11.c +++ b/gfx/drivers/d3d11.c @@ -644,6 +644,9 @@ d3d11_gfx_init(const video_info_t* video, const input_driver_t** input, void** i d3d11->frame.texture[0].desc.Format = d3d11->format; d3d11->frame.texture[0].desc.Usage = D3D11_USAGE_DEFAULT; + d3d11->frame.texture[0].desc.Width = 4; + d3d11->frame.texture[0].desc.Height = 4; + d3d11_init_texture(d3d11->device, &d3d11->frame.texture[0]); d3d11->menu.texture.desc.Usage = D3D11_USAGE_DEFAULT; diff --git a/gfx/drivers/d3d12.c b/gfx/drivers/d3d12.c index abf16c1b5f..bfdd317fc7 100644 --- a/gfx/drivers/d3d12.c +++ b/gfx/drivers/d3d12.c @@ -961,6 +961,10 @@ d3d12_gfx_init(const video_info_t* video, const input_driver_t** input, void** i d3d12->chain.vsync = video->vsync; d3d12->format = video->rgb32 ? DXGI_FORMAT_B8G8R8X8_UNORM : DXGI_FORMAT_B5G6R5_UNORM; d3d12->frame.texture[0].desc.Format = d3d12->format; + d3d12->frame.texture[0].desc.Width = 4; + d3d12->frame.texture[0].desc.Height = 4; + d3d12->frame.texture[0].srv_heap = &d3d12->desc.srv_heap; + d3d12_init_texture(d3d12->device, &d3d12->frame.texture[0]); font_driver_init_osd(d3d12, false, video->is_threaded, FONT_DRIVER_RENDER_D3D12_API); @@ -1171,7 +1175,7 @@ static bool d3d12_gfx_frame( D3D12IASetPrimitiveTopology(d3d12->queue.cmd, D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); - if (data && width && height) + if (frame && width && height) { if (d3d12->shader_preset) {