Project

General

Profile

Actions

Emulator Issues #6956

closed

Enable use of Direct3D 11.1

Added by NeoBrainX almost 11 years ago. Updated almost 8 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 #1

Updated by NeoBrainX almost 11 years ago

The last MSDN page that I linked to, http://msdn.microsoft.com/en-us/library/windows/desktop/hh404557%28v=vs.85%29.aspx , has the title "IDXGIFactory2::CreateSwapChainForHwnd method".
(MSDN links tend to get outdated over the years, so I wanted to mention that)

Actions #2

Updated by NeoBrainX almost 11 years ago

Another issue which we should look at is if we can keep using the ID3D11DeviceContext object once we have QueryInterfaced the ID3D11DeviceContext1 one. From my limited understanding of COM this should be possible, but if it's (for whatever reason) not possible, adding D3D 11.1 support will become a lot uglier since we'll have to replace all context uses with context1 uses (and that only when we are actually in D3D 11.1 mode).

Actions #3

Updated by galopin over 10 years ago

It is possible to use the two interface at the same time, there is even an API to lock invalid methods so the application scream on them ( basically the Something1 versus Something ).

Actions #4

Updated by galopin over 10 years ago

Thanks to the wrapper i have in my wip branch, i already played with a combination of d3d11 and d3d11.1 api on the context FYI

Actions #5

Updated by JMC4789 almost 8 years ago

  • Status changed from Accepted to Fixed

Considering we have D3D12 support and Vulkan now... I'm guessing D3D11.1 isn't a big deal any more?

Actions #6

Updated by JMC4789 almost 8 years ago

  • Status changed from Fixed to Won't fix

Whoops.

Actions #7

Updated by JosJuice almost 8 years ago

  • Status changed from Won't fix to Questionable
Actions #8

Updated by JosJuice almost 8 years ago

  • Status changed from Questionable to Won't fix
Actions

Also available in: Atom PDF