Project

General

Profile

Actions

Emulator Issues #6956

closed

Enable use of Direct3D 11.1

Added by NeoBrainX over 10 years ago. Updated over 7 years ago.

Status:
Won't fix
Priority:
Low
Assignee:
% Done:

0%

Operating system:
Windows
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
Yes
Regression start:
Fixed in:

Description

Bug report to keep track of important links so that I don't forget about them.

Direct3D 11.1 has been around for a while and provides at least one potential useful feature for Dolphin (logic blending). However, for reasons that I do not understand Microsoft has made it ridiculously hard to actually make use of Direct3D 11.1 while still supporting D3D versions below that.

http://msdn.microsoft.com/en-us/library/windows/desktop/ff476879%28v=vs.85%29.aspx ("How To: Create a Device and Immediate Context") explains how to create a device in D3D 11.1 mode properly (basically you have to pass the new value D3D_FEATURE_LEVEL_11_1 to the array of supported feature levels BUT if the 11.1 runtime is not installed, D3D11CreateDeviceAndSwapChain will just fail and you have to call it again without the flag, which is just completely dumb but it's how it works, apparently).

However, this only initializes the decide object, we don't actually get a ID3D11Device1 interface. To get one, we have to use QueryInterface on the ID3D11Device object with the proper parameters. This is outlined in http://msdn.microsoft.com/en-us/library/windows/desktop/ff476083%28v=vs.85%29.aspx ("D3D11CreateDeviceAndSwapChain function"). However, random internet sources say that this might not work for the ID3D11DeviceContext1 object, which is something that needs to be verified.

If we can not QueryInterface a ID3D11DeviceContext1 object, an alternative would be to just Release() the ID3D11DeviceContext object that D3D11CreateDeviceAndSwapChain returns and to recreate a new one with ID3D11Device1::CreateImmediateContext, which directly returns a ID3D11DeviceContext1 object.

An alternative would be to use http://msdn.microsoft.com/en-us/library/windows/desktop/hh404557%28v=vs.85%29.aspx instead of D3D11CreateDeviceAndSwapChain and to manually call ID3D11Device1::CreateImmediateContext, which returns a ID3D11DeviceContext1 object. The advantage is that we don't uselessly have a device context created just to destroy it immediately after.

Actions

Also available in: Atom PDF