Reconciling D3D Adapter Enumeration #1516
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
D3D enumerates adapters. In kernel driver parlance - an adapter is a device that represents a video output on a card. Typically an enumeration API (like the one in D3D) will only enumerate adapters on a video card that have a display connected.
Basically:
I think the original source code has muddled things by assuming that an adapter is a driver or a video card. This has led to weird descriptions in the code like a video card having display modes instead of a monitor having display modes.
Comments like this one are suspicious:
Here DriverInfo represents an adapter/display - not a GPU driver. That's why more than one "driver" appears on multi monitor systems.
My goal is to have a client be able to tell a pipeline which display is the target display. This should allow the user to move between displays and have the display modes update. To do that - I need to begin untangling the Direct3D pipeline and reviewing changes that could impact the other pipelines.
The changes I'm proposing here for clarity:
D3DEnum_DriverInfo
becomesD3DEnum_DisplayInfo
.D3DEnum_DriverInfo
is an abstraction for an adapter - which already represents a video output, not a driver.D3DEnum_DeviceInfo
becomesD3DEnum_RendererInfo
. The informationD3DEnum_DeviceInfo
is wrapping are the possible renderers available for a display, not the possible devices available for a display.I'm going to admit - I don't know if this language is correct.
Adapter
is the most correct description of a port on a video card connected to a display. ButAdapter
is a DX-ism - and it has a 1:1 relationship with a display.Renderer
I feel a little better about. Plasma refers to the software renderer and the hardware renderer as 'Devices' which doesn't seem like the right language.Things I'm thinking about but not actively addressing yet (but am open to feedback):
I'm not sure of the origins of what happened here. This goes back to the original source drop. I think this file was a port of a D3D8 iterator - and possibly D3D8 had different terminology that mapped over badly.
Hoping to have this PR dragged through the wringer before I look at any changes to higher layers of Plasma that could spill into OpenGL and Metal.