mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 21:28:51 +00: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:
parent
fb9387a38e
commit
c540995193
3 changed files with 19 additions and 13 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue