iris: Use at least 1x1 size for null FB surface state.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 6 Nov 2018 07:16:14 +0000 (23:16 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:09 +0000 (10:26 -0800)
Otherwise we get 0 - 1 = 0xffffffff and fail to pack SURFACE_STATE.

Fixes some object namespace pollution gltexsubimage2d tests

src/gallium/drivers/iris/iris_state.c

index 86975e279e120dfbf3ee446f9e2a9098e0398e7e..06e3e8eacc582b4cb4b8076bdebd931cad61c96c 100644 (file)
@@ -2055,7 +2055,10 @@ iris_set_framebuffer_state(struct pipe_context *ctx,
    void *null_surf_map =
       upload_state(ice->state.surface_uploader, &ice->state.null_fb,
                    4 * GENX(RENDER_SURFACE_STATE_length), 64);
-   isl_null_fill_state(&screen->isl_dev, null_surf_map, isl_extent3d(cso->width, cso->height, cso->layers ? cso->layers : 1));
+   isl_null_fill_state(&screen->isl_dev, null_surf_map,
+                       isl_extent3d(MAX2(cso->width, 1),
+                                    MAX2(cso->height, 1),
+                                    cso->layers ? cso->layers : 1));
    ice->state.null_fb.offset +=
       iris_bo_offset_from_base_address(iris_resource_bo(ice->state.null_fb.res));