ChanServ changed the topic of #panfrost to: Panfrost - FLOSS Mali Midgard & Bifrost - Logs https://oftc.irclog.whitequark.org/panfrost - <macc24> i have been here before it was popular
camus1 has joined #panfrost
camus has quit [Read error: Connection reset by peer]
alpernebbi has quit [Read error: Connection reset by peer]
<anarsoul>
alyssa: are you around?
alpernebbi has joined #panfrost
nakash has joined #panfrost
nakash has quit [Killed (NickServ (Too many failed password attempts.))]
nakash has joined #panfrost
nakash has quit [Remote host closed the connection]
nakash7 has joined #panfrost
<alyssa>
anarsoul: yes, what's up?
<anarsoul>
alyssa: can I PM you?
<alyssa>
anarsoul: what's up?
<anarsoul>
well, I was wondering how exactly instancing is implemented in midgard hw. I see that panfrost allocates special atttributes for VertexID and InstanceID
<alyssa>
oh boy..
<alyssa>
Instancing on Mali is a.. special question
<alyssa>
Do you have a specific question or want the high level?
<anarsoul>
high level should be OK
<alyssa>
There are two pieces of hardware that implement instancing
<alyssa>
1. Multidimensional vertex shaders. Recall compute shaders can have arbitrary 3D sizes, while in GLES2 vertex shaders are just 1D vertex count. With instancing (GLES3), vertex shaders are 2D vertex count x instance count.
<alyssa>
So the hardware does the extra dispatch for "free"
<alyssa>
(Free since it's a special case of compute shaders)
<alyssa>
2. Numerous instanced modes on the attribute unit. In addition to the "linear" mode used for noninstanced attributes, there are modes for doing divisons and modulos on the unfolded index (i.e. instance_count * vertex_id + instance_id)
<alyssa>
Different modes correspond to different vertex attribute divisors in opengl (with an annoying dependence also on the per-draw instance count)
<anarsoul>
do you have to duplicate attributes for 1)?
<alyssa>
No
<alyssa>
That's what the attribute unit modes are for
<alyssa>
The trouble is this requires a per-vertex division, and Arm doesn't want a hardware divisor
<alyssa>
So instead the driver calculates a magic constant (roughly, the reciprocal) which the hardware multiplies by
<alyssa>
Intuitively, you precompute (2^32 / d) and then multiply by it to divide by d
<alyssa>
There are.... hairy details in practice. But that's the idea.
<anarsoul>
but why do you need vertex ID and instance ID attributes?
<alyssa>
gl spec requirement
<alyssa>
gl_VertexID and gl_InstanceID
<anarsoul>
HW doesn't have internal counter? :)
<alyssa>
Nope
<alyssa>
TTBOMK
<alyssa>
well
<alyssa>
effectively no, it's the unfolded index
<alyssa>
well
<alyssa>
yes on bifrost more so
<alyssa>
midgard is a mess
<alyssa>
anyways I doubt this stuff is implemented (properly) in Utgard
<anarsoul>
I'm thinking on emulating instancing in lima
<alyssa>
sure.. don't copy panfrost for that though :p
<anarsoul>
that's the only missing piece to get alacritty working :) and unrolling instances from app side is going to be more expensive for sure
<alyssa>
tbh I don't know that lima knows the utgard hw well enough to emulate instancing sanely.
<anarsoul>
well, attribute descriptors are REd
<anarsoul>
HW doesn't support instancing, but we can unroll it more efficiently than from the app side
<alyssa>
also, why do you want alacritty working?
<anarsoul>
for fun? :)
<anarsoul>
(termite was dropped from archlinuxarm repos recently)
<anarsoul>
and I've just got dual source blending working with lima
<anarsoul>
so I don't see why not to hack it to get instancing emulated
camus has joined #panfrost
camus1 has quit [Ping timeout: 480 seconds]
<anarsoul>
alyssa: one more question, does panfrost account gl_VertexID and gl_InstanceID in PIPE_SHADER_CAP_MAX_INPUTS for vertex shader? :)
nakash7 has quit []
karolherbst_ has quit [Ping timeout: 480 seconds]
<anarsoul>
s/account/account for
karolherbst has joined #panfrost
<alyssa>
don't remember
camus1 has joined #panfrost
camus has quit [Read error: Connection reset by peer]
camus has quit [Read error: Connection reset by peer]
rasterman has joined #panfrost
rasterman has quit [Quit: Gettin' stinky!]
floof58 has quit [Ping timeout: 480 seconds]
floof58 has joined #panfrost
camus1 has quit [Ping timeout: 480 seconds]
camus has joined #panfrost
camus1 has joined #panfrost
camus has quit [Ping timeout: 480 seconds]
Daanct12 is now known as Danct12
karolherbst has quit [Quit: Konversation terminated!]
karolherbst has joined #panfrost
<alyssa>
oh no
enunes has joined #panfrost
camus has joined #panfrost
camus1 has quit [Remote host closed the connection]
hyrc has joined #panfrost
camus1 has joined #panfrost
camus has quit [Ping timeout: 480 seconds]
WoC has joined #panfrost
WoC has quit [Remote host closed the connection]
austriancoder_ has quit []
austriancoder has joined #panfrost
<ndufresne>
needed to test something on 5.16-rc1 (meida_stage) and have hit a crash in panfrost, is that known fixed ? https://paste.centos.org/view/9deae726