dx11: black screen with full fb emu when scaling. dx9: fb render fix

dx11: black screen when full framebuffer emulation is enabled if scaling
is on (480 -> 240p)
Fixes Mr.Driller. Issue #1067
dx9: wrong stretching when rendering the dc framebuffer if aspect ratio
different from 4:3
This commit is contained in:
Flyinghead 2023-09-24 11:04:24 +02:00
parent b002bdff39
commit 84d82f360b
2 changed files with 4 additions and 5 deletions

View File

@ -1258,9 +1258,10 @@ void DX11Renderer::writeFramebufferToVRAM()
viewDesc.Texture2D.MipLevels = 1;
device->CreateShaderResourceView(fbScaledTexture, &viewDesc, &fbScaledTextureView.get());
}
deviceContext->OMSetRenderTargets(1, &fbScaledRenderTarget.get(), nullptr);
D3D11_VIEWPORT vp{};
vp.Width = (FLOAT)width;
vp.Height = (FLOAT)height;
vp.Width = (FLOAT)scaledW;
vp.Height = (FLOAT)scaledH;
vp.MinDepth = 0.f;
vp.MaxDepth = 1.f;
deviceContext->RSSetViewports(1, &vp);

View File

@ -296,9 +296,7 @@ void D3DRenderer::RenderFramebuffer(const FramebufferInfo& info)
devCache.SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
device->ColorFill(framebufferSurface, 0, D3DCOLOR_ARGB(255, info.vo_border_col._red, info.vo_border_col._green, info.vo_border_col._blue));
u32 bar = (this->width - this->height * 640 / 480) / 2;
RECT rd{ (LONG)bar, 0, (LONG)(this->width - bar), (LONG)this->height };
device->StretchRect(dcfbSurface, nullptr, framebufferSurface, &rd, D3DTEXF_LINEAR);
device->StretchRect(dcfbSurface, nullptr, framebufferSurface, nullptr, D3DTEXF_LINEAR);
aspectRatio = getDCFramebufferAspectRatio();
displayFramebuffer();