mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #9707 from unknownbrackets/softgpu-d3d9
SoftGPU: Fix rendering when using Direct3D 9
This commit is contained in:
commit
13e7dae72d
3 changed files with 13 additions and 16 deletions
|
@ -169,7 +169,7 @@ void EmuScreen::bootGame(const std::string &filename) {
|
||||||
break;
|
break;
|
||||||
case GPUBackend::VULKAN:
|
case GPUBackend::VULKAN:
|
||||||
coreParam.gpuCore = GPUCORE_VULKAN;
|
coreParam.gpuCore = GPUCORE_VULKAN;
|
||||||
if (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE) {
|
if (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE && !g_Config.bSoftwareRendering) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (IDYES == MessageBox(MainWindow::GetHWND(), L"The Vulkan backend is not yet compatible with buffered rendering. Switch to non-buffered (WARNING: This will cause glitches with the other backends unless you switch back)", L"Vulkan Experimental Support", MB_ICONINFORMATION | MB_YESNO)) {
|
if (IDYES == MessageBox(MainWindow::GetHWND(), L"The Vulkan backend is not yet compatible with buffered rendering. Switch to non-buffered (WARNING: This will cause glitches with the other backends unless you switch back)", L"Vulkan Experimental Support", MB_ICONINFORMATION | MB_YESNO)) {
|
||||||
g_Config.iRenderingMode = FB_NON_BUFFERED_MODE;
|
g_Config.iRenderingMode = FB_NON_BUFFERED_MODE;
|
||||||
|
|
|
@ -925,23 +925,19 @@ void D3D9Context::Clear(int mask, uint32_t colorval, float depthVal, int stencil
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D9Context::SetScissorRect(int left, int top, int width, int height) {
|
void D3D9Context::SetScissorRect(int left, int top, int width, int height) {
|
||||||
RECT rc;
|
using namespace DX9;
|
||||||
rc.left = left;
|
|
||||||
rc.top = top;
|
dxstate.scissorRect.set(left, top, left + width, top + height);
|
||||||
rc.right = left + width;
|
|
||||||
rc.bottom = top + height;
|
|
||||||
device_->SetScissorRect(&rc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D9Context::SetViewports(int count, Viewport *viewports) {
|
void D3D9Context::SetViewports(int count, Viewport *viewports) {
|
||||||
D3DVIEWPORT9 vp;
|
using namespace DX9;
|
||||||
vp.X = (DWORD)viewports[0].TopLeftX;
|
|
||||||
vp.Y = (DWORD)viewports[0].TopLeftY;
|
int x = (int)viewports[0].TopLeftX;
|
||||||
vp.Width = (DWORD)viewports[0].Width;
|
int y = (int)viewports[0].TopLeftY;
|
||||||
vp.Height = (DWORD)viewports[0].Height;
|
int w = (int)viewports[0].Width;
|
||||||
vp.MinZ = viewports[0].MinDepth;
|
int h = (int)viewports[0].Height;
|
||||||
vp.MaxZ = viewports[0].MaxDepth;
|
dxstate.viewport.set(x, y, w, h, viewports[0].MinDepth, viewports[0].MaxDepth);
|
||||||
device_->SetViewport(&vp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D9Context::SetBlendFactor(float color[4]) {
|
void D3D9Context::SetBlendFactor(float color[4]) {
|
||||||
|
@ -1193,4 +1189,4 @@ uint32_t D3D9Context::GetDataFormatSupport(DataFormat fmt) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace Draw
|
} // namespace Draw
|
||||||
|
|
|
@ -1537,6 +1537,7 @@ void OpenGLContext::BindFramebufferAsRenderTarget(Framebuffer *fbo) {
|
||||||
// in ES 2.0 that actually separate them anyway of course, so doesn't matter.
|
// in ES 2.0 that actually separate them anyway of course, so doesn't matter.
|
||||||
fbo_bind_fb_target(false, fb->handle);
|
fbo_bind_fb_target(false, fb->handle);
|
||||||
// Always restore viewport after render target binding
|
// Always restore viewport after render target binding
|
||||||
|
// TODO: Should we set viewports this way too?
|
||||||
glstate.viewport.restore();
|
glstate.viewport.restore();
|
||||||
CHECK_GL_ERROR_IF_DEBUG();
|
CHECK_GL_ERROR_IF_DEBUG();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue