CMakeLists.txt 11 KB

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