mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
D3D: Add quad-buffer stereoscopy support.
This commit is contained in:
@ -622,8 +622,8 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string& title)
|
|||||||
szr_stereo->Add(new wxStaticText(page_enh, wxID_ANY, _("Stereoscopic 3D Mode:")), 0,
|
szr_stereo->Add(new wxStaticText(page_enh, wxID_ANY, _("Stereoscopic 3D Mode:")), 0,
|
||||||
wxALIGN_CENTER_VERTICAL);
|
wxALIGN_CENTER_VERTICAL);
|
||||||
|
|
||||||
const wxString stereo_choices[] = {_("Off"), _("Side-by-Side"), _("Top-and-Bottom"),
|
const wxString stereo_choices[] = {_("Off"), _("Side-by-Side"), _("Top-and-Bottom"),
|
||||||
_("Anaglyph"), _("Nvidia 3D Vision")};
|
_("Anaglyph"), _("Quad-Buffer"), _("Nvidia 3D Vision")};
|
||||||
wxChoice* stereo_choice =
|
wxChoice* stereo_choice =
|
||||||
CreateChoice(page_enh, Config::GFX_STEREO_MODE, wxGetTranslation(stereo_3d_desc),
|
CreateChoice(page_enh, Config::GFX_STEREO_MODE, wxGetTranslation(stereo_3d_desc),
|
||||||
vconfig.backend_info.bSupports3DVision ? ArraySize(stereo_choices) :
|
vconfig.backend_info.bSupports3DVision ? ArraySize(stereo_choices) :
|
||||||
|
@ -303,6 +303,7 @@ HRESULT Create(HWND wnd)
|
|||||||
swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
|
swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
|
||||||
swap_chain_desc.Width = xres;
|
swap_chain_desc.Width = xres;
|
||||||
swap_chain_desc.Height = yres;
|
swap_chain_desc.Height = yres;
|
||||||
|
swap_chain_desc.Stereo = g_ActiveConfig.iStereoMode == STEREO_QUADBUFFER;
|
||||||
|
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
// Creating debug devices can sometimes fail if the user doesn't have the correct
|
// Creating debug devices can sometimes fail if the user doesn't have the correct
|
||||||
|
@ -1220,12 +1220,16 @@ void Renderer::BlitScreen(TargetRectangle src, TargetRectangle dst, D3DTexture2D
|
|||||||
D3D11_VIEWPORT vp = CD3D11_VIEWPORT((float)dst.left, (float)dst.top, (float)dst.GetWidth(),
|
D3D11_VIEWPORT vp = CD3D11_VIEWPORT((float)dst.left, (float)dst.top, (float)dst.GetWidth(),
|
||||||
(float)dst.GetHeight());
|
(float)dst.GetHeight());
|
||||||
D3D::context->RSSetViewports(1, &vp);
|
D3D::context->RSSetViewports(1, &vp);
|
||||||
D3D::drawShadedTexQuad(src_texture->GetSRV(), src.AsRECT(), src_width, src_height,
|
|
||||||
(g_Config.iStereoMode == STEREO_ANAGLYPH) ?
|
ID3D11PixelShader* pixelShader = (g_Config.iStereoMode == STEREO_ANAGLYPH) ?
|
||||||
PixelShaderCache::GetAnaglyphProgram() :
|
PixelShaderCache::GetAnaglyphProgram() :
|
||||||
PixelShaderCache::GetColorCopyProgram(false),
|
PixelShaderCache::GetColorCopyProgram(false);
|
||||||
|
ID3D11GeometryShader* geomShader = (g_ActiveConfig.iStereoMode == STEREO_QUADBUFFER) ?
|
||||||
|
GeometryShaderCache::GetCopyGeometryShader() :
|
||||||
|
nullptr;
|
||||||
|
D3D::drawShadedTexQuad(src_texture->GetSRV(), src.AsRECT(), src_width, src_height, pixelShader,
|
||||||
VertexShaderCache::GetSimpleVertexShader(),
|
VertexShaderCache::GetSimpleVertexShader(),
|
||||||
VertexShaderCache::GetSimpleInputLayout(), nullptr, Gamma);
|
VertexShaderCache::GetSimpleInputLayout(), geomShader, Gamma);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ enum StereoMode
|
|||||||
STEREO_SBS,
|
STEREO_SBS,
|
||||||
STEREO_TAB,
|
STEREO_TAB,
|
||||||
STEREO_ANAGLYPH,
|
STEREO_ANAGLYPH,
|
||||||
|
STEREO_QUADBUFFER,
|
||||||
STEREO_3DVISION
|
STEREO_3DVISION
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user