mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Polish, fix and otherwise improve the video plugin configuration dialog:
- Add some info about a backend's feature set (MSAA, Real XFB, EFB to RAM, ..) to VideoConfig - Gray out options if they aren't supported by the backend or if changing them doesn't affect anything (e.g. changing STC mode if STC is disabled) - Allow signed bytes for D3D11. Not sure if this causes glitches, but it should work - Call wxEvent.Skip() in the event function handlers, not sure if this fixes any bugs but the old code definitely caused bugs during development of this patch - Fix a memory leak in the configuration dialog if D3D11 is used - Other minor stuff that doesn't need to be mentioned or which I forgot git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6450 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -147,7 +147,7 @@ void XFBSource::CopyEFB()
|
||||
D3D::context->RSSetViewports(1, &vp);
|
||||
D3D::context->OMSetRenderTargets(1, &tex->GetRTV(), NULL);
|
||||
D3D::SetLinearCopySampler();
|
||||
|
||||
|
||||
D3D::drawShadedTexQuad(FramebufferManager::GetEFBColorTexture()->GetSRV(), sourceRc.AsRECT(),
|
||||
Renderer::GetFullTargetWidth(), Renderer::GetFullTargetHeight(),
|
||||
PixelShaderCache::GetColorCopyProgram(), VertexShaderCache::GetSimpleVertexShader(),
|
||||
|
@ -82,15 +82,7 @@ void VertexManager::DestroyDeviceObjects()
|
||||
SAFE_RELEASE(m_indexBuffer);
|
||||
}
|
||||
|
||||
VertexManager::VertexManager() :
|
||||
m_indexBufferCursor(0),
|
||||
m_vertexBufferCursor(0),
|
||||
m_vertexDrawOffset(0),
|
||||
m_triangleDrawIndex(0),
|
||||
m_lineDrawIndex(0),
|
||||
m_pointDrawIndex(0),
|
||||
m_indexBuffer(NULL),
|
||||
m_vertexBuffer(NULL)
|
||||
VertexManager::VertexManager()
|
||||
{
|
||||
CreateDeviceObjects();
|
||||
}
|
||||
|
@ -152,8 +152,6 @@ void DllConfig(void *_hParent)
|
||||
{
|
||||
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx11.ini").c_str());
|
||||
|
||||
std::vector<std::string> adapters;
|
||||
|
||||
IDXGIFactory* factory;
|
||||
IDXGIAdapter* ad;
|
||||
const HRESULT hr = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&factory);
|
||||
@ -163,18 +161,30 @@ void DllConfig(void *_hParent)
|
||||
char tmpstr[512] = {};
|
||||
|
||||
DXGI_ADAPTER_DESC desc;
|
||||
while (factory->EnumAdapters((UINT)adapters.size(), &ad) != DXGI_ERROR_NOT_FOUND)
|
||||
while (factory->EnumAdapters((UINT)g_Config.backend_info.Adapters.size(), &ad) != DXGI_ERROR_NOT_FOUND)
|
||||
{
|
||||
ad->GetDesc(&desc);
|
||||
WideCharToMultiByte(/*CP_UTF8*/CP_ACP, 0, desc.Description, -1, tmpstr, 512, 0, false);
|
||||
adapters.push_back(tmpstr);
|
||||
g_Config.backend_info.Adapters.push_back(tmpstr);
|
||||
ad->Release();
|
||||
}
|
||||
|
||||
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "Direct3D11", adapters);
|
||||
g_Config.backend_info.APIType = API_D3D11;
|
||||
g_Config.backend_info.bUseRGBATextures = true; // the GX formats barely match any D3D11 formats
|
||||
g_Config.backend_info.bSupportsEFBToRAM = false;
|
||||
g_Config.backend_info.bSupportsRealXFB = false;
|
||||
g_Config.backend_info.bAllowSignedBytes = true;
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "Direct3D11");
|
||||
diag->ShowModal();
|
||||
diag->Destroy();
|
||||
#endif
|
||||
UpdateActiveConfig();
|
||||
|
||||
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx11.ini").c_str());
|
||||
|
||||
factory->Release();
|
||||
}
|
||||
|
||||
void Initialize(void *init)
|
||||
|
@ -161,29 +161,33 @@ void DllConfig(void *_hParent)
|
||||
if (!s_PluginInitialized)
|
||||
D3D::Init();
|
||||
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
|
||||
UpdateActiveConfig();
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
|
||||
g_Config.backend_info.APIType = API_D3D9;
|
||||
g_Config.backend_info.bUseRGBATextures = false;
|
||||
g_Config.backend_info.bSupportsEFBToRAM = true;
|
||||
g_Config.backend_info.bSupportsRealXFB = true;
|
||||
g_Config.backend_info.bAllowSignedBytes = false;
|
||||
|
||||
// adapters
|
||||
std::vector<std::string> adapters;
|
||||
for (int i = 0; i < D3D::GetNumAdapters(); ++i)
|
||||
adapters.push_back(D3D::GetAdapter(i).ident.Description);
|
||||
g_Config.backend_info.Adapters.push_back(D3D::GetAdapter(i).ident.Description);
|
||||
|
||||
// aamodes
|
||||
std::vector<std::string> aamodes;
|
||||
if (g_Config.iAdapter < D3D::GetNumAdapters())
|
||||
{
|
||||
const D3D::Adapter &adapter = D3D::GetAdapter(g_Config.iAdapter);
|
||||
|
||||
for (int i = 0; i < adapter.aa_levels.size(); ++i)
|
||||
aamodes.push_back(adapter.aa_levels[i].name);
|
||||
g_Config.backend_info.AAModes.push_back(adapter.aa_levels[i].name);
|
||||
}
|
||||
|
||||
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "Direct3D9", adapters, aamodes);
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "Direct3D9");
|
||||
diag->ShowModal();
|
||||
diag->Destroy();
|
||||
#endif
|
||||
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
|
||||
UpdateActiveConfig();
|
||||
|
||||
if (!s_PluginInitialized)
|
||||
D3D::Shutdown();
|
||||
|
@ -168,20 +168,25 @@ void DllConfig(void *_hParent)
|
||||
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str());
|
||||
g_Config.UpdateProjectionHack();
|
||||
UpdateActiveConfig();
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
std::vector<std::string> adapters;
|
||||
|
||||
std::string caamodes[] = {"None", "2x", "4x", "8x", "8x CSAA", "8xQ CSAA", "16x CSAA", "16xQ CSAA"};
|
||||
std::vector<std::string> aamodes(caamodes, caamodes + sizeof(caamodes)/sizeof(*caamodes));
|
||||
g_Config.backend_info.AAModes = std::vector<std::string>(caamodes, caamodes + sizeof(caamodes)/sizeof(*caamodes));
|
||||
|
||||
std::vector<std::string> shaders;
|
||||
GetShaders(shaders);
|
||||
GetShaders(g_Config.backend_info.PPShaders);
|
||||
|
||||
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "OpenGL", adapters, aamodes, shaders);
|
||||
g_Config.backend_info.APIType = API_OPENGL;
|
||||
g_Config.backend_info.bUseRGBATextures = false;
|
||||
g_Config.backend_info.bSupportsEFBToRAM = true;
|
||||
g_Config.backend_info.bSupportsRealXFB = true;
|
||||
g_Config.backend_info.bAllowSignedBytes = true;
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "OpenGL");
|
||||
diag->ShowModal();
|
||||
diag->Destroy();
|
||||
#endif
|
||||
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str());
|
||||
UpdateActiveConfig();
|
||||
}
|
||||
|
||||
void Initialize(void *init)
|
||||
|
Reference in New Issue
Block a user