treewide: use uint64_t / (u)intptr_t in image address calculations
16K * 16K * 16bpp = 4G, which overflows int32, so layer_stride needs to have 64 bits. More generally, any "byte_stride * height" computation can overflow int32. Use (u)intptr_t in some gallium and st/mesa places where we do CPU access. Use uint64_t otherwise. Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23389>
This commit is contained in:
@@ -893,7 +893,7 @@ struct pipe_context {
|
||||
const struct pipe_box *,
|
||||
const void *data,
|
||||
unsigned stride,
|
||||
unsigned layer_stride);
|
||||
uintptr_t layer_stride);
|
||||
|
||||
/**
|
||||
* Flush any pending framebuffer writes and invalidate texture caches.
|
||||
|
||||
@@ -638,7 +638,7 @@ struct pipe_transfer
|
||||
unsigned level:8; /**< texture mipmap level */
|
||||
struct pipe_box box; /**< region of the resource to access */
|
||||
unsigned stride; /**< row stride in bytes */
|
||||
unsigned layer_stride; /**< image/layer stride in bytes */
|
||||
uintptr_t layer_stride; /**< image/layer stride in bytes */
|
||||
|
||||
/* Offset into a driver-internal staging buffer to make use of unused
|
||||
* padding in this structure.
|
||||
|
||||
Reference in New Issue
Block a user