CMakeLists.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. add_subdirectory(host_shaders)
  2. add_library(video_core STATIC
  3. buffer_cache/buffer_base.h
  4. buffer_cache/buffer_cache.cpp
  5. buffer_cache/buffer_cache.h
  6. cdma_pusher.cpp
  7. cdma_pusher.h
  8. command_classes/codecs/codec.cpp
  9. command_classes/codecs/codec.h
  10. command_classes/codecs/h264.cpp
  11. command_classes/codecs/h264.h
  12. command_classes/codecs/vp9.cpp
  13. command_classes/codecs/vp9.h
  14. command_classes/codecs/vp9_types.h
  15. command_classes/host1x.cpp
  16. command_classes/host1x.h
  17. command_classes/nvdec.cpp
  18. command_classes/nvdec.h
  19. command_classes/nvdec_common.h
  20. command_classes/sync_manager.cpp
  21. command_classes/sync_manager.h
  22. command_classes/vic.cpp
  23. command_classes/vic.h
  24. compatible_formats.cpp
  25. compatible_formats.h
  26. delayed_destruction_ring.h
  27. dirty_flags.cpp
  28. dirty_flags.h
  29. dma_pusher.cpp
  30. dma_pusher.h
  31. engines/const_buffer_engine_interface.h
  32. engines/const_buffer_info.h
  33. engines/engine_interface.h
  34. engines/engine_upload.cpp
  35. engines/engine_upload.h
  36. engines/fermi_2d.cpp
  37. engines/fermi_2d.h
  38. engines/kepler_compute.cpp
  39. engines/kepler_compute.h
  40. engines/kepler_memory.cpp
  41. engines/kepler_memory.h
  42. engines/maxwell_3d.cpp
  43. engines/maxwell_3d.h
  44. engines/maxwell_dma.cpp
  45. engines/maxwell_dma.h
  46. engines/shader_bytecode.h
  47. engines/shader_header.h
  48. engines/shader_type.h
  49. framebuffer_config.h
  50. macro/macro.cpp
  51. macro/macro.h
  52. macro/macro_hle.cpp
  53. macro/macro_hle.h
  54. macro/macro_interpreter.cpp
  55. macro/macro_interpreter.h
  56. macro/macro_jit_x64.cpp
  57. macro/macro_jit_x64.h
  58. fence_manager.h
  59. gpu.cpp
  60. gpu.h
  61. gpu_thread.cpp
  62. gpu_thread.h
  63. guest_driver.cpp
  64. guest_driver.h
  65. memory_manager.cpp
  66. memory_manager.h
  67. query_cache.h
  68. rasterizer_accelerated.cpp
  69. rasterizer_accelerated.h
  70. rasterizer_interface.h
  71. renderer_base.cpp
  72. renderer_base.h
  73. renderer_opengl/gl_arb_decompiler.cpp
  74. renderer_opengl/gl_arb_decompiler.h
  75. renderer_opengl/gl_buffer_cache.cpp
  76. renderer_opengl/gl_buffer_cache.h
  77. renderer_opengl/gl_device.cpp
  78. renderer_opengl/gl_device.h
  79. renderer_opengl/gl_fence_manager.cpp
  80. renderer_opengl/gl_fence_manager.h
  81. renderer_opengl/gl_rasterizer.cpp
  82. renderer_opengl/gl_rasterizer.h
  83. renderer_opengl/gl_resource_manager.cpp
  84. renderer_opengl/gl_resource_manager.h
  85. renderer_opengl/gl_shader_cache.cpp
  86. renderer_opengl/gl_shader_cache.h
  87. renderer_opengl/gl_shader_decompiler.cpp
  88. renderer_opengl/gl_shader_decompiler.h
  89. renderer_opengl/gl_shader_disk_cache.cpp
  90. renderer_opengl/gl_shader_disk_cache.h
  91. renderer_opengl/gl_shader_manager.cpp
  92. renderer_opengl/gl_shader_manager.h
  93. renderer_opengl/gl_shader_util.cpp
  94. renderer_opengl/gl_shader_util.h
  95. renderer_opengl/gl_state_tracker.cpp
  96. renderer_opengl/gl_state_tracker.h
  97. renderer_opengl/gl_stream_buffer.cpp
  98. renderer_opengl/gl_stream_buffer.h
  99. renderer_opengl/gl_texture_cache.cpp
  100. renderer_opengl/gl_texture_cache.h
  101. renderer_opengl/gl_query_cache.cpp
  102. renderer_opengl/gl_query_cache.h
  103. renderer_opengl/maxwell_to_gl.h
  104. renderer_opengl/renderer_opengl.cpp
  105. renderer_opengl/renderer_opengl.h
  106. renderer_opengl/util_shaders.cpp
  107. renderer_opengl/util_shaders.h
  108. renderer_vulkan/blit_image.cpp
  109. renderer_vulkan/blit_image.h
  110. renderer_vulkan/fixed_pipeline_state.cpp
  111. renderer_vulkan/fixed_pipeline_state.h
  112. renderer_vulkan/maxwell_to_vk.cpp
  113. renderer_vulkan/maxwell_to_vk.h
  114. renderer_vulkan/renderer_vulkan.h
  115. renderer_vulkan/renderer_vulkan.cpp
  116. renderer_vulkan/vk_blit_screen.cpp
  117. renderer_vulkan/vk_blit_screen.h
  118. renderer_vulkan/vk_buffer_cache.cpp
  119. renderer_vulkan/vk_buffer_cache.h
  120. renderer_vulkan/vk_command_pool.cpp
  121. renderer_vulkan/vk_command_pool.h
  122. renderer_vulkan/vk_compute_pass.cpp
  123. renderer_vulkan/vk_compute_pass.h
  124. renderer_vulkan/vk_compute_pipeline.cpp
  125. renderer_vulkan/vk_compute_pipeline.h
  126. renderer_vulkan/vk_descriptor_pool.cpp
  127. renderer_vulkan/vk_descriptor_pool.h
  128. renderer_vulkan/vk_fence_manager.cpp
  129. renderer_vulkan/vk_fence_manager.h
  130. renderer_vulkan/vk_graphics_pipeline.cpp
  131. renderer_vulkan/vk_graphics_pipeline.h
  132. renderer_vulkan/vk_master_semaphore.cpp
  133. renderer_vulkan/vk_master_semaphore.h
  134. renderer_vulkan/vk_pipeline_cache.cpp
  135. renderer_vulkan/vk_pipeline_cache.h
  136. renderer_vulkan/vk_query_cache.cpp
  137. renderer_vulkan/vk_query_cache.h
  138. renderer_vulkan/vk_rasterizer.cpp
  139. renderer_vulkan/vk_rasterizer.h
  140. renderer_vulkan/vk_resource_pool.cpp
  141. renderer_vulkan/vk_resource_pool.h
  142. renderer_vulkan/vk_scheduler.cpp
  143. renderer_vulkan/vk_scheduler.h
  144. renderer_vulkan/vk_shader_decompiler.cpp
  145. renderer_vulkan/vk_shader_decompiler.h
  146. renderer_vulkan/vk_shader_util.cpp
  147. renderer_vulkan/vk_shader_util.h
  148. renderer_vulkan/vk_staging_buffer_pool.cpp
  149. renderer_vulkan/vk_staging_buffer_pool.h
  150. renderer_vulkan/vk_state_tracker.cpp
  151. renderer_vulkan/vk_state_tracker.h
  152. renderer_vulkan/vk_swapchain.cpp
  153. renderer_vulkan/vk_swapchain.h
  154. renderer_vulkan/vk_texture_cache.cpp
  155. renderer_vulkan/vk_texture_cache.h
  156. renderer_vulkan/vk_update_descriptor.cpp
  157. renderer_vulkan/vk_update_descriptor.h
  158. shader_cache.h
  159. shader_notify.cpp
  160. shader_notify.h
  161. shader/decode/arithmetic.cpp
  162. shader/decode/arithmetic_immediate.cpp
  163. shader/decode/bfe.cpp
  164. shader/decode/bfi.cpp
  165. shader/decode/shift.cpp
  166. shader/decode/arithmetic_integer.cpp
  167. shader/decode/arithmetic_integer_immediate.cpp
  168. shader/decode/arithmetic_half.cpp
  169. shader/decode/arithmetic_half_immediate.cpp
  170. shader/decode/ffma.cpp
  171. shader/decode/hfma2.cpp
  172. shader/decode/conversion.cpp
  173. shader/decode/memory.cpp
  174. shader/decode/texture.cpp
  175. shader/decode/image.cpp
  176. shader/decode/float_set_predicate.cpp
  177. shader/decode/integer_set_predicate.cpp
  178. shader/decode/half_set_predicate.cpp
  179. shader/decode/predicate_set_register.cpp
  180. shader/decode/predicate_set_predicate.cpp
  181. shader/decode/register_set_predicate.cpp
  182. shader/decode/float_set.cpp
  183. shader/decode/integer_set.cpp
  184. shader/decode/half_set.cpp
  185. shader/decode/video.cpp
  186. shader/decode/warp.cpp
  187. shader/decode/xmad.cpp
  188. shader/decode/other.cpp
  189. shader/ast.cpp
  190. shader/ast.h
  191. shader/async_shaders.cpp
  192. shader/async_shaders.h
  193. shader/compiler_settings.cpp
  194. shader/compiler_settings.h
  195. shader/control_flow.cpp
  196. shader/control_flow.h
  197. shader/decode.cpp
  198. shader/expr.cpp
  199. shader/expr.h
  200. shader/memory_util.cpp
  201. shader/memory_util.h
  202. shader/node_helper.cpp
  203. shader/node_helper.h
  204. shader/node.h
  205. shader/registry.cpp
  206. shader/registry.h
  207. shader/shader_ir.cpp
  208. shader/shader_ir.h
  209. shader/track.cpp
  210. shader/transform_feedback.cpp
  211. shader/transform_feedback.h
  212. surface.cpp
  213. surface.h
  214. texture_cache/accelerated_swizzle.cpp
  215. texture_cache/accelerated_swizzle.h
  216. texture_cache/decode_bc4.cpp
  217. texture_cache/decode_bc4.h
  218. texture_cache/descriptor_table.h
  219. texture_cache/formatter.cpp
  220. texture_cache/formatter.h
  221. texture_cache/format_lookup_table.cpp
  222. texture_cache/format_lookup_table.h
  223. texture_cache/image_base.cpp
  224. texture_cache/image_base.h
  225. texture_cache/image_info.cpp
  226. texture_cache/image_info.h
  227. texture_cache/image_view_base.cpp
  228. texture_cache/image_view_base.h
  229. texture_cache/image_view_info.cpp
  230. texture_cache/image_view_info.h
  231. texture_cache/render_targets.h
  232. texture_cache/samples_helper.h
  233. texture_cache/slot_vector.h
  234. texture_cache/texture_cache.h
  235. texture_cache/types.h
  236. texture_cache/util.cpp
  237. texture_cache/util.h
  238. textures/astc.h
  239. textures/decoders.cpp
  240. textures/decoders.h
  241. textures/texture.cpp
  242. textures/texture.h
  243. video_core.cpp
  244. video_core.h
  245. vulkan_common/vulkan_debug_callback.cpp
  246. vulkan_common/vulkan_debug_callback.h
  247. vulkan_common/vulkan_device.cpp
  248. vulkan_common/vulkan_device.h
  249. vulkan_common/vulkan_instance.cpp
  250. vulkan_common/vulkan_instance.h
  251. vulkan_common/vulkan_library.cpp
  252. vulkan_common/vulkan_library.h
  253. vulkan_common/vulkan_memory_allocator.cpp
  254. vulkan_common/vulkan_memory_allocator.h
  255. vulkan_common/vulkan_surface.cpp
  256. vulkan_common/vulkan_surface.h
  257. vulkan_common/vulkan_wrapper.cpp
  258. vulkan_common/vulkan_wrapper.h
  259. vulkan_common/nsight_aftermath_tracker.cpp
  260. vulkan_common/nsight_aftermath_tracker.h
  261. )
  262. create_target_directory_groups(video_core)
  263. target_link_libraries(video_core PUBLIC common core)
  264. target_link_libraries(video_core PRIVATE glad xbyak)
  265. if (YUZU_USE_BUNDLED_FFMPEG AND NOT WIN32)
  266. add_dependencies(video_core ffmpeg-build)
  267. endif()
  268. target_include_directories(video_core PRIVATE ${FFmpeg_INCLUDE_DIR})
  269. target_link_libraries(video_core PRIVATE ${FFmpeg_LIBRARIES})
  270. add_dependencies(video_core host_shaders)
  271. target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE})
  272. target_include_directories(video_core PRIVATE sirit ../../externals/Vulkan-Headers/include)
  273. target_link_libraries(video_core PRIVATE sirit)
  274. if (ENABLE_NSIGHT_AFTERMATH)
  275. if (NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK})
  276. message(FATAL_ERROR "Environment variable NSIGHT_AFTERMATH_SDK has to be provided")
  277. endif()
  278. if (NOT WIN32)
  279. message(FATAL_ERROR "Nsight Aftermath doesn't support non-Windows platforms")
  280. endif()
  281. target_compile_definitions(video_core PRIVATE HAS_NSIGHT_AFTERMATH)
  282. target_include_directories(video_core PRIVATE "$ENV{NSIGHT_AFTERMATH_SDK}/include")
  283. endif()
  284. if (MSVC)
  285. target_compile_options(video_core PRIVATE
  286. /we4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data
  287. /we4456 # Declaration of 'identifier' hides previous local declaration
  288. /we4457 # Declaration of 'identifier' hides function parameter
  289. /we4458 # Declaration of 'identifier' hides class member
  290. /we4459 # Declaration of 'identifier' hides global declaration
  291. /we4715 # 'function' : not all control paths return a value
  292. )
  293. else()
  294. target_compile_options(video_core PRIVATE
  295. -Werror=conversion
  296. -Wno-error=sign-conversion
  297. -Werror=pessimizing-move
  298. -Werror=redundant-move
  299. -Werror=shadow
  300. -Werror=type-limits
  301. $<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess>
  302. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
  303. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>
  304. )
  305. endif()