Skip to content

Commit 4f2f5f7

Browse files
authored
Update samplers and fix border color (llvm#3474)
2 parents 35c8b5f + 02efcb0 commit 4f2f5f7

File tree

1 file changed

+52
-21
lines changed
  • amd/device-libs/opencl/src/image

1 file changed

+52
-21
lines changed

amd/device-libs/opencl/src/image/isamp.cl

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,32 +66,61 @@ static __constant uint GFX9_samplers[] = {
6666
};
6767

6868
static __constant uint GFX10_samplers[] = {
69-
0x1000b1b6, 0x00fff000, 0x20000000, 0x40000000, // 0x10
70-
0x100031b6, 0x00fff000, 0x20000000, 0x40000000, // 0x11
71-
0x1000b092, 0x00fff000, 0x20000000, 0x40000000, // 0x12
72-
0x10003092, 0x00fff000, 0x20000000, 0x40000000, // 0x13
73-
0x1000b1b6, 0x00fff000, 0x20000000, 0x40000000, // 0x14
74-
0x100031b6, 0x00fff000, 0x20000000, 0x40000000, // 0x15
75-
0x1000b000, 0x00fff000, 0x20000000, 0x40000000, // 0x16
76-
0x10003000, 0x00fff000, 0x20000000, 0x40000000, // 0x17
77-
0x1000b049, 0x00fff000, 0x20000000, 0x40000000, // 0x18
78-
0x10003049, 0x00fff000, 0x20000000, 0x40000000, // 0x19
69+
0x1000b1b6, 0x00fff000, 0x20000000, 0x00000000, // 0x10
70+
0x100031b6, 0x00fff000, 0x20000000, 0x00000000, // 0x11
71+
0x1000b092, 0x00fff000, 0x20000000, 0x00000000, // 0x12
72+
0x10003092, 0x00fff000, 0x20000000, 0x00000000, // 0x13
73+
0x1000b1b6, 0x00fff000, 0x20000000, 0x00000000, // 0x14
74+
0x100031b6, 0x00fff000, 0x20000000, 0x00000000, // 0x15
75+
0x1000b000, 0x00fff000, 0x20000000, 0x00000000, // 0x16
76+
0x10003000, 0x00fff000, 0x20000000, 0x00000000, // 0x17
77+
0x1000b049, 0x00fff000, 0x20000000, 0x00000000, // 0x18
78+
0x10003049, 0x00fff000, 0x20000000, 0x00000000, // 0x19
7979
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1a
8080
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1b
8181
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1c
8282
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1d
8383
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1e
8484
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1f
85-
0x1000b1b6, 0x00fff000, 0x20500000, 0x40000000, // 0x20
86-
0x100031b6, 0x00fff000, 0x20500000, 0x40000000, // 0x21
87-
0x1000b092, 0x00fff000, 0x20500000, 0x40000000, // 0x22
88-
0x10003092, 0x00fff000, 0x20500000, 0x40000000, // 0x23
89-
0x1000b1b6, 0x00fff000, 0x20500000, 0x40000000, // 0x24
90-
0x100031b6, 0x00fff000, 0x20500000, 0x40000000, // 0x25
91-
0x1000b000, 0x00fff000, 0x20500000, 0x40000000, // 0x26
92-
0x10003000, 0x00fff000, 0x20500000, 0x40000000, // 0x27
93-
0x1000b049, 0x00fff000, 0x20500000, 0x40000000, // 0x28
94-
0x10003049, 0x00fff000, 0x20500000, 0x40000000, // 0x29
85+
0x1000b1b6, 0x00fff000, 0x20500000, 0x00000000, // 0x20
86+
0x100031b6, 0x00fff000, 0x20500000, 0x00000000, // 0x21
87+
0x1000b092, 0x00fff000, 0x20500000, 0x00000000, // 0x22
88+
0x10003092, 0x00fff000, 0x20500000, 0x00000000, // 0x23
89+
0x1000b1b6, 0x00fff000, 0x20500000, 0x00000000, // 0x24
90+
0x100031b6, 0x00fff000, 0x20500000, 0x00000000, // 0x25
91+
0x1000b000, 0x00fff000, 0x20500000, 0x00000000, // 0x26
92+
0x10003000, 0x00fff000, 0x20500000, 0x00000000, // 0x27
93+
0x1000b049, 0x00fff000, 0x20500000, 0x00000000, // 0x28
94+
0x10003049, 0x00fff000, 0x20500000, 0x00000000, // 0x29
95+
};
96+
97+
static __constant uint GFX12_samplers[] = {
98+
0x1000b1b6, 0x01ffe000, 0x20000000, 0x00000000, // 0x10
99+
0x100031b6, 0x01ffe000, 0x20000000, 0x00000000, // 0x11
100+
0x1000b092, 0x01ffe000, 0x20000000, 0x00000000, // 0x12
101+
0x10003092, 0x01ffe000, 0x20000000, 0x00000000, // 0x13
102+
0x1000b1b6, 0x01ffe000, 0x20000000, 0x00000000, // 0x14
103+
0x100031b6, 0x01ffe000, 0x20000000, 0x00000000, // 0x15
104+
0x1000b000, 0x01ffe000, 0x20000000, 0x00000000, // 0x16
105+
0x10003000, 0x01ffe000, 0x20000000, 0x00000000, // 0x17
106+
0x1000b049, 0x01ffe000, 0x20000000, 0x00000000, // 0x18
107+
0x10003049, 0x01ffe000, 0x20000000, 0x00000000, // 0x19
108+
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1a
109+
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1b
110+
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1c
111+
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1d
112+
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1e
113+
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0x1f
114+
0x1000b1b6, 0x01ffe000, 0x20500000, 0x00000000, // 0x20
115+
0x100031b6, 0x01ffe000, 0x20500000, 0x00000000, // 0x21
116+
0x1000b092, 0x01ffe000, 0x20500000, 0x00000000, // 0x22
117+
0x10003092, 0x01ffe000, 0x20500000, 0x00000000, // 0x23
118+
0x1000b1b6, 0x01ffe000, 0x20500000, 0x00000000, // 0x24
119+
0x100031b6, 0x01ffe000, 0x20500000, 0x00000000, // 0x25
120+
0x1000b000, 0x01ffe000, 0x20500000, 0x00000000, // 0x26
121+
0x10003000, 0x01ffe000, 0x20500000, 0x00000000, // 0x27
122+
0x1000b049, 0x01ffe000, 0x20500000, 0x00000000, // 0x28
123+
0x10003049, 0x01ffe000, 0x20500000, 0x00000000, // 0x29
95124
};
96125

97126
typedef struct { int x, y, z, w; } __sampler_t;
@@ -103,8 +132,10 @@ __translate_sampler_initializer(int i)
103132
return (__constant __sampler_t *)&SI_samplers[(i - 16) << 2];
104133
} else if (__oclc_ISA_version < 10000) {
105134
return (__constant __sampler_t *)&GFX9_samplers[(i - 16) << 2];
106-
} else {
135+
} else if (__oclc_ISA_version < 12000) {
107136
return (__constant __sampler_t *)&GFX10_samplers[(i - 16) << 2];
137+
} else {
138+
return (__constant __sampler_t *)&GFX12_samplers[(i - 16) << 2];
108139
}
109140
}
110141

0 commit comments

Comments
 (0)