summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/CMakeLists.txt
blob: becdb7d54a7307de96c28757903c2b18ce2e40d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
add_library(shader_recompiler STATIC
    backend/bindings.h
    backend/glasm/emit_context.cpp
    backend/glasm/emit_context.h
    backend/glasm/emit_glasm.cpp
    backend/glasm/emit_glasm.h
    backend/glasm/emit_glasm_atomic.cpp
    backend/glasm/emit_glasm_barriers.cpp
    backend/glasm/emit_glasm_bitwise_conversion.cpp
    backend/glasm/emit_glasm_composite.cpp
    backend/glasm/emit_glasm_context_get_set.cpp
    backend/glasm/emit_glasm_control_flow.cpp
    backend/glasm/emit_glasm_convert.cpp
    backend/glasm/emit_glasm_floating_point.cpp
    backend/glasm/emit_glasm_image.cpp
    backend/glasm/emit_glasm_instructions.h
    backend/glasm/emit_glasm_integer.cpp
    backend/glasm/emit_glasm_logical.cpp
    backend/glasm/emit_glasm_memory.cpp
    backend/glasm/emit_glasm_not_implemented.cpp
    backend/glasm/emit_glasm_select.cpp
    backend/glasm/emit_glasm_shared_memory.cpp
    backend/glasm/emit_glasm_special.cpp
    backend/glasm/emit_glasm_undefined.cpp
    backend/glasm/emit_glasm_warp.cpp
    backend/glasm/reg_alloc.cpp
    backend/glasm/reg_alloc.h
    backend/spirv/emit_context.cpp
    backend/spirv/emit_context.h
    backend/spirv/emit_spirv.cpp
    backend/spirv/emit_spirv.h
    backend/spirv/emit_spirv_atomic.cpp
    backend/spirv/emit_spirv_barriers.cpp
    backend/spirv/emit_spirv_bitwise_conversion.cpp
    backend/spirv/emit_spirv_composite.cpp
    backend/spirv/emit_spirv_context_get_set.cpp
    backend/spirv/emit_spirv_control_flow.cpp
    backend/spirv/emit_spirv_convert.cpp
    backend/spirv/emit_spirv_floating_point.cpp
    backend/spirv/emit_spirv_image.cpp
    backend/spirv/emit_spirv_image_atomic.cpp
    backend/spirv/emit_spirv_instructions.h
    backend/spirv/emit_spirv_integer.cpp
    backend/spirv/emit_spirv_logical.cpp
    backend/spirv/emit_spirv_memory.cpp
    backend/spirv/emit_spirv_select.cpp
    backend/spirv/emit_spirv_shared_memory.cpp
    backend/spirv/emit_spirv_special.cpp
    backend/spirv/emit_spirv_undefined.cpp
    backend/spirv/emit_spirv_warp.cpp
    environment.h
    exception.h
    frontend/ir/abstract_syntax_list.h
    frontend/ir/attribute.cpp
    frontend/ir/attribute.h
    frontend/ir/basic_block.cpp
    frontend/ir/basic_block.h
    frontend/ir/breadth_first_search.h
    frontend/ir/condition.cpp
    frontend/ir/condition.h
    frontend/ir/flow_test.cpp
    frontend/ir/flow_test.h
    frontend/ir/ir_emitter.cpp
    frontend/ir/ir_emitter.h
    frontend/ir/microinstruction.cpp
    frontend/ir/modifiers.h
    frontend/ir/opcodes.cpp
    frontend/ir/opcodes.h
    frontend/ir/opcodes.inc
    frontend/ir/patch.cpp
    frontend/ir/patch.h
    frontend/ir/post_order.cpp
    frontend/ir/post_order.h
    frontend/ir/pred.h
    frontend/ir/program.cpp
    frontend/ir/program.h
    frontend/ir/reg.h
    frontend/ir/type.cpp
    frontend/ir/type.h
    frontend/ir/value.cpp
    frontend/ir/value.h
    frontend/maxwell/control_flow.cpp
    frontend/maxwell/control_flow.h
    frontend/maxwell/decode.cpp
    frontend/maxwell/decode.h
    frontend/maxwell/indirect_branch_table_track.cpp
    frontend/maxwell/indirect_branch_table_track.h
    frontend/maxwell/instruction.h
    frontend/maxwell/location.h
    frontend/maxwell/maxwell.inc
    frontend/maxwell/opcodes.cpp
    frontend/maxwell/opcodes.h
    frontend/maxwell/program.cpp
    frontend/maxwell/program.h
    frontend/maxwell/structured_control_flow.cpp
    frontend/maxwell/structured_control_flow.h
    frontend/maxwell/translate/impl/atomic_operations_global_memory.cpp
    frontend/maxwell/translate/impl/atomic_operations_shared_memory.cpp
    frontend/maxwell/translate/impl/attribute_memory_to_physical.cpp
    frontend/maxwell/translate/impl/barrier_operations.cpp
    frontend/maxwell/translate/impl/bitfield_extract.cpp
    frontend/maxwell/translate/impl/bitfield_insert.cpp
    frontend/maxwell/translate/impl/branch_indirect.cpp
    frontend/maxwell/translate/impl/common_encoding.h
    frontend/maxwell/translate/impl/common_funcs.cpp
    frontend/maxwell/translate/impl/common_funcs.h
    frontend/maxwell/translate/impl/condition_code_set.cpp
    frontend/maxwell/translate/impl/double_add.cpp
    frontend/maxwell/translate/impl/double_compare_and_set.cpp
    frontend/maxwell/translate/impl/double_fused_multiply_add.cpp
    frontend/maxwell/translate/impl/double_min_max.cpp
    frontend/maxwell/translate/impl/double_multiply.cpp
    frontend/maxwell/translate/impl/double_set_predicate.cpp
    frontend/maxwell/translate/impl/exit_program.cpp
    frontend/maxwell/translate/impl/find_leading_one.cpp
    frontend/maxwell/translate/impl/floating_point_add.cpp
    frontend/maxwell/translate/impl/floating_point_compare.cpp
    frontend/maxwell/translate/impl/floating_point_compare_and_set.cpp
    frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp
    frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp
    frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp
    frontend/maxwell/translate/impl/floating_point_min_max.cpp
    frontend/maxwell/translate/impl/floating_point_multi_function.cpp
    frontend/maxwell/translate/impl/floating_point_multiply.cpp
    frontend/maxwell/translate/impl/floating_point_range_reduction.cpp
    frontend/maxwell/translate/impl/floating_point_set_predicate.cpp
    frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp
    frontend/maxwell/translate/impl/half_floating_point_add.cpp
    frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp
    frontend/maxwell/translate/impl/half_floating_point_helper.cpp
    frontend/maxwell/translate/impl/half_floating_point_helper.h
    frontend/maxwell/translate/impl/half_floating_point_multiply.cpp
    frontend/maxwell/translate/impl/half_floating_point_set.cpp
    frontend/maxwell/translate/impl/half_floating_point_set_predicate.cpp
    frontend/maxwell/translate/impl/impl.cpp
    frontend/maxwell/translate/impl/impl.h
    frontend/maxwell/translate/impl/integer_add.cpp
    frontend/maxwell/translate/impl/integer_add_three_input.cpp
    frontend/maxwell/translate/impl/integer_compare.cpp
    frontend/maxwell/translate/impl/integer_compare_and_set.cpp
    frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp
    frontend/maxwell/translate/impl/integer_funnel_shift.cpp
    frontend/maxwell/translate/impl/integer_minimum_maximum.cpp
    frontend/maxwell/translate/impl/integer_popcount.cpp
    frontend/maxwell/translate/impl/integer_scaled_add.cpp
    frontend/maxwell/translate/impl/integer_set_predicate.cpp
    frontend/maxwell/translate/impl/integer_shift_left.cpp
    frontend/maxwell/translate/impl/integer_shift_right.cpp
    frontend/maxwell/translate/impl/integer_short_multiply_add.cpp
    frontend/maxwell/translate/impl/integer_to_integer_conversion.cpp
    frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp
    frontend/maxwell/translate/impl/load_constant.cpp
    frontend/maxwell/translate/impl/load_constant.h
    frontend/maxwell/translate/impl/load_effective_address.cpp
    frontend/maxwell/translate/impl/load_store_attribute.cpp
    frontend/maxwell/translate/impl/load_store_local_shared.cpp
    frontend/maxwell/translate/impl/load_store_memory.cpp
    frontend/maxwell/translate/impl/logic_operation.cpp
    frontend/maxwell/translate/impl/logic_operation_three_input.cpp
    frontend/maxwell/translate/impl/move_predicate_to_register.cpp
    frontend/maxwell/translate/impl/move_register.cpp
    frontend/maxwell/translate/impl/move_register_to_predicate.cpp
    frontend/maxwell/translate/impl/move_special_register.cpp
    frontend/maxwell/translate/impl/not_implemented.cpp
    frontend/maxwell/translate/impl/output_geometry.cpp
    frontend/maxwell/translate/impl/pixel_load.cpp
    frontend/maxwell/translate/impl/predicate_set_predicate.cpp
    frontend/maxwell/translate/impl/predicate_set_register.cpp
    frontend/maxwell/translate/impl/select_source_with_predicate.cpp
    frontend/maxwell/translate/impl/surface_atomic_operations.cpp
    frontend/maxwell/translate/impl/surface_load_store.cpp
    frontend/maxwell/translate/impl/texture_fetch.cpp
    frontend/maxwell/translate/impl/texture_fetch_swizzled.cpp
    frontend/maxwell/translate/impl/texture_gather.cpp
    frontend/maxwell/translate/impl/texture_gather_swizzled.cpp
    frontend/maxwell/translate/impl/texture_gradient.cpp
    frontend/maxwell/translate/impl/texture_load.cpp
    frontend/maxwell/translate/impl/texture_load_swizzled.cpp
    frontend/maxwell/translate/impl/texture_mipmap_level.cpp
    frontend/maxwell/translate/impl/texture_query.cpp
    frontend/maxwell/translate/impl/video_helper.cpp
    frontend/maxwell/translate/impl/video_helper.h
    frontend/maxwell/translate/impl/video_minimum_maximum.cpp
    frontend/maxwell/translate/impl/video_multiply_add.cpp
    frontend/maxwell/translate/impl/video_set_predicate.cpp
    frontend/maxwell/translate/impl/vote.cpp
    frontend/maxwell/translate/impl/warp_shuffle.cpp
    frontend/maxwell/translate/translate.cpp
    frontend/maxwell/translate/translate.h
    ir_opt/collect_shader_info_pass.cpp
    ir_opt/constant_propagation_pass.cpp
    ir_opt/dead_code_elimination_pass.cpp
    ir_opt/dual_vertex_pass.cpp
    ir_opt/global_memory_to_storage_buffer_pass.cpp
    ir_opt/identity_removal_pass.cpp
    ir_opt/lower_fp16_to_fp32.cpp
    ir_opt/passes.h
    ir_opt/ssa_rewrite_pass.cpp
    ir_opt/texture_pass.cpp
    ir_opt/verification_pass.cpp
    object_pool.h
    profile.h
    program_header.h
    shader_info.h
)

target_link_libraries(shader_recompiler PUBLIC common fmt::fmt sirit)

if (MSVC)
    target_compile_options(shader_recompiler PRIVATE
        /W4
        /WX
        /we4018 # 'expression' : signed/unsigned mismatch
        /we4244 # 'argument' : conversion from 'type1' to 'type2', possible loss of data (floating-point)
        /we4245 # 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
        /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
        /we4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data
        /we4305 # 'context' : truncation from 'type1' to 'type2'
        /we4800 # Implicit conversion from 'type' to bool. Possible information loss
        /we4826 # Conversion from 'type1' to 'type2' is sign-extended. This may cause unexpected runtime behavior.
    )
else()
    target_compile_options(shader_recompiler PRIVATE
        -Werror
        -Werror=conversion
        -Werror=ignored-qualifiers
        -Werror=implicit-fallthrough
        -Werror=shadow
        -Werror=sign-compare
        $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
        $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>
        -Werror=unused-variable

        # Bracket depth determines maximum size of a fold expression in Clang since 9c9974c3ccb6.
        # And this in turns limits the size of a std::array.
        $<$<CXX_COMPILER_ID:Clang>:-fbracket-depth=1024>
    )
endif()

create_target_directory_groups(shader_recompiler)