mesa/src/gallium/auxiliary/util/u_transfer.h
Marek Olšák 68735f4e86 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>
2023-06-07 16:53:36 +00:00

42 lines
1.3 KiB
C

#ifndef U_TRANSFER_H
#define U_TRANSFER_H
#include "pipe/p_state.h"
struct pipe_context;
struct winsys_handle;
#ifdef __cplusplus
extern "C" {
#endif
void u_default_buffer_subdata(struct pipe_context *pipe,
struct pipe_resource *resource,
unsigned usage, unsigned offset,
unsigned size, const void *data);
void u_default_clear_buffer(struct pipe_context *pipe,
struct pipe_resource *resource,
unsigned offset, unsigned size,
const void *clear_value,
int clear_value_size);
void u_default_texture_subdata(struct pipe_context *pipe,
struct pipe_resource *resource,
unsigned level,
unsigned usage,
const struct pipe_box *box,
const void *data,
unsigned stride,
uintptr_t layer_stride);
void u_default_transfer_flush_region( struct pipe_context *pipe,
struct pipe_transfer *transfer,
const struct pipe_box *box);
#ifdef __cplusplus
} // extern "C" {
#endif
#endif