One thing that’s everywhere in mesa (at least outside of mesa core) is
enum pipe_format. This enum is used to describe image formats. The general way that it works is that there’s a hook in
/** * Check if the given pipe_format is supported as a texture or * drawing surface. * \param bindings bitmask of PIPE_BIND_* */ bool (*is_format_supported)( struct pipe_screen *, enum pipe_format format, enum pipe_texture_target target, unsigned sample_count, unsigned storage_sample_count, unsigned bindings );
Each gallium driver implements this hook, and then gallium queries the driver before creating a resource using a given format and then also before using a created resource in various ways.