Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D3D: Move sharable D3D11/D3D12 code to common library #7869

Open
wants to merge 9 commits into
base: master
from

Conversation

3 participants
@stenzek
Copy link
Contributor

stenzek commented Mar 9, 2019

Does what the title says. This branch puts code which can be shared between D3D11 and D3D12 in a common class, to reduce duplication and the size of the D3D12 backend.

At the same time, I've replaced raw pointer usage with smart pointers (ComPtr) throughout the D3D11 backend, and refactored the global variable mess for swap chains into a class.

It also adds a DynamicLibrary class, for loading/symbol lookup in shared libraries. I've already switched Vulkan out to use the interface, but we could also use it for other things in the future (e.g. loading ffmpeg dynamically).

@stenzek-push stenzek-push force-pushed the stenzek:d3dcommon branch from a5ac735 to cedd3f2 Mar 9, 2019

@stenzek stenzek force-pushed the stenzek:d3dcommon branch from cedd3f2 to f2c4449 Mar 9, 2019

// Default constructor, does not load a library.
DynamicLibrary();

// Automatically loads the specified library. Call IsLoaded() to check validity before use.

This comment has been minimized.

@BhaaLseN

BhaaLseN Mar 9, 2019

Member

I think you mean IsOpen?

Close();
}

std::string DynamicLibrary::GetFilename(const char* filename)

This comment has been minimized.

@BhaaLseN

BhaaLseN Mar 9, 2019

Member

Can (or should?) this use GetFilename(const char*, int, int) instead (or the other way around)?
Mostly to make sure they're not doing different things when no version number is passed.


stateman = new StateManager;
return S_OK;
stateman = new StateManager();

This comment has been minimized.

@iwubcode

iwubcode Mar 9, 2019

Contributor

Any reason this isn't a unique_ptr?

@stenzek stenzek force-pushed the stenzek:d3dcommon branch from f2c4449 to fafbab9 Mar 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.