iris: fix assert to reflect correct limit for encoded size
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 14 May 2021 13:04:13 +0000 (16:04 +0300)
committerMarge Bot <eric+marge@anholt.net>
Sat, 15 May 2021 09:57:58 +0000 (09:57 +0000)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10805>

src/gallium/drivers/iris/iris_program.c

index 52d6dcc..97b505c 100644 (file)
@@ -2149,7 +2149,7 @@ iris_get_scratch_space(struct iris_context *ice,
    const struct intel_device_info *devinfo = &screen->devinfo;
 
    unsigned encoded_size = ffs(per_thread_scratch) - 11;
-   assert(encoded_size < (1 << 16));
+   assert(encoded_size < ARRAY_SIZE(ice->shaders.scratch_bos));
 
    struct iris_bo **bop = &ice->shaders.scratch_bos[encoded_size][stage];