mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
d3d12: Honor adaptater selection + debug output layer
This commit is contained in:
parent
6e8b94a7e1
commit
cb14697aa0
4 changed files with 30 additions and 9 deletions
|
@ -145,19 +145,29 @@ void D3D12GSRender::ResourceStorage::Release()
|
|||
D3D12GSRender::D3D12GSRender()
|
||||
: GSRender(), m_fbo(nullptr), m_PSO(nullptr)
|
||||
{
|
||||
|
||||
// Enable d3d debug layer
|
||||
#ifdef _DEBUG
|
||||
Microsoft::WRL::ComPtr<ID3D12Debug> debugInterface;
|
||||
D3D12GetDebugInterface(IID_PPV_ARGS(&debugInterface));
|
||||
debugInterface->EnableDebugLayer();
|
||||
#endif
|
||||
if (Ini.GSDebugOutputEnable.GetValue())
|
||||
{
|
||||
Microsoft::WRL::ComPtr<ID3D12Debug> debugInterface;
|
||||
D3D12GetDebugInterface(IID_PPV_ARGS(&debugInterface));
|
||||
debugInterface->EnableDebugLayer();
|
||||
}
|
||||
|
||||
Microsoft::WRL::ComPtr<IDXGIFactory4> dxgiFactory;
|
||||
check(CreateDXGIFactory(IID_PPV_ARGS(&dxgiFactory)));
|
||||
// Create adapter
|
||||
IDXGIAdapter* adaptater = nullptr;
|
||||
// check(dxgiFactory->EnumWarpAdapter(IID_PPV_ARGS(&adaptater)));
|
||||
switch (Ini.GSD3DAdaptater.GetValue())
|
||||
{
|
||||
case 0: // WARP
|
||||
check(dxgiFactory->EnumWarpAdapter(IID_PPV_ARGS(&adaptater)));
|
||||
break;
|
||||
case 1: // Default
|
||||
dxgiFactory->EnumAdapters(0, &adaptater);
|
||||
break;
|
||||
default: // Adaptater 0, 1, ...
|
||||
dxgiFactory->EnumAdapters(Ini.GSD3DAdaptater.GetValue() - 2,&adaptater);
|
||||
break;
|
||||
}
|
||||
check(D3D12CreateDevice(adaptater, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&m_device)));
|
||||
|
||||
// Queues
|
||||
|
@ -168,6 +178,9 @@ D3D12GSRender::D3D12GSRender()
|
|||
check(m_device->CreateCommandQueue(&graphicQueueDesc, IID_PPV_ARGS(&m_commandQueueGraphic)));
|
||||
|
||||
m_frame = GetGSFrame();
|
||||
DXGI_ADAPTER_DESC adaptaterDesc;
|
||||
adaptater->GetDesc(&adaptaterDesc);
|
||||
m_frame->SetAdaptaterName(adaptaterDesc.Description);
|
||||
|
||||
// Create swap chain and put them in a descriptor heap as rendertarget
|
||||
DXGI_SWAP_CHAIN_DESC swapChain = {};
|
||||
|
|
|
@ -33,6 +33,7 @@ public:
|
|||
virtual void DeleteContext(void* ctx) = 0;
|
||||
virtual void Flip(void* ctx) = 0;
|
||||
virtual HWND getHandle() const = 0;
|
||||
virtual void SetAdaptaterName(const wchar_t *) = 0;
|
||||
};
|
||||
|
||||
typedef GSFrameBase2*(*GetGSFrameCb2)();
|
||||
|
|
|
@ -19,6 +19,11 @@ D3DGSFrame::~D3DGSFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void D3DGSFrame::SetAdaptaterName(const wchar_t *name)
|
||||
{
|
||||
AdaptaterName = name;
|
||||
}
|
||||
|
||||
void D3DGSFrame::Close()
|
||||
{
|
||||
GSFrame::Close();
|
||||
|
@ -63,7 +68,7 @@ void D3DGSFrame::Flip(void* context)
|
|||
// canvas->SwapBuffers();
|
||||
m_frames++;
|
||||
|
||||
const std::string sub_title = Emu.GetTitle() + (Emu.GetTitleID().length() ? " [" + Emu.GetTitleID() + "] | " : " | ");
|
||||
const std::string sub_title = Emu.GetTitle() + (Emu.GetTitleID().length() ? " [" + Emu.GetTitleID() + "] | " : " | ") + AdaptaterName.ToStdString() + " | ";
|
||||
|
||||
if (fps_t.GetElapsedTimeInSec() >= 0.5)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@ struct D3DGSFrame : public GSFrame, public GSFrameBase2
|
|||
{
|
||||
wxWindow* canvas;
|
||||
u32 m_frames;
|
||||
wxString AdaptaterName;
|
||||
|
||||
D3DGSFrame();
|
||||
~D3DGSFrame();
|
||||
|
@ -28,6 +29,7 @@ struct D3DGSFrame : public GSFrame, public GSFrameBase2
|
|||
|
||||
virtual void SetViewport(int x, int y, u32 w, u32 h) override;
|
||||
virtual HWND getHandle() const override;
|
||||
virtual void SetAdaptaterName(const wchar_t *) override;
|
||||
|
||||
private:
|
||||
virtual void OnSize(wxSizeEvent& event);
|
||||
|
|
Loading…
Add table
Reference in a new issue