108
108
NEST = immediate("nest")
109
109
TARGET = immediate("target", "agx_block *")
110
110
ZS = immediate("zs")
111
PERSPECTIVE = immediate("perspective", "bool")
112
111
SR = enum("sr", {
113
112
0: 'threadgroup_position_in_grid.x',
114
113
1: 'threadgroup_position_in_grid.y',
119
118
8: 'dispatch_threads_per_threadgroup.x',
120
119
9: 'dispatch_threads_per_threadgroup.y',
121
120
10: 'dispatch_threads_per_threadgroup.z',
122
123
48: 'thread_position_in_threadgroup.x',
123
124
49: 'thread_position_in_threadgroup.y',
124
125
50: 'thread_position_in_threadgroup.z',
132
133
80: 'thread_position_in_grid.x',
133
134
81: 'thread_position_in_grid.y',
134
135
82: 'thread_position_in_grid.z',
136
124: 'input_sample_mask',
138
146: 'opfifo_data_l',
139
147: 'opfifo_data_h',
137
142
ATOMIC_OPC = enum("atomic_opc", {
156
INTERPOLATION = enum("interpolation", {
160
# We translate sample -> sample_register at pack time for simplicity
161
3: 'sample_register',
151
164
FUNOP = lambda x: (x << 28)
152
165
FUNOP_MASK = FUNOP((1 << 14) - 1)
288
301
op("get_sr", (0x72, 0x7F | L, 4, _), dests = 1, imms = [SR])
290
op("sample_mask", (0x7fc1, 0xffff, 6, _), dests = 0, srcs = 1, can_eliminate = False)
303
op("sample_mask", (0x7fc1, 0xffff, 6, _), dests = 0, srcs = 2, can_eliminate = False)
292
305
# Sources: sample mask, combined depth/stencil
293
306
op("zs_emit", (0x41, 0xFF | L, 4, _), dests = 0, srcs = 2,
323
336
op("bitop", (0x7E, 0x7F, 6, _), srcs = 2, imms = [TRUTH_TABLE])
324
337
op("convert", (0x3E | L, 0x7F | L | (0x3 << 38), 6, _), srcs = 2, imms = [ROUND])
325
op("iter", (0x21, 0xBF, 8, _), srcs = 2, imms = [CHANNELS, PERSPECTIVE])
339
# Sources are the coeffient register and the sample index (if applicable)
340
op("iter", (0x21, 0xBF, 8, _), srcs = 2, imms = [CHANNELS, INTERPOLATION])
342
# Sources are the coeffient register for the varying, the coefficient register
343
# for W, and the sample index (if applicable)
344
op("iterproj", (0x21, 0xBF, 8, _), srcs = 3, imms = [CHANNELS, INTERPOLATION])
326
346
op("ldcf", (0xA1, 0xBF, 8, _), srcs = 1, imms = [CHANNELS])
327
347
op("st_vary", None, dests = 0, srcs = 2, can_eliminate = False)
328
348
op("no_varyings", (0x80000051, 0xFFFFFFFF, 4, _), dests = 0, can_eliminate = False)