major refactor and add a camera
change asset loading of images to be sRGB use wayland by default on linux unless we are running under renderdoc changed shaders to be combined vertex and fragment in a single file require Vulkan 1.3 and enable shaderDrawParameters
This commit is contained in:
+13
-7
@@ -43,20 +43,26 @@ function(add_shader name)
|
||||
set(OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/assets/shader/${name}.h)
|
||||
|
||||
if (SLANGC)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(SLANG_FLAGS -g3 -O0)
|
||||
else()
|
||||
set(SLANG_FLAGS -O3)
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${OUTPUT_FILE}
|
||||
COMMAND ${SLANGC} ${INPUT_FILE} -g3 -O0 -emit-spirv-via-glsl -entry main -target spirv -profile glsl_330 -o ${OUTPUT_FILE} -source-embed-style u8 -source-embed-name SPIRV_${name}
|
||||
COMMAND ${SLANGC} -target spirv -validate-uniformity -o ${OUTPUT_FILE} -source-embed-style u8 -source-embed-name SPIRV_${name} ${SLANG_FLAGS} -- ${INPUT_FILE}
|
||||
DEPENDS ${INPUT_FILE}
|
||||
)
|
||||
endif()
|
||||
|
||||
add_custom_target(${name}
|
||||
add_custom_target(SHADER_${name}
|
||||
DEPENDS ${OUTPUT_FILE}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
add_shader(basic_vertex_shader)
|
||||
add_shader(basic_pixel_shader)
|
||||
add_shader(basic)
|
||||
add_shader(world)
|
||||
|
||||
add_executable(mikemon
|
||||
src/log.cpp
|
||||
@@ -70,7 +76,7 @@ target_link_libraries(mikemon
|
||||
stb_image
|
||||
imgui
|
||||
)
|
||||
add_dependencies(mikemon
|
||||
basic_vertex_shader
|
||||
basic_pixel_shader
|
||||
add_dependencies(mikemon
|
||||
SHADER_basic
|
||||
SHADER_world
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user