isl: Add some asserts about multisampled surfaces

This isn't really necessary because the API doesn't allow MSAA and
mipmapping at the same time but people forget that pretty often so it's
good to have it as documentation if nothing else.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14129>
This commit is contained in:
Jason Ekstrand
2022-05-30 09:52:10 -05:00
committed by Marge Bot
parent 8d8fb6429c
commit faa51a10ed
+13
View File
@@ -439,6 +439,19 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
s.CubeFaceEnableNegativeX = 1;
#if GFX_VER >= 6
/* From the Broadwell PRM for "Number of Multisamples":
*
* "If this field is any value other than MULTISAMPLECOUNT_1, Surface
* Min LOD, Mip Count / LOD, and Resource Min LOD must be set to zero."
*
* This is fine because no 3D API allows multisampling and mipmapping at
* the same time.
*/
if (info->surf->samples > 1) {
assert(info->view->min_lod_clamp == 0);
assert(info->view->base_level == 0);
assert(info->view->levels == 1);
}
s.NumberofMultisamples = ffs(info->surf->samples) - 1;
#if GFX_VER >= 7
s.MultisampledSurfaceStorageFormat =