|
|
|
@ -1,5 +1,5 @@ |
|
|
|
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project |
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later |
|
|
|
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project SPDX-License-Identifier: |
|
|
|
# GPL-2.0-or-later |
|
|
|
|
|
|
|
add_subdirectory(host_shaders) |
|
|
|
|
|
|
|
@ -9,7 +9,8 @@ if(LIBVA_FOUND) |
|
|
|
list(APPEND FFmpeg_LIBRARIES ${LIBVA_LIBRARIES}) |
|
|
|
endif() |
|
|
|
|
|
|
|
add_library(video_core STATIC |
|
|
|
add_library( |
|
|
|
video_core STATIC |
|
|
|
buffer_cache/buffer_base.h |
|
|
|
buffer_cache/buffer_cache_base.h |
|
|
|
buffer_cache/buffer_cache.cpp |
|
|
|
@ -312,13 +313,12 @@ add_library(video_core STATIC |
|
|
|
vulkan_common/nsight_aftermath_tracker.h |
|
|
|
vulkan_common/vma.cpp |
|
|
|
vulkan_common/vma.h |
|
|
|
vulkan_common/vulkan.h |
|
|
|
) |
|
|
|
vulkan_common/vulkan.h) |
|
|
|
|
|
|
|
target_link_libraries(video_core PUBLIC common core) |
|
|
|
target_link_libraries(video_core PUBLIC glad shader_recompiler stb bc_decoder) |
|
|
|
|
|
|
|
if (YUZU_USE_BUNDLED_FFMPEG AND NOT (WIN32 OR ANDROID)) |
|
|
|
if(YUZU_USE_BUNDLED_FFMPEG AND NOT (WIN32 OR ANDROID)) |
|
|
|
add_dependencies(video_core ffmpeg-build) |
|
|
|
endif() |
|
|
|
|
|
|
|
@ -331,76 +331,88 @@ target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE}) |
|
|
|
|
|
|
|
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers Vulkan::UtilityHeaders GPUOpen::VulkanMemoryAllocator) |
|
|
|
|
|
|
|
if (ENABLE_NSIGHT_AFTERMATH) |
|
|
|
if (NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK}) |
|
|
|
message(FATAL_ERROR "Environment variable NSIGHT_AFTERMATH_SDK has to be provided") |
|
|
|
if(ENABLE_NSIGHT_AFTERMATH) |
|
|
|
if(NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK}) |
|
|
|
message( |
|
|
|
FATAL_ERROR "Environment variable NSIGHT_AFTERMATH_SDK has to be provided" |
|
|
|
) |
|
|
|
endif() |
|
|
|
if (NOT WIN32) |
|
|
|
message(FATAL_ERROR "Nsight Aftermath doesn't support non-Windows platforms") |
|
|
|
if(NOT WIN32) |
|
|
|
message( |
|
|
|
FATAL_ERROR "Nsight Aftermath doesn't support non-Windows platforms") |
|
|
|
endif() |
|
|
|
target_compile_definitions(video_core PRIVATE HAS_NSIGHT_AFTERMATH) |
|
|
|
target_include_directories(video_core PRIVATE "$ENV{NSIGHT_AFTERMATH_SDK}/include") |
|
|
|
target_include_directories(video_core |
|
|
|
PRIVATE "$ENV{NSIGHT_AFTERMATH_SDK}/include") |
|
|
|
endif() |
|
|
|
|
|
|
|
if (MSVC) |
|
|
|
target_compile_options(video_core PRIVATE |
|
|
|
/we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data |
|
|
|
/we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data |
|
|
|
if(MSVC) |
|
|
|
target_compile_options( |
|
|
|
video_core |
|
|
|
PRIVATE /we4242 # 'identifier': conversion from 'type1' to 'type2', possible |
|
|
|
# loss of data |
|
|
|
/we4244 # 'conversion': conversion from 'type1' to 'type2', possible |
|
|
|
# loss of data |
|
|
|
) |
|
|
|
else() |
|
|
|
if (APPLE) |
|
|
|
# error: declaration shadows a typedef in 'interval_base_set<SubType, DomainT, Compare, Interval, Alloc>' |
|
|
|
# error: implicit conversion loses integer precision: 'int' to 'boost::icl::bound_type' (aka 'unsigned char') |
|
|
|
target_compile_options(video_core PRIVATE -Wno-shadow -Wno-unused-local-typedef) |
|
|
|
if(APPLE) |
|
|
|
# error: declaration shadows a typedef in 'interval_base_set<SubType, |
|
|
|
# DomainT, Compare, Interval, Alloc>' error: implicit conversion loses |
|
|
|
# integer precision: 'int' to 'boost::icl::bound_type' (aka 'unsigned char') |
|
|
|
target_compile_options(video_core PRIVATE -Wno-shadow |
|
|
|
-Wno-unused-local-typedef) |
|
|
|
else() |
|
|
|
target_compile_options(video_core PRIVATE -Werror=conversion) |
|
|
|
endif() |
|
|
|
|
|
|
|
target_compile_options(video_core PRIVATE |
|
|
|
-Wno-sign-conversion |
|
|
|
) |
|
|
|
target_compile_options(video_core PRIVATE -Wno-sign-conversion) |
|
|
|
|
|
|
|
# xbyak |
|
|
|
set_source_files_properties(macro/macro_jit_x64.cpp PROPERTIES COMPILE_OPTIONS "-Wno-conversion;-Wno-shadow") |
|
|
|
set_source_files_properties( |
|
|
|
macro/macro_jit_x64.cpp PROPERTIES COMPILE_OPTIONS |
|
|
|
"-Wno-conversion;-Wno-shadow") |
|
|
|
|
|
|
|
# VMA |
|
|
|
set_source_files_properties(vulkan_common/vma.cpp PROPERTIES COMPILE_OPTIONS "-Wno-conversion;-Wno-unused-variable;-Wno-unused-parameter;-Wno-missing-field-initializers") |
|
|
|
set_source_files_properties( |
|
|
|
vulkan_common/vma.cpp |
|
|
|
PROPERTIES |
|
|
|
COMPILE_OPTIONS |
|
|
|
"-Wno-conversion;-Wno-unused-variable;-Wno-unused-parameter;-Wno-missing-field-initializers" |
|
|
|
) |
|
|
|
|
|
|
|
# Get around GCC failing with intrinsics in Debug |
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_BUILD_TYPE MATCHES "Debug") |
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_BUILD_TYPE MATCHES "Debug") |
|
|
|
set_source_files_properties(host1x/vic.cpp PROPERTIES COMPILE_OPTIONS "-O2") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
if (ARCHITECTURE_x86_64) |
|
|
|
target_sources(video_core PRIVATE |
|
|
|
macro/macro_jit_x64.cpp |
|
|
|
macro/macro_jit_x64.h |
|
|
|
) |
|
|
|
if(ARCHITECTURE_x86_64) |
|
|
|
target_sources(video_core PRIVATE macro/macro_jit_x64.cpp |
|
|
|
macro/macro_jit_x64.h) |
|
|
|
target_link_libraries(video_core PUBLIC xbyak::xbyak) |
|
|
|
|
|
|
|
if (NOT MSVC) |
|
|
|
if(NOT MSVC) |
|
|
|
target_compile_options(video_core PRIVATE -msse4.1) |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) |
|
|
|
if(ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) |
|
|
|
target_link_libraries(video_core PRIVATE dynarmic::dynarmic) |
|
|
|
endif() |
|
|
|
|
|
|
|
if (YUZU_USE_PRECOMPILED_HEADERS) |
|
|
|
if(YUZU_USE_PRECOMPILED_HEADERS) |
|
|
|
target_precompile_headers(video_core PRIVATE precompiled_headers.h) |
|
|
|
endif() |
|
|
|
|
|
|
|
if (YUZU_ENABLE_LTO) |
|
|
|
if(YUZU_ENABLE_LTO) |
|
|
|
set_property(TARGET video_core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) |
|
|
|
endif() |
|
|
|
|
|
|
|
if (ANDROID AND ARCHITECTURE_arm64) |
|
|
|
if(ANDROID AND ARCHITECTURE_arm64) |
|
|
|
target_link_libraries(video_core PRIVATE adrenotools) |
|
|
|
endif() |
|
|
|
|
|
|
|
if (ARCHITECTURE_arm64) |
|
|
|
if(ARCHITECTURE_arm64) |
|
|
|
target_link_libraries(video_core PRIVATE sse2neon) |
|
|
|
endif() |
|
|
|
|
|
|
|
|