ChanServ changed the topic of #asahi-gpu to: Asahi Linux GPU development (no user support, NO binary reversing) | Keep things on topic | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-gpu
<alyssa> yeah ok I think this is reasonable
<alyssa> for GL
<alyssa> annoying for Direct3D
<alyssa> why am I getting page faults with custom border colours.
<alyssa> Hm
<alyssa> ooookay
<alyssa> the "USC bind sampler" command binds either compact (no border colour) or extended (with border colour) samplers
<alyssa> unclear what determines which
<alyssa> "Sampler state register count" goes 32 -> 24 with border colour on 1 of 2 samplers ?!
<alyssa> and 4->24 in another case, uh
<alyssa> oh hmhmhm
<alyssa> the relevant count goes from 4->24 when going from 2 compact samplers to effectively 2 extended ones
<alyssa> still ss0/ss1 in the shader
<alyssa> the sampler descriptor is either 8 bytes or 24 bytes depending if there are border colours or not
<alyssa> so if it's a "total bytes" thing we're missing a factor of 2 (12 instead of 24)
<alyssa> i'm definitely missing something.
<alyssa> a bit in the USC sampler state packet would be the logical place.
<alyssa> but I don't see one
<alyssa> maybe sampler state reg count is actually an enum or something
possiblemeatball has joined #asahi-gpu
<alyssa> VS, no samplers, compact: (256, 32)
<alyssa> (!)
<alyssa> FS, 2 samplers, compact: (8, 4)
<alyssa> FS, 4 samplers, compact: (8, 4)
<alyssa> FS, 5 samplers, compact: (8, 8)
<alyssa> FS, 5 samplers, extended: (8, 24)
<alyssa> VS, no samplers, extended: (256, 24)
<alyssa> FS, 8 samplers, extended: (8, 24)
<alyssa> not sure I can get anything other than 24 for extended
<alyssa> next question is what metal does with 24 samplers (-:
<alyssa> metal only gives me 16 samplers, boo
<alyssa> FS, 16 samplers, extended: 28
<alyssa> this does lend credence to the enum theory
<alyssa> 9 samplers is indeed the cutoff
<alyssa> although seemingly Metal is not actually doing custom border colours so I am I guess missing some other magic
digicyc has quit [Remote host closed the connection]
digicyc has joined #asahi-gpu
possiblemeatball has quit [Quit: Leaving]
cylm_ has joined #asahi-gpu
<dottedmag> alyssa: Is "border colour 3" the same as ZX Spectrum's "BORDER 3" that draws a nice thick magenta border around the actually drawable area? :)
<marcan> no, that's bg_color in the DCP swap if you then reduce the plane size along with it :p
SSJ_GZ has joined #asahi-gpu
os has quit [Quit: The Lounge - https://thelounge.chat]
os has joined #asahi-gpu
Method_ has quit [Quit: ZNC 1.8.2+deb1+bionic2 - https://znc.in]
Method has joined #asahi-gpu
r0ni has quit [Quit: Textual IRC Client: www.textualapp.com]
bcrumb has joined #asahi-gpu
bcrumb has quit []
compassion has quit [Ping timeout: 480 seconds]
hightower3 has joined #asahi-gpu
amarioguy has joined #asahi-gpu
SSJ_GZ has quit [Remote host closed the connection]
SSJ_GZ has joined #asahi-gpu
hightower4 has joined #asahi-gpu
tertu2 has quit [Quit: so long...]
hightower2 has quit [Ping timeout: 480 seconds]
tertu has joined #asahi-gpu
hightower3 has quit [Ping timeout: 480 seconds]
Coastalcrown has joined #asahi-gpu
possiblemeatball has joined #asahi-gpu
<alyssa> as for border colour encoding
<alyssa> colour is (0.5, 0.25, 0.125, 0.2) in all
<alyssa> RGBA8: (0x7f, 0x3f, 0x1f, 0x33)
<alyssa> sRGB8_A8: (0x7ff, 0x3ff, 0x1ff, 0x33)
<alyssa> sRGB8: "
<alyssa> RGB5A1: (6, 3, 7, 0)
<alyssa> this one I understand considerably less
<alyssa> Oh the intenral channels is A1R5G5B5
<alyssa> with an extra BGR snuck in the swizzle somewhere
<alyssa> so ABGR
<alyssa> no that still doesn't track
<alyssa> second border colour will be (1.0, 1.0, 1.0, 1.0)
<alyssa> no that hits the opaque white case
<alyssa> (1.0, 0.0, 1.0, 1.0) then
<alyssa> (0x1f, 0x1f, 0x0, 0x1)
<alyssa> let's also do one that's (0.0, 1.0, 1.0, 1.0):
<alyssa> (1f, 1f, 1f, 0)
<alyssa> oh duh because GL is backwards and this is actually A1BGR5 this whole time right yes ok
<alyssa> moving on, RGBA4
<alyssa> (3, 1, 3, 7) and (f, f, f, 0)
<alyssa> r11g11b10: (0x3800, 0x3400, 0x3000, 0x3266) and (0x0, 0x3c00, 0x3c00, 0x3c00)
<alyssa> so just straight up half floats
<alyssa> i am apparently unable to use GL to check rgb9e5
hightower3 has joined #asahi-gpu
hightower4 has quit [Ping timeout: 480 seconds]
hightower3 has quit [Ping timeout: 480 seconds]
hightower2 has joined #asahi-gpu
Coastalcrown has quit [Remote host closed the connection]
Coastalcrown has joined #asahi-gpu
MajorBiscuit has joined #asahi-gpu
Coastalcrown has quit [Remote host closed the connection]
Coastalcrown has joined #asahi-gpu
hampus has joined #asahi-gpu
amarioguy has quit [Remote host closed the connection]
hampus has quit []
Coastalcrown has quit [Remote host closed the connection]
Coastalcrown has joined #asahi-gpu
Coastalcrown has quit [Remote host closed the connection]
Coastalcrown has joined #asahi-gpu
giffel has joined #asahi-gpu
giffel has quit [Quit: Lost terminal]
bcrumb has joined #asahi-gpu
MajorBiscuit has quit [Ping timeout: 480 seconds]
bcrumb has quit [Quit: WeeChat 3.7.1]
bcrumb has joined #asahi-gpu
bcrumb has quit [Quit: WeeChat 3.7.1]
cylm_ has quit [Ping timeout: 480 seconds]
cylm_ has joined #asahi-gpu
chengsun has joined #asahi-gpu
<alyssa> aaaaand that's probably a bug in the apple driver....
VinDuv has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
chengsun- has joined #asahi-gpu
VinDuv has joined #asahi-gpu
<alyssa> (incorrect rounding of border colours)
chengsun_ has quit [Ping timeout: 480 seconds]
chengsun has quit [Ping timeout: 480 seconds]
chengsun has joined #asahi-gpu
chengsun- has quit [Ping timeout: 480 seconds]
<TellowKrinkle> If 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
<alyssa> TellowKrinkle: no custom border colours in metal
<alyssa> well, public Metal
<TellowKrinkle> Ahh okay
<alyssa> private Metal has custom border colours, presumably for the sole use of the GL driver
<alyssa> which doesn't do separate textures/samplers
bcrumb has joined #asahi-gpu
Coastalcrown has quit [Remote host closed the connection]
MajorBiscuit has joined #asahi-gpu
Coastalcrown has joined #asahi-gpu
mkurz has joined #asahi-gpu
DragoonAethis has quit [Quit: hej-hej!]
DragoonAethis has joined #asahi-gpu
amarioguy has joined #asahi-gpu
SSJ_GZ has quit [Remote host closed the connection]
SSJ_GZ has joined #asahi-gpu
<alyssa> ok, more data..
<alyssa> luminance (channels=R8, type=Unorm, swizzle=RRR1): (0x7f, 0x3f, 0x1f, 0x33), (0x0, 0xff, 0xff, 0xff)
<alyssa> it doesn't like my GL_TEXTURE_SWIZZLE..
hertz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bluetail has quit [Quit: The Lounge - https://thelounge.chat]
bluetail has joined #asahi-gpu
Major_Biscuit has joined #asahi-gpu
MajorBiscuit has quit [Ping timeout: 480 seconds]
<alyssa> bgra (channels=RGBA8, type=Unorm, swizzle=BGRA): (0x1f, 0x3f, 0x7f, 0x33)
<alyssa> so it is swapping for that... um.
bcrumb has quit [Quit: WeeChat 3.7.1]
<alyssa> and (ff, ff, 0, ff) for the other one
Major_Biscuit has quit [Ping timeout: 480 seconds]
<alyssa> i'm finding this all very arbitrary
<alyssa> luminance-alpha (r8g8, unorm, RRRG): (7f, 33), (0, ff, 0, 0)
Major_Biscuit has joined #asahi-gpu
<alyssa> alpha (r8, 000r): (33, 0, 0, 0), (ff, 0, 0, 0)
Coastalcrown has quit [Ping timeout: 480 seconds]
Coastalcrown has joined #asahi-gpu
<alyssa> rgb9e5 (rgb1): (3800, 3400, 3000, 3266), (0, 3c00, 3c00, 3c00)
<alyssa> so that just becomes fp16 like I suspected
<alyssa> API swizzle(border colour) = (API swizzle o format swizzle)(format swizzle^-1(border colour))
<alyssa> = (API swizzle o (format swizzle o format swizzle^-1))(border colour)
<alyssa> so we need a right-inverse of the format swizzlw
<alyssa> which exists iff the format swizzle is surjective
<alyssa> the problem cases being,e.g. accessing alpha for RGB formats where the border's alpha != 1
<alyssa> and luma-intensity
<alyssa> for rgb, it's using an rgb1 swizzle but computing the border colour as if it were rgba
<alyssa> unclear how that can work
hertz has joined #asahi-gpu
Coastalcrown has quit [Read error: Connection timed out]
Coastalcrown has joined #asahi-gpu
possiblemeatball has quit [Quit: Leaving]
<alyssa> unless...... maybe the API swizzle has to be applied in the forward direction to the border swizzle
<alyssa> oh something
<alyssa> or
<alyssa> no that doesn't match the data
cylm_ has quit [Quit: WeeChat 3.6]
Major_Biscuit has quit [Ping timeout: 480 seconds]
Major_Biscuit has joined #asahi-gpu
SSJ_GZ has quit [Ping timeout: 480 seconds]
Major_Biscuit has quit [Ping timeout: 480 seconds]
Coastalcrown has quit [Ping timeout: 480 seconds]
Coastalcrown has joined #asahi-gpu
Coastalcrown has quit [Ping timeout: 480 seconds]
Coastalcrown has joined #asahi-gpu