#
…

2023-01-05

00:00alyssayeah ok I think this is reasonable
00:00alyssaannoying for Direct3D
00:34alyssawhy am I getting page faults with custom border colours.
01:37alyssathe "USC bind sampler" command binds either compact (no border colour) or extended (with border colour) samplers
01:37alyssaunclear what determines which
01:38alyssa"Sampler state register count" goes 32 -> 24 with border colour on 1 of 2 samplers ?!
01:39alyssaand 4->24 in another case, uh
01:41alyssaoh hmhmhm
01:42alyssathe relevant count goes from 4->24 when going from 2 compact samplers to effectively 2 extended ones
01:43alyssastill ss0/ss1 in the shader
01:45alyssathe sampler descriptor is either 8 bytes or 24 bytes depending if there are border colours or not
01:45alyssaso if it's a "total bytes" thing we're missing a factor of 2 (12 instead of 24)
01:49alyssai'm definitely missing something.
02:02alyssaa bit in the USC sampler state packet would be the logical place.
02:05alyssabut I don't see one
02:08alyssamaybe sampler state reg count is actually an enum or something
02:09possiblemeatball has joined #asahi-gpu
02:20alyssaVS, no samplers, compact: (256, 32)
02:21alyssaFS, 2 samplers, compact: (8, 4)
02:22alyssaFS, 4 samplers, compact: (8, 4)
02:23alyssaFS, 5 samplers, compact: (8, 8)
02:24alyssaFS, 5 samplers, extended: (8, 24)
02:25alyssaVS, no samplers, extended: (256, 24)
02:26alyssaFS, 8 samplers, extended: (8, 24)
02:32alyssanot sure I can get anything other than 24 for extended
02:32alyssanext question is what metal does with 24 samplers (-:
02:40alyssametal only gives me 16 samplers, boo
02:42alyssaFS, 16 samplers, extended: 28
02:43alyssathis does lend credence to the enum theory
02:44alyssa9 samplers is indeed the cutoff
02:44alyssaalthough seemingly Metal is not actually doing custom border colours so I am I guess missing some other magic
03:14digicyc has quit [Remote host closed the connection]
03:14digicyc has joined #asahi-gpu
05:34possiblemeatball has quit [Quit: Leaving]
06:27cylm_ has joined #asahi-gpu
06:48dottedmagalyssa: Is "border colour 3" the same as ZX Spectrum's "BORDER 3" that draws a nice thick magenta border around the actually drawable area? :)
06:55marcanno, that's bg_color in the DCP swap if you then reduce the plane size along with it :p
07:28SSJ_GZ has joined #asahi-gpu
08:52os has quit [Quit: The Lounge - https://thelounge.chat]
08:54os has joined #asahi-gpu
09:50Method_ has quit [Quit: ZNC 1.8.2+deb1+bionic2 - https://znc.in]
09:52Method has joined #asahi-gpu
10:06r0ni has quit [Quit: Textual IRC Client: www.textualapp.com]
11:24bcrumb has joined #asahi-gpu
11:25bcrumb has quit []
11:37compassion has quit [Ping timeout: 480 seconds]
12:51hightower3 has joined #asahi-gpu
12:52amarioguy has joined #asahi-gpu
12:53SSJ_GZ has quit [Remote host closed the connection]
12:53SSJ_GZ has joined #asahi-gpu
12:55hightower4 has joined #asahi-gpu
12:56tertu2 has quit [Quit: so long...]
12:58hightower2 has quit [Ping timeout: 480 seconds]
12:59tertu has joined #asahi-gpu
13:02hightower3 has quit [Ping timeout: 480 seconds]
13:03Coastalcrown has joined #asahi-gpu
13:40possiblemeatball has joined #asahi-gpu
13:44alyssaas for border colour encoding
13:45alyssacolour is (0.5, 0.25, 0.125, 0.2) in all
13:48alyssaRGBA8: (0x7f, 0x3f, 0x1f, 0x33)
13:49alyssasRGB8_A8: (0x7ff, 0x3ff, 0x1ff, 0x33)
13:50alyssasRGB8: "
13:51alyssaRGB5A1: (6, 3, 7, 0)
13:52alyssathis one I understand considerably less
13:52alyssaOh the intenral channels is A1R5G5B5
13:53alyssawith an extra BGR snuck in the swizzle somewhere
13:54alyssano that still doesn't track
13:54alyssasecond border colour will be (1.0, 1.0, 1.0, 1.0)
13:55alyssano that hits the opaque white case
13:55alyssa(1.0, 0.0, 1.0, 1.0) then
13:55alyssa(0x1f, 0x1f, 0x0, 0x1)
13:56alyssalet's also do one that's (0.0, 1.0, 1.0, 1.0):
13:56alyssa(1f, 1f, 1f, 0)
13:57alyssaoh duh because GL is backwards and this is actually A1BGR5 this whole time right yes ok
13:58alyssamoving on, RGBA4
13:58alyssa(3, 1, 3, 7) and (f, f, f, 0)
14:01alyssar11g11b10: (0x3800, 0x3400, 0x3000, 0x3266) and (0x0, 0x3c00, 0x3c00, 0x3c00)
14:01alyssaso just straight up half floats
14:06alyssai am apparently unable to use GL to check rgb9e5
14:18hightower3 has joined #asahi-gpu
14:25hightower4 has quit [Ping timeout: 480 seconds]
14:28hightower3 has quit [Ping timeout: 480 seconds]
14:56hightower2 has joined #asahi-gpu
15:07Coastalcrown has quit [Remote host closed the connection]
15:08Coastalcrown has joined #asahi-gpu
15:13MajorBiscuit has joined #asahi-gpu
15:31Coastalcrown has quit [Remote host closed the connection]
15:31Coastalcrown has joined #asahi-gpu
15:49hampus has joined #asahi-gpu
15:50amarioguy has quit [Remote host closed the connection]
15:53hampus has quit []
16:14Coastalcrown has quit [Remote host closed the connection]
16:16Coastalcrown has joined #asahi-gpu
16:17Coastalcrown has quit [Remote host closed the connection]
16:17Coastalcrown has joined #asahi-gpu
16:23giffel has joined #asahi-gpu
16:38giffel has quit [Quit: Lost terminal]
17:36bcrumb has joined #asahi-gpu
18:18MajorBiscuit has quit [Ping timeout: 480 seconds]
18:20bcrumb has quit [Quit: WeeChat 3.7.1]
18:30bcrumb has joined #asahi-gpu
18:37bcrumb has quit [Quit: WeeChat 3.7.1]
18:44cylm_ has quit [Ping timeout: 480 seconds]
18:49cylm_ has joined #asahi-gpu
19:26chengsun has joined #asahi-gpu
19:27alyssa aaaaand that's probably a bug in the apple driver....
19:28VinDuv has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
19:28chengsun- has joined #asahi-gpu
19:28VinDuv has joined #asahi-gpu
19:32alyssa(incorrect rounding of border colours)
19:33chengsun_ has quit [Ping timeout: 480 seconds]
19:34chengsun has quit [Ping timeout: 480 seconds]
19:36chengsun has joined #asahi-gpu
19:40chengsun- has quit [Ping timeout: 480 seconds]
19:41TellowKrinkleIf border color depends on the texture format, does that mean it's not part of the sampler? Since those are separate from textures in Metal
19:41alyssaTellowKrinkle: no custom border colours in metal
19:42alyssawell, public Metal
19:42alyssaprivate Metal has custom border colours, presumably for the sole use of the GL driver
19:42alyssawhich doesn't do separate textures/samplers
19:49bcrumb has joined #asahi-gpu
19:50Coastalcrown has quit [Remote host closed the connection]
19:51MajorBiscuit has joined #asahi-gpu
19:52Coastalcrown has joined #asahi-gpu
20:00mkurz has joined #asahi-gpu
20:06DragoonAethis has quit [Quit: hej-hej!]
20:06DragoonAethis has joined #asahi-gpu
20:08amarioguy has joined #asahi-gpu
20:12SSJ_GZ has quit [Remote host closed the connection]
20:13SSJ_GZ has joined #asahi-gpu
20:31alyssaok, more data..
20:32alyssaluminance (channels=R8, type=Unorm, swizzle=RRR1): (0x7f, 0x3f, 0x1f, 0x33), (0x0, 0xff, 0xff, 0xff)
20:39alyssait doesn't like my GL_TEXTURE_SWIZZLE..
20:45hertz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:49bluetail has quit [Quit: The Lounge - https://thelounge.chat]
20:50bluetail has joined #asahi-gpu
20:57Major_Biscuit has joined #asahi-gpu
20:59MajorBiscuit has quit [Ping timeout: 480 seconds]
21:07alyssabgra (channels=RGBA8, type=Unorm, swizzle=BGRA): (0x1f, 0x3f, 0x7f, 0x33)
21:07alyssaso it is swapping for that... um.
21:08bcrumb has quit [Quit: WeeChat 3.7.1]
21:15alyssaand (ff, ff, 0, ff) for the other one
21:15Major_Biscuit has quit [Ping timeout: 480 seconds]
21:15alyssai'm finding this all very arbitrary
21:17alyssaluminance-alpha (r8g8, unorm, RRRG): (7f, 33), (0, ff, 0, 0)
21:18Major_Biscuit has joined #asahi-gpu
21:19alyssa alpha (r8, 000r): (33, 0, 0, 0), (ff, 0, 0, 0)
21:20Coastalcrown has quit [Ping timeout: 480 seconds]
21:23Coastalcrown has joined #asahi-gpu
21:24alyssargb9e5 (rgb1): (3800, 3400, 3000, 3266), (0, 3c00, 3c00, 3c00)
21:25alyssaso that just becomes fp16 like I suspected
21:27alyssaAPI swizzle(border colour) = (API swizzle o format swizzle)(format swizzle^-1(border colour))
21:27alyssa= (API swizzle o (format swizzle o format swizzle^-1))(border colour)
21:27alyssaso we need a right-inverse of the format swizzlw
21:28alyssawhich exists iff the format swizzle is surjective
21:29alyssathe problem cases being,e.g. accessing alpha for RGB formats where the border's alpha != 1
21:30alyssaand luma-intensity
21:32alyssafor rgb, it's using an rgb1 swizzle but computing the border colour as if it were rgba
21:32alyssaunclear how that can work
21:36hertz has joined #asahi-gpu
21:40Coastalcrown has quit [Read error: Connection timed out]
21:41Coastalcrown has joined #asahi-gpu
21:49possiblemeatball has quit [Quit: Leaving]
21:49alyssaunless...... maybe the API swizzle has to be applied in the forward direction to the border swizzle
21:49alyssaoh something
21:50alyssano that doesn't match the data
22:04cylm_ has quit [Quit: WeeChat 3.6]
22:31Major_Biscuit has quit [Ping timeout: 480 seconds]
22:39Major_Biscuit has joined #asahi-gpu
22:44SSJ_GZ has quit [Ping timeout: 480 seconds]
23:02Major_Biscuit has quit [Ping timeout: 480 seconds]
23:14Coastalcrown has quit [Ping timeout: 480 seconds]
23:17Coastalcrown has joined #asahi-gpu
23:54Coastalcrown has quit [Ping timeout: 480 seconds]
23:58Coastalcrown has joined #asahi-gpu
…