CMakeLists.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. # SPDX-FileCopyrightText: 2018 yuzu Emulator Project
  2. # SPDX-License-Identifier: GPL-2.0-or-later
  3. add_library(shader_recompiler STATIC
  4. backend/bindings.h
  5. backend/glasm/emit_glasm.cpp
  6. backend/glasm/emit_glasm.h
  7. backend/glasm/emit_glasm_barriers.cpp
  8. backend/glasm/emit_glasm_bitwise_conversion.cpp
  9. backend/glasm/emit_glasm_composite.cpp
  10. backend/glasm/emit_glasm_context_get_set.cpp
  11. backend/glasm/emit_glasm_control_flow.cpp
  12. backend/glasm/emit_glasm_convert.cpp
  13. backend/glasm/emit_glasm_floating_point.cpp
  14. backend/glasm/emit_glasm_image.cpp
  15. backend/glasm/emit_glasm_instructions.h
  16. backend/glasm/emit_glasm_integer.cpp
  17. backend/glasm/emit_glasm_logical.cpp
  18. backend/glasm/emit_glasm_memory.cpp
  19. backend/glasm/emit_glasm_not_implemented.cpp
  20. backend/glasm/emit_glasm_select.cpp
  21. backend/glasm/emit_glasm_shared_memory.cpp
  22. backend/glasm/emit_glasm_special.cpp
  23. backend/glasm/emit_glasm_undefined.cpp
  24. backend/glasm/emit_glasm_warp.cpp
  25. backend/glasm/glasm_emit_context.cpp
  26. backend/glasm/glasm_emit_context.h
  27. backend/glasm/reg_alloc.cpp
  28. backend/glasm/reg_alloc.h
  29. backend/glsl/emit_glsl.cpp
  30. backend/glsl/emit_glsl.h
  31. backend/glsl/emit_glsl_atomic.cpp
  32. backend/glsl/emit_glsl_barriers.cpp
  33. backend/glsl/emit_glsl_bitwise_conversion.cpp
  34. backend/glsl/emit_glsl_composite.cpp
  35. backend/glsl/emit_glsl_context_get_set.cpp
  36. backend/glsl/emit_glsl_control_flow.cpp
  37. backend/glsl/emit_glsl_convert.cpp
  38. backend/glsl/emit_glsl_floating_point.cpp
  39. backend/glsl/emit_glsl_image.cpp
  40. backend/glsl/emit_glsl_instructions.h
  41. backend/glsl/emit_glsl_integer.cpp
  42. backend/glsl/emit_glsl_logical.cpp
  43. backend/glsl/emit_glsl_memory.cpp
  44. backend/glsl/emit_glsl_not_implemented.cpp
  45. backend/glsl/emit_glsl_select.cpp
  46. backend/glsl/emit_glsl_shared_memory.cpp
  47. backend/glsl/emit_glsl_special.cpp
  48. backend/glsl/emit_glsl_undefined.cpp
  49. backend/glsl/emit_glsl_warp.cpp
  50. backend/glsl/glsl_emit_context.cpp
  51. backend/glsl/glsl_emit_context.h
  52. backend/glsl/var_alloc.cpp
  53. backend/glsl/var_alloc.h
  54. backend/spirv/emit_spirv.cpp
  55. backend/spirv/emit_spirv.h
  56. backend/spirv/emit_spirv_atomic.cpp
  57. backend/spirv/emit_spirv_barriers.cpp
  58. backend/spirv/emit_spirv_bitwise_conversion.cpp
  59. backend/spirv/emit_spirv_composite.cpp
  60. backend/spirv/emit_spirv_context_get_set.cpp
  61. backend/spirv/emit_spirv_control_flow.cpp
  62. backend/spirv/emit_spirv_convert.cpp
  63. backend/spirv/emit_spirv_floating_point.cpp
  64. backend/spirv/emit_spirv_image.cpp
  65. backend/spirv/emit_spirv_image_atomic.cpp
  66. backend/spirv/emit_spirv_instructions.h
  67. backend/spirv/emit_spirv_integer.cpp
  68. backend/spirv/emit_spirv_logical.cpp
  69. backend/spirv/emit_spirv_memory.cpp
  70. backend/spirv/emit_spirv_select.cpp
  71. backend/spirv/emit_spirv_shared_memory.cpp
  72. backend/spirv/emit_spirv_special.cpp
  73. backend/spirv/emit_spirv_undefined.cpp
  74. backend/spirv/emit_spirv_warp.cpp
  75. backend/spirv/spirv_emit_context.cpp
  76. backend/spirv/spirv_emit_context.h
  77. environment.h
  78. exception.h
  79. frontend/ir/abstract_syntax_list.h
  80. frontend/ir/attribute.cpp
  81. frontend/ir/attribute.h
  82. frontend/ir/basic_block.cpp
  83. frontend/ir/basic_block.h
  84. frontend/ir/breadth_first_search.h
  85. frontend/ir/condition.cpp
  86. frontend/ir/condition.h
  87. frontend/ir/flow_test.cpp
  88. frontend/ir/flow_test.h
  89. frontend/ir/ir_emitter.cpp
  90. frontend/ir/ir_emitter.h
  91. frontend/ir/microinstruction.cpp
  92. frontend/ir/modifiers.h
  93. frontend/ir/opcodes.cpp
  94. frontend/ir/opcodes.h
  95. frontend/ir/opcodes.inc
  96. frontend/ir/patch.cpp
  97. frontend/ir/patch.h
  98. frontend/ir/post_order.cpp
  99. frontend/ir/post_order.h
  100. frontend/ir/pred.h
  101. frontend/ir/program.cpp
  102. frontend/ir/program.h
  103. frontend/ir/reg.h
  104. frontend/ir/type.cpp
  105. frontend/ir/type.h
  106. frontend/ir/value.cpp
  107. frontend/ir/value.h
  108. frontend/maxwell/control_flow.cpp
  109. frontend/maxwell/control_flow.h
  110. frontend/maxwell/decode.cpp
  111. frontend/maxwell/decode.h
  112. frontend/maxwell/indirect_branch_table_track.cpp
  113. frontend/maxwell/indirect_branch_table_track.h
  114. frontend/maxwell/instruction.h
  115. frontend/maxwell/location.h
  116. frontend/maxwell/maxwell.inc
  117. frontend/maxwell/opcodes.cpp
  118. frontend/maxwell/opcodes.h
  119. frontend/maxwell/structured_control_flow.cpp
  120. frontend/maxwell/structured_control_flow.h
  121. frontend/maxwell/translate/impl/atomic_operations_global_memory.cpp
  122. frontend/maxwell/translate/impl/atomic_operations_shared_memory.cpp
  123. frontend/maxwell/translate/impl/attribute_memory_to_physical.cpp
  124. frontend/maxwell/translate/impl/barrier_operations.cpp
  125. frontend/maxwell/translate/impl/bitfield_extract.cpp
  126. frontend/maxwell/translate/impl/bitfield_insert.cpp
  127. frontend/maxwell/translate/impl/branch_indirect.cpp
  128. frontend/maxwell/translate/impl/common_encoding.h
  129. frontend/maxwell/translate/impl/common_funcs.cpp
  130. frontend/maxwell/translate/impl/common_funcs.h
  131. frontend/maxwell/translate/impl/condition_code_set.cpp
  132. frontend/maxwell/translate/impl/double_add.cpp
  133. frontend/maxwell/translate/impl/double_compare_and_set.cpp
  134. frontend/maxwell/translate/impl/double_fused_multiply_add.cpp
  135. frontend/maxwell/translate/impl/double_min_max.cpp
  136. frontend/maxwell/translate/impl/double_multiply.cpp
  137. frontend/maxwell/translate/impl/double_set_predicate.cpp
  138. frontend/maxwell/translate/impl/exit_program.cpp
  139. frontend/maxwell/translate/impl/find_leading_one.cpp
  140. frontend/maxwell/translate/impl/floating_point_add.cpp
  141. frontend/maxwell/translate/impl/floating_point_compare.cpp
  142. frontend/maxwell/translate/impl/floating_point_compare_and_set.cpp
  143. frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp
  144. frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp
  145. frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp
  146. frontend/maxwell/translate/impl/floating_point_min_max.cpp
  147. frontend/maxwell/translate/impl/floating_point_multi_function.cpp
  148. frontend/maxwell/translate/impl/floating_point_multiply.cpp
  149. frontend/maxwell/translate/impl/floating_point_range_reduction.cpp
  150. frontend/maxwell/translate/impl/floating_point_set_predicate.cpp
  151. frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp
  152. frontend/maxwell/translate/impl/half_floating_point_add.cpp
  153. frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp
  154. frontend/maxwell/translate/impl/half_floating_point_helper.cpp
  155. frontend/maxwell/translate/impl/half_floating_point_helper.h
  156. frontend/maxwell/translate/impl/half_floating_point_multiply.cpp
  157. frontend/maxwell/translate/impl/half_floating_point_set.cpp
  158. frontend/maxwell/translate/impl/half_floating_point_set_predicate.cpp
  159. frontend/maxwell/translate/impl/impl.cpp
  160. frontend/maxwell/translate/impl/impl.h
  161. frontend/maxwell/translate/impl/integer_add.cpp
  162. frontend/maxwell/translate/impl/integer_add_three_input.cpp
  163. frontend/maxwell/translate/impl/integer_compare.cpp
  164. frontend/maxwell/translate/impl/integer_compare_and_set.cpp
  165. frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp
  166. frontend/maxwell/translate/impl/integer_funnel_shift.cpp
  167. frontend/maxwell/translate/impl/integer_minimum_maximum.cpp
  168. frontend/maxwell/translate/impl/integer_popcount.cpp
  169. frontend/maxwell/translate/impl/integer_scaled_add.cpp
  170. frontend/maxwell/translate/impl/integer_set_predicate.cpp
  171. frontend/maxwell/translate/impl/integer_shift_left.cpp
  172. frontend/maxwell/translate/impl/integer_shift_right.cpp
  173. frontend/maxwell/translate/impl/integer_short_multiply_add.cpp
  174. frontend/maxwell/translate/impl/integer_to_integer_conversion.cpp
  175. frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp
  176. frontend/maxwell/translate/impl/load_constant.cpp
  177. frontend/maxwell/translate/impl/load_constant.h
  178. frontend/maxwell/translate/impl/load_effective_address.cpp
  179. frontend/maxwell/translate/impl/load_store_attribute.cpp
  180. frontend/maxwell/translate/impl/load_store_local_shared.cpp
  181. frontend/maxwell/translate/impl/load_store_memory.cpp
  182. frontend/maxwell/translate/impl/logic_operation.cpp
  183. frontend/maxwell/translate/impl/logic_operation_three_input.cpp
  184. frontend/maxwell/translate/impl/move_predicate_to_register.cpp
  185. frontend/maxwell/translate/impl/move_register.cpp
  186. frontend/maxwell/translate/impl/move_register_to_predicate.cpp
  187. frontend/maxwell/translate/impl/move_special_register.cpp
  188. frontend/maxwell/translate/impl/not_implemented.cpp
  189. frontend/maxwell/translate/impl/output_geometry.cpp
  190. frontend/maxwell/translate/impl/pixel_load.cpp
  191. frontend/maxwell/translate/impl/predicate_set_predicate.cpp
  192. frontend/maxwell/translate/impl/predicate_set_register.cpp
  193. frontend/maxwell/translate/impl/select_source_with_predicate.cpp
  194. frontend/maxwell/translate/impl/surface_atomic_operations.cpp
  195. frontend/maxwell/translate/impl/surface_load_store.cpp
  196. frontend/maxwell/translate/impl/texture_fetch.cpp
  197. frontend/maxwell/translate/impl/texture_fetch_swizzled.cpp
  198. frontend/maxwell/translate/impl/texture_gather.cpp
  199. frontend/maxwell/translate/impl/texture_gather_swizzled.cpp
  200. frontend/maxwell/translate/impl/texture_gradient.cpp
  201. frontend/maxwell/translate/impl/texture_load.cpp
  202. frontend/maxwell/translate/impl/texture_load_swizzled.cpp
  203. frontend/maxwell/translate/impl/texture_mipmap_level.cpp
  204. frontend/maxwell/translate/impl/texture_query.cpp
  205. frontend/maxwell/translate/impl/video_helper.cpp
  206. frontend/maxwell/translate/impl/video_helper.h
  207. frontend/maxwell/translate/impl/video_minimum_maximum.cpp
  208. frontend/maxwell/translate/impl/video_multiply_add.cpp
  209. frontend/maxwell/translate/impl/video_set_predicate.cpp
  210. frontend/maxwell/translate/impl/vote.cpp
  211. frontend/maxwell/translate/impl/warp_shuffle.cpp
  212. frontend/maxwell/translate/translate.cpp
  213. frontend/maxwell/translate/translate.h
  214. frontend/maxwell/translate_program.cpp
  215. frontend/maxwell/translate_program.h
  216. host_translate_info.h
  217. ir_opt/collect_shader_info_pass.cpp
  218. ir_opt/constant_propagation_pass.cpp
  219. ir_opt/dead_code_elimination_pass.cpp
  220. ir_opt/dual_vertex_pass.cpp
  221. ir_opt/global_memory_to_storage_buffer_pass.cpp
  222. ir_opt/identity_removal_pass.cpp
  223. ir_opt/layer_pass.cpp
  224. ir_opt/lower_fp16_to_fp32.cpp
  225. ir_opt/lower_int64_to_int32.cpp
  226. ir_opt/passes.h
  227. ir_opt/position_pass.cpp
  228. ir_opt/rescaling_pass.cpp
  229. ir_opt/ssa_rewrite_pass.cpp
  230. ir_opt/texture_pass.cpp
  231. ir_opt/verification_pass.cpp
  232. object_pool.h
  233. precompiled_headers.h
  234. profile.h
  235. program_header.h
  236. runtime_info.h
  237. shader_info.h
  238. varying_state.h
  239. )
  240. target_link_libraries(shader_recompiler PUBLIC common fmt::fmt sirit)
  241. if (MSVC)
  242. target_compile_options(shader_recompiler PRIVATE
  243. /W4
  244. /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
  245. /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
  246. /we4800 # Implicit conversion from 'type' to bool. Possible information loss
  247. )
  248. else()
  249. target_compile_options(shader_recompiler PRIVATE
  250. -Werror=conversion
  251. # Bracket depth determines maximum size of a fold expression in Clang since 9c9974c3ccb6.
  252. # And this in turns limits the size of a std::array.
  253. $<$<CXX_COMPILER_ID:Clang>:-fbracket-depth=1024>
  254. $<$<CXX_COMPILER_ID:AppleClang>:-fbracket-depth=1024>
  255. )
  256. endif()
  257. create_target_directory_groups(shader_recompiler)
  258. if (YUZU_USE_PRECOMPILED_HEADERS)
  259. target_precompile_headers(shader_recompiler PRIVATE precompiled_headers.h)
  260. endif()