Skip to content

Commit

Permalink
backend check improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
recp committed Oct 3, 2023
1 parent 647b64a commit 7bd834e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/gpu/gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ extern "C" {
#include "instance.h"

typedef enum GPUBackend {
GPU_BACKEND_NULL = 0,
GPU_BACKEND_METAL = 1,
GPU_BACKEND_VULKAN = 2,
GPU_BACKEND_DIRECTX = 3,
GPU_BACKEND_OPENGL = 4
GPU_BACKEND_NULL = 0,
GPU_BACKEND_METAL = 1,
GPU_BACKEND_VULKAN = 2,
GPU_BACKEND_DIRECTX12 = 3,
GPU_BACKEND_OPENGL = 4
} GPUBackend;

GPU_EXPORT
Expand Down
7 changes: 7 additions & 0 deletions src/backend/backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ GPUSwitchGPUApi(GPUBackend backend) {
#endif
break;
case GPU_BACKEND_VULKAN:
#ifdef GPU_BACKEND_VULKAN
gpu__api = backend_vk();
#endif
break;
case GPU_BACKEND_DIRECTX12:
#if defined(_WIN32) || defined(WIN32)
gpu__api = backend_dx12(); /* check DX version support */
#endif
break;
case GPU_BACKEND_OPENGL:
// gpu__api = backend_gl();
Expand Down

0 comments on commit 7bd834e

Please sign in to comment.