summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_screen.cpp
diff options
context:
space:
mode:
authorAlok Hota <[email protected]>2019-02-21 14:41:15 -0600
committerAlok Hota <[email protected]>2019-02-22 23:35:11 +0000
commit6053499f2eafde606b13a9663016e9be8e4089eb (patch)
tree00c8204a67a445a9ea5433357c2b3d015cea9c51 /src/gallium/drivers/swr/swr_screen.cpp
parentb326a15edab34d09e7b328dd8726137960ae12a5 (diff)
swr/rast: bypass size limit for non-sampled textures
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: <[email protected]> Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_screen.cpp')
-rw-r--r--src/gallium/drivers/swr/swr_screen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp
index 68e49a5ae2b..ea63368f750 100644
--- a/src/gallium/drivers/swr/swr_screen.cpp
+++ b/src/gallium/drivers/swr/swr_screen.cpp
@@ -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) {