Lyude has quit [Read error: Connection reset by peer]
<TellowKrinkle>
Hello! I'm trying to run Dolphin on a Libre Computer Solitude (Amlogic S905D3 / Mali G31), and it looks like tiles of the depth buffer are randomly getting cleared to 0.
<TellowKrinkle>
This seems to always happen after a panfrost_flush call (usually caused by a glFenceSync from Dolphin, but I've also seen it happen with glReadPixels on the depth buffer).
<TellowKrinkle>
Editing mesa to change the depth pre frame mode from MALI_PRE_POST_FRAME_SHADER_MODE_EARLY_ZS_ALWAYS to MALI_PRE_POST_FRAME_SHADER_MODE_ALWAYS seems to fix the issue. What's the difference between the various MALI_PRE_POST_FRAME_SHADER_MODEs?
Amoled has joined #panfrost
Amoled has quit [Remote host closed the connection]
<benjaminl>
tellowkrinkle: the pre-frame modes control whether the pre-frame shader is run for each tile. NEVER and ALWAYS are no tiles/all tiles respectively. INTERSECT only runs the shader for tiles that contain geometry in a given draw. EARLY_ZS_ALWAYS is like ALWAYS but optimized for depth/stencil. The shader can only write ZS in this mode.
<benjaminl>
... is G31 actually v7?
<benjaminl>
v6 doesn't support EARLY_ZS_ALWAYS, so if it's being misclassified that might be the problem
<pac85>
Are there any requirements other than the shader only writing zs?
<pac85>
I see the shader also doing ATEST, is that ok?
dliviu has quit [Ping timeout: 480 seconds]
dliviu has joined #panfrost
<benjaminl>
pac85: it must only write zs, it must write zs for every fragment, the render state zs_update_operation must be set to MALI_PIXEL_KILL_FORCE_LATE (this is required whenever a shader writes zs)
<benjaminl>
I believe ATEST is required if you use ZS_EMIT
<TellowKrinkle>
I also tried adjusting the v7 check to fail, and then it picks _INTERSECT which ends up making the depth look slightly different but just as broken.
<pac85>
benjaminl: I see thanks
<benjaminl>
hmm... any idea if the cleared tiles are all the tiles that are touched by the next draws, or possibly all the tiles that *are not* touched by the next draws?