mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
softpipe: use 64-bit arithmetic in softpipe_resource_layout()
To avoid 32-bit integer overflow for large textures. Note: we're already doing this in llvmpipe. Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
070036ca39
commit
465b2c42bc
1 changed files with 3 additions and 3 deletions
|
|
@ -60,7 +60,7 @@ softpipe_resource_layout(struct pipe_screen *screen,
|
|||
unsigned width = pt->width0;
|
||||
unsigned height = pt->height0;
|
||||
unsigned depth = pt->depth0;
|
||||
unsigned buffer_size = 0;
|
||||
uint64_t buffer_size = 0;
|
||||
|
||||
for (level = 0; level <= pt->last_level; level++) {
|
||||
unsigned slices;
|
||||
|
|
@ -76,8 +76,8 @@ softpipe_resource_layout(struct pipe_screen *screen,
|
|||
|
||||
spr->level_offset[level] = buffer_size;
|
||||
|
||||
buffer_size += (util_format_get_nblocksy(pt->format, height) *
|
||||
slices * spr->stride[level]);
|
||||
buffer_size += (uint64_t) util_format_get_nblocksy(pt->format, height) *
|
||||
slices * spr->stride[level];
|
||||
|
||||
width = u_minify(width, 1);
|
||||
height = u_minify(height, 1);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue