cdd201010d
With NGG GS, the hardware can't know the number of generated primitives and we have to increment it manually from the shader using a plain GDS atomic operation. Though this had a serious problem (see this old TODO) if the bound pipeline was using legacy GS because the query implementation was relying on NGG GS. Another situation is if we had one draw with NGG GS, followed by one draw with legacy (or the opposite) the query result would have been broken. The solution is to allocate two 64-bit values for storing the begin/end values if the query pool is supposed to need GDS and accumulate the result with the number of generated primitives generated by the hw. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15892>