Skip to content

Commit

Permalink
Merge branch 'master' into cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
uwerat committed Jan 9, 2024
2 parents 4b2f344 + 0992819 commit 17809ea
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 40 deletions.
16 changes: 16 additions & 0 deletions cmake/QskBuildFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,22 @@ function(qsk_add_example target)

endfunction()

function(qsk_add_shaders target)

cmake_parse_arguments( arg "" "" "FILES" ${ARGN} )

# assuming that OUTPUTS is not set in ARGV
foreach( file IN LISTS arg_FILES )
get_filename_component(qsbname "${file}" NAME)
string(REPLACE "-vulkan" "" qsbname "${qsbname}" )
list(APPEND outfiles "${qsbname}.qsb")
endforeach()

qt6_add_shaders( ${target} "qskshaders" BATCHABLE PRECOMPILE QUIET
PREFIX "/qskinny/shaders" ${ARGV} OUTPUTS ${outfiles} )

endfunction()

function(qsk_update_package_config_file target)

file(APPEND
Expand Down
56 changes: 16 additions & 40 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,21 @@ list(APPEND SOURCES

if (QT_VERSION_MAJOR VERSION_LESS 6)
qt_add_resources(SOURCES nodes/shaders.qrc)
else()
list(APPEND SHADERS
nodes/shaders/arcshadow-vulkan.vert
nodes/shaders/arcshadow-vulkan.frag
nodes/shaders/boxshadow-vulkan.vert
nodes/shaders/boxshadow-vulkan.frag
nodes/shaders/crisplines-vulkan.vert
nodes/shaders/crisplines-vulkan.frag
nodes/shaders/gradientconic-vulkan.vert
nodes/shaders/gradientconic-vulkan.frag
nodes/shaders/gradientlinear-vulkan.vert
nodes/shaders/gradientlinear-vulkan.frag
nodes/shaders/gradientradial-vulkan.vert
nodes/shaders/gradientradial-vulkan.frag
)
endif()

list(APPEND HEADERS
Expand Down Expand Up @@ -476,46 +491,7 @@ if(BUILD_QSKDLL)
endif()

if (QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6)

qt6_add_shaders(${target} "qskshaders"

BATCHABLE
PRECOMPILE

#OPTIMIZED
QUIET

PREFIX
"/qskinny/shaders"

FILES
nodes/shaders/arcshadow-vulkan.vert
nodes/shaders/arcshadow-vulkan.frag
nodes/shaders/boxshadow-vulkan.vert
nodes/shaders/boxshadow-vulkan.frag
nodes/shaders/crisplines-vulkan.vert
nodes/shaders/crisplines-vulkan.frag
nodes/shaders/gradientconic-vulkan.vert
nodes/shaders/gradientconic-vulkan.frag
nodes/shaders/gradientlinear-vulkan.vert
nodes/shaders/gradientlinear-vulkan.frag
nodes/shaders/gradientradial-vulkan.vert
nodes/shaders/gradientradial-vulkan.frag

OUTPUTS
arcshadow.vert.qsb
arcshadow.frag.qsb
boxshadow.vert.qsb
boxshadow.frag.qsb
crisplines.vert.qsb
crisplines.frag.qsb
gradientconic.vert.qsb
gradientconic.frag.qsb
gradientlinear.vert.qsb
gradientlinear.frag.qsb
gradientradial.vert.qsb
gradientradial.frag.qsb
)
qsk_add_shaders( ${target} FILES ${SHADERS} )
endif()

target_include_directories(${target} PUBLIC
Expand Down

0 comments on commit 17809ea

Please sign in to comment.