mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 21:30:19 -06:00
DX11: Fix two crashes. One occured when trying to run a game with D3D 10.0 level hardware, the other one when closing a game when MSAA was disabled.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6494 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -169,6 +169,10 @@ void EnumAAModes(IDXGIAdapter* adapter, std::vector<DXGI_SAMPLE_DESC>& aa_modes)
|
||||
HRESULT hr = PD3D11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, NULL, D3D11_CREATE_DEVICE_SINGLETHREADED, supported_feature_levels, NUM_SUPPORTED_FEATURE_LEVELS, D3D11_SDK_VERSION, &device, &feat_level, &context);
|
||||
if (FAILED(hr) || feat_level == D3D_FEATURE_LEVEL_10_0)
|
||||
{
|
||||
DXGI_SAMPLE_DESC desc;
|
||||
desc.Count = 1;
|
||||
desc.Quality = 0;
|
||||
aa_modes.push_back(desc);
|
||||
SAFE_RELEASE(context);
|
||||
SAFE_RELEASE(device);
|
||||
return;
|
||||
@ -241,7 +245,7 @@ HRESULT Create(HWND wnd)
|
||||
// get supported AA modes
|
||||
aa_modes.clear();
|
||||
EnumAAModes(adapter, aa_modes);
|
||||
if (g_Config.iMultisampleMode >= aa_modes.size())
|
||||
if (g_Config.iMultisampleMode >= (int)aa_modes.size())
|
||||
{
|
||||
g_Config.iMultisampleMode = 0;
|
||||
UpdateActiveConfig();
|
||||
|
@ -126,6 +126,11 @@ FramebufferManager::FramebufferManager()
|
||||
D3D::SetDebugObjectName((ID3D11DeviceChild*)m_efb.resolved_depth_tex->GetTex(), "EFB depth resolve texture");
|
||||
D3D::SetDebugObjectName((ID3D11DeviceChild*)m_efb.resolved_depth_tex->GetSRV(), "EFB depth resolve texture shader resource view");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_efb.resolved_color_tex = NULL;
|
||||
m_efb.resolved_depth_tex = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
FramebufferManager::~FramebufferManager()
|
||||
|
Reference in New Issue
Block a user