Skip to content

Commit

Permalink
Implement SDLGPUDriver
Browse files Browse the repository at this point in the history
Co-authored-by: Ethan Lee <[email protected]>
Co-authored-by: Caleb Cornett <[email protected]>
  • Loading branch information
3 people committed Aug 9, 2024
1 parent 5c1f522 commit 76667e0
Show file tree
Hide file tree
Showing 8 changed files with 4,302 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ add_definitions(
-DFNA3D_DRIVER_VULKAN
-DFNA3D_DRIVER_OPENGL
)
if(BUILD_SDL3)
add_definitions(-DFNA3D_DRIVER_SDL)
endif()
add_definitions(
-DMOJOSHADER_NO_VERSION_INCLUDE
-DMOJOSHADER_USE_SDL_STDLIB
Expand Down Expand Up @@ -108,6 +111,7 @@ add_library(FNA3D
src/FNA3D.c
src/FNA3D_Driver_D3D11.c
src/FNA3D_Driver_OpenGL.c
src/FNA3D_Driver_SDL.c
src/FNA3D_Driver_Vulkan.c
src/FNA3D_Image.c
src/FNA3D_CommandBuffer.c
Expand All @@ -122,6 +126,7 @@ add_library(mojoshader STATIC
MojoShader/mojoshader_d3d11.c
MojoShader/mojoshader_opengl.c
MojoShader/mojoshader_vulkan.c
MojoShader/mojoshader_sdlgpu.c
MojoShader/profiles/mojoshader_profile_common.c
MojoShader/profiles/mojoshader_profile_glsl.c
MojoShader/profiles/mojoshader_profile_hlsl.c
Expand Down
2 changes: 1 addition & 1 deletion MojoShader
3 changes: 3 additions & 0 deletions src/FNA3D.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
/* Drivers */

static const FNA3D_Driver *drivers[] = {
#if FNA3D_DRIVER_SDL
&SDLGPUDriver,
#endif
#if FNA3D_DRIVER_D3D11
&D3D11Driver,
#endif
Expand Down
1 change: 1 addition & 0 deletions src/FNA3D_Driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ typedef struct FNA3D_Driver
FNA3D_SHAREDINTERNAL FNA3D_Driver VulkanDriver;
FNA3D_SHAREDINTERNAL FNA3D_Driver D3D11Driver;
FNA3D_SHAREDINTERNAL FNA3D_Driver OpenGLDriver;
FNA3D_SHAREDINTERNAL FNA3D_Driver SDLGPUDriver;
FNA3D_SHAREDINTERNAL FNA3D_Driver GNMXDriver;

#endif /* FNA3D_DRIVER_H */
Expand Down
Loading

0 comments on commit 76667e0

Please sign in to comment.