agx: Model interpolation for iter instructions

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
This commit is contained in:
Alyssa Rosenzweig
2023-05-25 13:22:51 -04:00
committed by Marge Bot
parent 2548293e8b
commit b7f130fbbc
5 changed files with 42 additions and 7 deletions

View File

@@ -153,6 +153,14 @@ ATOMIC_OPC = enum("atomic_opc", {
10: 'xor',
})
INTERPOLATION = enum("interpolation", {
0: 'center',
1: 'sample',
2: 'centroid',
# We translate sample -> sample_register at pack time for simplicity
3: 'sample_register',
})
FUNOP = lambda x: (x << 28)
FUNOP_MASK = FUNOP((1 << 14) - 1)
@@ -327,8 +335,14 @@ for is_float in [False, True]:
op("bitop", (0x7E, 0x7F, 6, _), srcs = 2, imms = [TRUTH_TABLE])
op("convert", (0x3E | L, 0x7F | L | (0x3 << 38), 6, _), srcs = 2, imms = [ROUND])
op("iter", (0x21, 0xBF, 8, _), srcs = 1, imms = [CHANNELS])
op("iterproj", (0x21, 0xBF, 8, _), srcs = 2, imms = [CHANNELS])
# Sources are the coeffient register and the sample index (if applicable)
op("iter", (0x21, 0xBF, 8, _), srcs = 2, imms = [CHANNELS, INTERPOLATION])
# Sources are the coeffient register for the varying, the coefficient register
# for W, and the sample index (if applicable)
op("iterproj", (0x21, 0xBF, 8, _), srcs = 3, imms = [CHANNELS, INTERPOLATION])
op("ldcf", (0xA1, 0xBF, 8, _), srcs = 1, imms = [CHANNELS])
op("st_vary", None, dests = 0, srcs = 2, can_eliminate = False)
op("no_varyings", (0x80000051, 0xFFFFFFFF, 4, _), dests = 0, can_eliminate = False)