|
|
|
@ -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,8 +313,7 @@ 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) |
|
|
|
@ -330,45 +330,63 @@ add_dependencies(video_core host_shaders) |
|
|
|
target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE}) |
|
|
|
|
|
|
|
if(VulkanMemoryAllocator_ADDED) |
|
|
|
target_include_directories(video_core PUBLIC ${VulkanMemoryAllocator_SOURCE_DIR}/include) |
|
|
|
target_include_directories(video_core |
|
|
|
PUBLIC ${VulkanMemoryAllocator_SOURCE_DIR}/include) |
|
|
|
endif() |
|
|
|
|
|
|
|
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers VulkanUtilityHeaders) |
|
|
|
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") |
|
|
|
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers |
|
|
|
VulkanUtilityHeaders) |
|
|
|
endif() |
|
|
|
|
|
|
|
if(ENABLE_NSIGHT_AFTERMATH) |
|
|
|
if(NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK}) |
|
|
|
message(FATAL_ERROR "Environment variable NSIGHT_AFTERMATH_SDK has to be provided") |
|
|
|
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") |
|
|
|
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 |
|
|
|
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) |
|
|
|
# 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") |
|
|
|
@ -377,10 +395,8 @@ else() |
|
|
|
endif() |
|
|
|
|
|
|
|
if(ARCHITECTURE_x86_64) |
|
|
|
target_sources(video_core PRIVATE |
|
|
|
macro/macro_jit_x64.cpp |
|
|
|
macro/macro_jit_x64.h |
|
|
|
) |
|
|
|
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) |
|
|
|
|