Add SDL3 GPU backend (Vulkan/Metal) with OpenGL fallback
This commit is contained in:
@@ -17,6 +17,9 @@ set(OpenGL_GL_PREFERENCE GLVND)
|
||||
# --- LISTA EXPLÍCITA DE FUENTES ---
|
||||
set(APP_SOURCES
|
||||
src/main.cpp
|
||||
src/rendering/shader_backend.cpp
|
||||
src/rendering/opengl_shader_backend.cpp
|
||||
src/rendering/sdl3gpu/sdl3gpu_shader_backend.cpp
|
||||
)
|
||||
|
||||
# Fuentes de librerías de terceros
|
||||
@@ -29,6 +32,21 @@ set(EXTERNAL_SOURCES
|
||||
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)
|
||||
message(STATUS "SDL3 encontrado: ${SDL3_INCLUDE_DIRS}")
|
||||
|
||||
# --- COMPILACIÓN DE SHADERS (Vulkan SPIR-V) ---
|
||||
find_program(GLSLC_EXE NAMES glslc)
|
||||
if(GLSLC_EXE)
|
||||
message(STATUS "glslc encontrado: ${GLSLC_EXE}")
|
||||
add_custom_target(compile_shaders
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D GLSLC=${GLSLC_EXE}
|
||||
-D SHADERS_DIR=${CMAKE_SOURCE_DIR}/shaders
|
||||
-P ${CMAKE_SOURCE_DIR}/tools/shaders/compile_shaders.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Compiling .vk.glsl shaders to SPIR-V")
|
||||
else()
|
||||
message(STATUS "glslc no encontrado — el target compile_shaders no estará disponible")
|
||||
endif()
|
||||
|
||||
# --- AÑADIR EJECUTABLE ---
|
||||
add_executable(${PROJECT_NAME} ${APP_SOURCES} ${EXTERNAL_SOURCES})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user