Merge pull request #6222 from aliaspider/master

(D3D11) better handling of FBO scale.
This commit is contained in:
Twinaphex 2018-02-02 14:41:23 +01:00 committed by GitHub
commit 3451994374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -708,47 +708,57 @@ static bool d3d11_init_frame_textures(d3d11_video_t* d3d11, unsigned width, unsi
{
struct video_shader_pass* pass = &d3d11->shader_preset->pass[i];
switch (pass->fbo.type_x)
if(pass->fbo.valid)
{
case RARCH_SCALE_INPUT:
width *= pass->fbo.scale_x;
break;
case RARCH_SCALE_VIEWPORT:
width = d3d11->vp.width * pass->fbo.scale_x;
break;
switch (pass->fbo.type_x)
{
case RARCH_SCALE_INPUT:
width *= pass->fbo.scale_x;
break;
case RARCH_SCALE_ABSOLUTE:
width = pass->fbo.abs_x;
break;
case RARCH_SCALE_VIEWPORT:
width = d3d11->vp.width * pass->fbo.scale_x;
break;
default:
break;
case RARCH_SCALE_ABSOLUTE:
width = pass->fbo.abs_x;
break;
default:
break;
}
if (!width)
width = d3d11->vp.width;
switch (pass->fbo.type_y)
{
case RARCH_SCALE_INPUT:
height *= pass->fbo.scale_y;
break;
case RARCH_SCALE_VIEWPORT:
height = d3d11->vp.height * pass->fbo.scale_y;
break;
case RARCH_SCALE_ABSOLUTE:
height = pass->fbo.abs_y;
break;
default:
break;
}
if (!height)
height = d3d11->vp.height;
}
switch (pass->fbo.type_y)
else if (i == (d3d11->shader_preset->passes - 1))
{
case RARCH_SCALE_INPUT:
height *= pass->fbo.scale_y;
break;
case RARCH_SCALE_VIEWPORT:
height = d3d11->vp.height * pass->fbo.scale_y;
break;
case RARCH_SCALE_ABSOLUTE:
height = pass->fbo.abs_y;
break;
default:
break;
}
if (!width)
width = d3d11->vp.width;
if (!height)
height = d3d11->vp.height;
}
RARCH_LOG("[D3D11]: Updating framebuffer size %u x %u.\n", width, height);