swr/rast: bypass size limit for non-sampled textures
authorAlok Hota <alok.hota@intel.com>
Thu, 21 Feb 2019 20:41:15 +0000 (14:41 -0600)
committerAlok Hota <alok.hota@intel.com>
Fri, 22 Feb 2019 23:35:11 +0000 (23:35 +0000)
This fixes a bug where SWR will fail to render in cases with large
buffer allocations, e.g. very large meshes whose vertex buffers exceed
2GB

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/swr_screen.cpp

index 68e49a5ae2bf1e6605047c44d1f9b2de1b1753b9..ea63368f75002b7e13de94347f420cf2ea633923 100644 (file)
@@ -845,7 +845,9 @@ swr_texture_layout(struct swr_screen *screen,
 
    size_t total_size = (uint64_t)res->swr.depth * res->swr.qpitch *
                                  res->swr.pitch * res->swr.numSamples;
-   if (total_size > SWR_MAX_TEXTURE_SIZE)
+
+   // Let non-sampled textures (e.g. buffer objects) bypass the size limit
+   if (swr_resource_is_texture(&res->base) && total_size > SWR_MAX_TEXTURE_SIZE)
       return false;
 
    if (allocate) {