nine: char can be unsigned on non-x86 platforms

Keep sign by using int8_t to get the same result on non-x86 machines.

Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17698>
This commit is contained in:
David Heidelberg 2022-07-21 23:43:07 +02:00 committed by Marge Bot
parent e041a0d1e6
commit 57841823a1
4 changed files with 7 additions and 7 deletions

View File

@ -323,7 +323,7 @@ NineBuffer9_Lock( struct NineBuffer9 *This,
BASEBUF_REGISTER_UPDATE(This);
}
*ppbData = (char *)This->managed.data + OffsetToLock;
*ppbData = (int8_t *)This->managed.data + OffsetToLock;
DBG("returning pointer %p\n", *ppbData);
This->nlocks++;
return D3D_OK;
@ -710,6 +710,6 @@ NineBuffer9_Upload( struct NineBuffer9 *This )
box_upload.x,
box_upload.width,
upload_flags,
(char *)This->managed.data + box_upload.x);
(int8_t *)This->managed.data + box_upload.x);
This->managed.dirty = FALSE;
}

View File

@ -1574,7 +1574,7 @@ nine_ff_get_vs(struct NineDevice9 *device)
unsigned s, i;
boolean has_indexes = false;
boolean has_weights = false;
char input_texture_coord[8];
int8_t input_texture_coord[8];
assert(sizeof(key) <= sizeof(key.value32));

View File

@ -66,7 +66,7 @@ nine_ff_get_projected_key(struct nine_context *context, unsigned num_stages)
{
unsigned s, i;
uint16_t projected = 0;
char input_texture_coord[num_stages];
int8_t input_texture_coord[num_stages];
memset(&input_texture_coord, 0, sizeof(input_texture_coord));
if (context->vdecl) {

View File

@ -417,7 +417,7 @@ prepare_vs_constants_userbuf_swvp(struct NineDevice9 *device)
context->pipe_data.cb0_swvp.buffer_size = cb.buffer_size;
context->pipe_data.cb0_swvp.user_buffer = cb.user_buffer;
cb.user_buffer = (char *)cb.user_buffer + 4096 * sizeof(float[4]);
cb.user_buffer = (int8_t *)cb.user_buffer + 4096 * sizeof(float[4]);
context->pipe_data.cb1_swvp.buffer_offset = cb.buffer_offset;
context->pipe_data.cb1_swvp.buffer_size = cb.buffer_size;
context->pipe_data.cb1_swvp.user_buffer = cb.user_buffer;
@ -3041,7 +3041,7 @@ update_vertex_elements_sw(struct NineDevice9 *device)
unsigned n, b, i;
int index;
int8_t vdecl_index_map[16]; /* vs->num_inputs <= 16 */
char used_streams[device->caps.MaxStreams];
int8_t used_streams[device->caps.MaxStreams];
int dummy_vbo_stream = -1;
BOOL need_dummy_vbo = FALSE;
struct cso_velems_state ve;
@ -3206,7 +3206,7 @@ update_vs_constants_sw(struct NineDevice9 *device)
if (cb.buffer)
pipe_resource_reference(&cb.buffer, NULL);
cb.user_buffer = (char *)buf + 4096 * sizeof(float[4]);
cb.user_buffer = (int8_t *)buf + 4096 * sizeof(float[4]);
pipe_sw->set_constant_buffer(pipe_sw, PIPE_SHADER_VERTEX, 1, false, &cb);
if (cb.buffer)