CMakeLists.txt 9.8 KB

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