[D3D12] Switch from gflags to cvars

This commit is contained in:
Triang3l
2019-08-03 16:53:23 +03:00
127 changed files with 959 additions and 647 deletions

View File

@@ -9,18 +9,19 @@
#include "xenia/ui/d3d12/d3d12_provider.h"
#include <gflags/gflags.h>
#include <malloc.h>
#include <cstdlib>
#include "xenia/base/cvar.h"
#include "xenia/base/logging.h"
#include "xenia/ui/d3d12/d3d12_context.h"
DEFINE_bool(d3d12_debug, false, "Enable Direct3D 12 and DXGI debug layer.");
DEFINE_bool(d3d12_debug, false, "Enable Direct3D 12 and DXGI debug layer.",
"D3D12");
DEFINE_int32(d3d12_adapter, -1,
"Index of the DXGI adapter to use. "
"-1 for any physical adapter, -2 for WARP software rendering.");
"-1 for any physical adapter, -2 for WARP software rendering.",
"D3D12");
namespace xe {
namespace ui {
@@ -107,7 +108,7 @@ D3D12Provider::InitializationResult D3D12Provider::Initialize() {
}
// Enable the debug layer.
bool debug = FLAGS_d3d12_debug;
bool debug = cvars::d3d12_debug;
if (debug) {
ID3D12Debug* debug_interface;
if (SUCCEEDED(
@@ -136,11 +137,11 @@ D3D12Provider::InitializationResult D3D12Provider::Initialize() {
if (SUCCEEDED(adapter->GetDesc1(&adapter_desc))) {
if (SUCCEEDED(pfn_d3d12_create_device_(adapter, D3D_FEATURE_LEVEL_11_0,
_uuidof(ID3D12Device), nullptr))) {
if (FLAGS_d3d12_adapter >= 0) {
if (adapter_index == FLAGS_d3d12_adapter) {
if (cvars::d3d12_adapter >= 0) {
if (adapter_index == cvars::d3d12_adapter) {
break;
}
} else if (FLAGS_d3d12_adapter == -2) {
} else if (cvars::d3d12_adapter == -2) {
if (adapter_desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) {
break;
}