Flickering in kodi when using volume buttons

I experienced this weird behavour in kodi after a fresh setup where movies played fine but as soon as I changed the volume it flickered because of the appearing volume bar. The fix is to go to Settings > Player > Videos > Processing > PRIME Render Method > set to EGL

P.s. this was on raspberrypi 3B