Should it? I think we could just require info->filename to be NULL for that case.
My comment was phrased poorly - from the caller's side yes, info->filename = NULL will be the way to request a memory only cache.
What I wanted to say is that in the case of a memory only cache cache->filename (dynamic length array at the end of struct vkd3d_shader_cache) becomes an empty string and I want to prevent cases where the caller passes info->filename = "". Although in practise I'd expect fopen("") to fail and such a cache never be created with or without an explicit check.