Skip to content

Commit

Permalink
vk_video_encoder: add missing GenerateDispatchTables
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrain34 committed Nov 12, 2024
1 parent 9ed93a0 commit 8c529d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 11 additions & 0 deletions vk_video_encoder/demos/vk-video-enc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ macro(compile_cuda src)
)
endmacro()

# Add the custom command to generate the dispatch tables
macro(generate_dispatch_table out)
add_custom_command(OUTPUT ${out}
COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/generate-dispatch-table.py ${out}
DEPENDS ${SCRIPTS_DIR}/generate-dispatch-table.py
)
endmacro()

generate_dispatch_table(${VK_VIDEO_COMMON_LIBS_SOURCE_ROOT}/VkCodecUtils/HelpersDispatchTable.h)
generate_dispatch_table(${VK_VIDEO_COMMON_LIBS_SOURCE_ROOT}/VkCodecUtils/HelpersDispatchTable.cpp)

set(sources
Main.cpp
${VK_VIDEO_ENCODER_LIBS_SOURCE_ROOT}/VkVideoEncoder/VkEncoderConfigH264.cpp
Expand Down
11 changes: 1 addition & 10 deletions vk_video_encoder/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ if(WIN32)
add_definitions(-DVK_USE_PLATFORM_WIN32_KHR)
endif()

# Define a custom target to generate the dispatch table files
add_custom_target(GenerateDispatchTables
DEPENDS ${VK_VIDEO_COMMON_LIBS_SOURCE_ROOT}/VkCodecUtils/HelpersDispatchTable.h
${VK_VIDEO_COMMON_LIBS_SOURCE_ROOT}/VkCodecUtils/HelpersDispatchTable.cpp
)

# Add the custom command to generate the dispatch tables
macro(generate_dispatch_table out)
add_custom_command(OUTPUT ${out}
Expand Down Expand Up @@ -111,8 +105,6 @@ include_directories(BEFORE ${VULKAN_VIDEO_ENCODER_INCLUDE})
include_directories(BEFORE ${VK_VIDEO_COMMON_LIBS_SOURCE_ROOT})

add_library(${VULKAN_VIDEO_ENCODER_LIB} SHARED ${LIBVKVIDEOENCODER})
# Ensure the library depends on the generation of these files
add_dependencies(${VULKAN_VIDEO_ENCODER_LIB} GenerateDispatchTables)

target_include_directories(${VULKAN_VIDEO_ENCODER_LIB} PUBLIC ${VULKAN_VIDEO_ENCODER_INCLUDE} ${VULKAN_VIDEO_ENCODER_INCLUDE}/../NvVideoParser PRIVATE include)
target_compile_definitions(${VULKAN_VIDEO_ENCODER_LIB}
Expand All @@ -135,8 +127,7 @@ if(WIN32)
endif()

add_library(${VULKAN_VIDEO_ENCODER_STATIC_LIB} STATIC ${LIBVKVIDEOENCODER})
# Ensure the library depends on the generation of these files
add_dependencies(${VULKAN_VIDEO_ENCODER_STATIC_LIB} GenerateDispatchTables)

target_include_directories(${VULKAN_VIDEO_ENCODER_STATIC_LIB} PUBLIC ${VULKAN_VIDEO_ENCODER_INCLUDE} ${VULKAN_VIDEO_ENCODER_INCLUDE}/../NvVideoParser PRIVATE include)

install(TARGETS ${VULKAN_VIDEO_ENCODER_LIB} ${VULKAN_VIDEO_ENCODER_STATIC_LIB}
Expand Down

0 comments on commit 8c529d3

Please sign in to comment.