-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
174 lines (162 loc) · 4.76 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.16)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
project(nxgpucatch C CXX ASM)
set(CMAKE_C_STANDARD 20)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fexceptions -DSA_ONSTACK=0")
add_subdirectory(externals)
add_executable(nxgpucatch
src/alignment.h
src/bit_cast.h
src/cmd_util.h
src/compare.h
src/descriptor_set.h
src/device.cpp
src/device.h
src/eval_util.h
src/formats.h
src/fp16_run.h
src/heap.h
src/main.cpp
src/resource.cpp
src/resource.h
src/shader.cpp
src/shader.h
src/tests/buffer.cpp
src/tests/clear.cpp
src/tests/draw/depth_range.cpp
src/tests/draw/frag_coord.cpp
src/tests/draw/simple_draw.cpp
src/tests/draw/varying_undefined.cpp
src/tests/indirect_compute.cpp
src/tests/render_formats.cpp
src/tests/render_linear_aliased.cpp
src/tests/shader/atom.cpp
src/tests/shader/atoms.cpp
src/tests/shader/bfe.cpp
src/tests/shader/bfi.cpp
src/tests/shader/cal.cpp
src/tests/shader/cset.cpp
src/tests/shader/csetp.cpp
src/tests/shader/dadd.cpp
src/tests/shader/dfma.cpp
src/tests/shader/dmnmx.cpp
src/tests/shader/dmul.cpp
src/tests/shader/dset.cpp
src/tests/shader/dsetp.cpp
src/tests/shader/f2f.cpp
src/tests/shader/f2i.cpp
src/tests/shader/fadd.cpp
src/tests/shader/fcmp.cpp
src/tests/shader/ffma.cpp
src/tests/shader/flo.cpp
src/tests/shader/flow.cpp
src/tests/shader/fmnmx.cpp
src/tests/shader/fmul.cpp
src/tests/shader/fset.cpp
src/tests/shader/fsetp.cpp
src/tests/shader/hadd2.cpp
src/tests/shader/hfma2.cpp
src/tests/shader/hmul2.cpp
src/tests/shader/hset2.cpp
src/tests/shader/hsetp2.cpp
src/tests/shader/i2f.cpp
src/tests/shader/i2i.cpp
src/tests/shader/iadd.cpp
src/tests/shader/iadd3.cpp
src/tests/shader/icmp.cpp
src/tests/shader/imnmx.cpp
src/tests/shader/iscadd.cpp
src/tests/shader/iset.cpp
src/tests/shader/isetp.cpp
src/tests/shader/ldc.cpp
src/tests/shader/ldg.cpp
src/tests/shader/lea.cpp
src/tests/shader/lop.cpp
src/tests/shader/lop3.cpp
src/tests/shader/mov.cpp
src/tests/shader/mufu.cpp
src/tests/shader/p2r.cpp
src/tests/shader/popc.cpp
src/tests/shader/pset.cpp
src/tests/shader/psetp.cpp
src/tests/shader/r2p.cpp
src/tests/shader/red.cpp
src/tests/shader/sel.cpp
src/tests/shader/shf.cpp
src/tests/shader/shfl.cpp
src/tests/shader/shl.cpp
src/tests/shader/shr.cpp
src/tests/shader/stg.cpp
src/tests/shader/stls.cpp
src/tests/shader/suldst.cpp
src/tests/shader/tex.cpp
src/tests/shader/texs.cpp
src/tests/shader/tld.cpp
src/tests/shader/tld4.cpp
src/tests/shader/tld4s.cpp
src/tests/shader/tlds.cpp
src/tests/shader/txq.cpp
src/tests/shader/vmad.cpp
src/tests/shader/vmnmx.cpp
src/tests/shader/vote.cpp
src/tests/shader/vsetp.cpp
src/tests/shader/xmad.cpp
src/tests/texture_buffer.cpp
src/wait_input.cpp
src/wait_input.h
)
nx_add_shader_program(flat_frag_coord_32_frag src/tests/draw/flat_frag_coord_32.frag frag)
nx_add_shader_program(full_screen_triangle_vanilla_vert src/tests/draw/full_screen_triangle_vanilla.vert vert)
nx_add_shader_program(full_screen_triangle_depth_vert src/tests/draw/full_screen_triangle_depth.vert vert)
nx_add_shader_program(full_screen_triangle_vert src/tests/draw/full_screen_triangle.vert vert)
nx_add_shader_program(varying_color_frag src/tests/draw/varying_color.frag frag)
nx_add_shader_program(white_frag src/tests/draw/white.frag frag)
nx_add_shader_program(write_uniform_vert src/tests/write_uniform.vert vert)
dkp_add_asset_target(nxgpucatch_romfs romfs)
dkp_install_assets(nxgpucatch_romfs
DESTINATION shaders
TARGETS
flat_frag_coord_32_frag
full_screen_triangle_vanilla_vert
full_screen_triangle_depth_vert
full_screen_triangle_vert
varying_color_frag
white_frag
write_uniform_vert
)
target_link_libraries(nxgpucatch Catch2::Catch2 nxas_lib deko3d)
target_include_directories(nxgpucatch PRIVATE src externals/incbin)
target_compile_options(nxgpucatch PRIVATE
-std=c++20
-Wall
-Wextra
-Werror
-Werror=shadow
-pedantic
)
target_precompile_headers(nxgpucatch PRIVATE
<catch2/catch_test_macros.hpp>
<deko3d.hpp>
<array>
<algorithm>
<type_traits>
<cstdint>
<cstddef>
<cstring>
<optional>
<vector>
<stdexcept>
)
nx_generate_nacp(nxgpucatch.nacp
NAME "nxgpucatch"
AUTHOR "yuzu Team"
)
nx_create_nro(nxgpucatch
NACP nxgpucatch.nacp
ROMFS nxgpucatch_romfs
)
find_program(nxlink_exe nxlink PATHS ${DEVKITPRO}/tools/bin REQUIRED)
add_custom_target(nxlink
COMMAND ${nxlink_exe} $<TARGET_FILE:nxgpucatch>.nro
DEPENDS nxgpucatch
)