Adding in D3D11 GPU skeleton.

This commit is contained in:
Ben Vanik
2013-10-09 23:18:22 -07:00
parent 8558176ee0
commit 611d3bbbeb
10 changed files with 198 additions and 26 deletions

View File

@@ -10,27 +10,49 @@
#include <xenia/gpu/gpu.h>
#include <xenia/gpu/gpu-private.h>
#if XE_PLATFORM(WIN32)
//#include <xenia/gpu/d3d11/d3d11.h>
#endif // WIN32
#include <xenia/gpu/nop/nop.h>
using namespace xe;
using namespace xe::gpu;
// DEFINE_ flags here.
DEFINE_string(gpu, "any",
"Graphics system. Use: [any, nop, d3d11]");
GraphicsSystem* xe::gpu::Create(const CreationParams* params) {
// TODO(benvanik): use flags to determine system, check support, etc.
return xe::gpu::nop::Create(params);
// #if XE_PLATFORM(WIN32)
// return xe::gpu::d3d11::Create(params);
// #endif // WIN32
}
#include <xenia/gpu/nop/nop.h>
GraphicsSystem* xe::gpu::CreateNop(const CreationParams* params) {
return xe::gpu::nop::Create(params);
}
#if XE_PLATFORM(WIN32)
#include <xenia/gpu/d3d11/d3d11.h>
GraphicsSystem* xe::gpu::CreateD3D11(const CreationParams* params) {
return xe::gpu::d3d11::Create(params);
}
#endif // WIN32
GraphicsSystem* xe::gpu::Create(const CreationParams* params) {
if (FLAGS_gpu.compare("nop") == 0) {
return CreateNop(params);
#if XE_PLATFORM(WIN32)
} else if (FLAGS_gpu.compare("d3d11") == 0) {
return CreateD3D11(params);
#endif // WIN32
} else {
// Create best available.
GraphicsSystem* best = NULL;
#if XE_PLATFORM(WIN32)
best = CreateD3D11(params);
if (best) {
return best;
}
#endif // WIN32
// Fallback to nop.
return CreateNop(params);
}
}