e83da2d8e3
Previously, when importing a resource with modifiers that include clear color as auxiliary data, we were mapping the clear color BO on the CPU in order to set res->aux.clear_color to the value stored there. We are generally trying to avoid CPU mapping imported buffers, because in hybrid setups, they could be from a different device, and may not be mappable. So we'd like to avoid that here. This CPU-side knowledge of the clear color is only used in a few cases: 1. Avoiding a resolve due to a partial clear with a changing clear color 2. Avoiding disabling CCS when rendering to a texture view of a resource where the only format difference is sRGB vs. linear and the clear color is 0/1. Instead of mapping the clear color BO on the CPU, we instead set a flag indicating that we don't know the clear color, and reset it to known on our first clear. In the first case, the first partial fast clear of a resource would eat an extra resolve (there is no penalty if we clear the whole resource). The second case doesn't seem that critical, as it's someone rendering to an imported BO - when the common case is to texture from it. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11888>