mesa: optional queries
In OpenGL, it's legal to support zero bits for both occlusion queries and pipeline statistics queries.
We already took advantage of this for ARB_occlusion_query, but we stumble a bit because we end up trying to create invalid queries if an application tries to use them.
This MR fixes that issue, and hooks up the same logic for ARB_occlusion_query2 and ARB_pipeline_statistics_query. This results in lighter requirements for Zink, which is especially useful on mobile hardware.
This only enables the core functionality, the ARB_occlusion_query2
and ARB_pipeline_statistics_query
extensions are not exposed without hardware support.