mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
glthread: change sizes to unsigned or size_t where needed
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7719>
This commit is contained in:
parent
6fe524d0f8
commit
4b2445916e
4 changed files with 7 additions and 7 deletions
|
|
@ -46,8 +46,8 @@ glthread_unmarshal_batch(void *job, int thread_index)
|
||||||
{
|
{
|
||||||
struct glthread_batch *batch = (struct glthread_batch*)job;
|
struct glthread_batch *batch = (struct glthread_batch*)job;
|
||||||
struct gl_context *ctx = batch->ctx;
|
struct gl_context *ctx = batch->ctx;
|
||||||
int pos = 0;
|
unsigned pos = 0;
|
||||||
int used = batch->used;
|
unsigned used = batch->used;
|
||||||
uint64_t *buffer = batch->buffer;
|
uint64_t *buffer = batch->buffer;
|
||||||
|
|
||||||
_glapi_set_dispatch(ctx->CurrentServerDispatch);
|
_glapi_set_dispatch(ctx->CurrentServerDispatch);
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ struct glthread_batch
|
||||||
* value temporarily, and glthread::used is copied to this variable when
|
* value temporarily, and glthread::used is copied to this variable when
|
||||||
* the batch is submitted.
|
* the batch is submitted.
|
||||||
*/
|
*/
|
||||||
int used;
|
unsigned used;
|
||||||
|
|
||||||
/** Data contained in the command buffer. */
|
/** Data contained in the command buffer. */
|
||||||
uint64_t buffer[MARSHAL_MAX_CMD_SIZE / 8];
|
uint64_t buffer[MARSHAL_MAX_CMD_SIZE / 8];
|
||||||
|
|
@ -154,7 +154,7 @@ struct glthread_state
|
||||||
unsigned next;
|
unsigned next;
|
||||||
|
|
||||||
/** Amount of data filled in next_batch, in bytes. */
|
/** Amount of data filled in next_batch, in bytes. */
|
||||||
int used;
|
unsigned used;
|
||||||
|
|
||||||
/** Upload buffer. */
|
/** Upload buffer. */
|
||||||
struct gl_buffer_object *upload_buffer;
|
struct gl_buffer_object *upload_buffer;
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,7 @@ _mesa_marshal_BufferData_merged(GLuint target_or_name, GLsizeiptr size,
|
||||||
bool external_mem = !named &&
|
bool external_mem = !named &&
|
||||||
target_or_name == GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD;
|
target_or_name == GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD;
|
||||||
bool copy_data = data && !external_mem;
|
bool copy_data = data && !external_mem;
|
||||||
int cmd_size = sizeof(struct marshal_cmd_BufferData) + (copy_data ? size : 0);
|
size_t cmd_size = sizeof(struct marshal_cmd_BufferData) + (copy_data ? size : 0);
|
||||||
|
|
||||||
if (unlikely(size < 0 || size > INT_MAX || cmd_size < 0 ||
|
if (unlikely(size < 0 || size > INT_MAX || cmd_size < 0 ||
|
||||||
cmd_size > MARSHAL_MAX_CMD_SIZE ||
|
cmd_size > MARSHAL_MAX_CMD_SIZE ||
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ extern const _mesa_unmarshal_func _mesa_unmarshal_dispatch[NUM_DISPATCH_CMD];
|
||||||
static inline void *
|
static inline void *
|
||||||
_mesa_glthread_allocate_command(struct gl_context *ctx,
|
_mesa_glthread_allocate_command(struct gl_context *ctx,
|
||||||
uint16_t cmd_id,
|
uint16_t cmd_id,
|
||||||
int size)
|
unsigned size)
|
||||||
{
|
{
|
||||||
struct glthread_state *glthread = &ctx->GLThread;
|
struct glthread_state *glthread = &ctx->GLThread;
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ _mesa_glthread_allocate_command(struct gl_context *ctx,
|
||||||
_mesa_glthread_flush_batch(ctx);
|
_mesa_glthread_flush_batch(ctx);
|
||||||
|
|
||||||
struct glthread_batch *next = glthread->next_batch;
|
struct glthread_batch *next = glthread->next_batch;
|
||||||
const int aligned_size = align(size, 8);
|
const unsigned aligned_size = align(size, 8);
|
||||||
struct marshal_cmd_base *cmd_base =
|
struct marshal_cmd_base *cmd_base =
|
||||||
(struct marshal_cmd_base *)&next->buffer[glthread->used / 8];
|
(struct marshal_cmd_base *)&next->buffer[glthread->used / 8];
|
||||||
glthread->used += aligned_size;
|
glthread->used += aligned_size;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue