From e53915828f9b2d3f69c04d467a008f25a2904951 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Fri, 23 Jun 2023 00:35:04 +0800 Subject: [PATCH] treewide: Replace the usage of ubyte/ushort with uint8_t/uint16_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Yonggang Luo Acked-by: David Heidelberg Acked-by: Marek Olšák Acked-by: Erik Faye-Lund Part-of: --- src/gallium/auxiliary/draw/draw_context.h | 2 +- src/gallium/auxiliary/draw/draw_decompose_tmp.h | 4 +- src/gallium/auxiliary/draw/draw_gs.c | 4 +- src/gallium/auxiliary/draw/draw_pipe.c | 6 +- src/gallium/auxiliary/draw/draw_pipe.h | 4 +- src/gallium/auxiliary/draw/draw_pipe_clip.c | 2 +- src/gallium/auxiliary/draw/draw_pipe_stipple.c | 6 +- src/gallium/auxiliary/draw/draw_pipe_util.c | 2 +- src/gallium/auxiliary/draw/draw_pipe_vbuf.c | 12 +- src/gallium/auxiliary/draw/draw_private.h | 2 +- src/gallium/auxiliary/draw/draw_pt.c | 6 +- src/gallium/auxiliary/draw/draw_pt.h | 4 +- src/gallium/auxiliary/draw/draw_pt_emit.c | 10 +- .../auxiliary/draw/draw_pt_fetch_shade_emit.c | 26 ++--- .../auxiliary/draw/draw_pt_fetch_shade_pipeline.c | 4 +- .../draw/draw_pt_fetch_shade_pipeline_llvm.c | 6 +- src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h | 8 +- src/gallium/auxiliary/draw/draw_tess.c | 8 +- src/gallium/auxiliary/draw/draw_tess.h | 2 +- src/gallium/auxiliary/draw/draw_vbuf.h | 10 +- src/gallium/auxiliary/indices/u_unfilled_indices.c | 10 +- src/gallium/auxiliary/nir/nir_to_tgsi_info.c | 2 +- src/gallium/auxiliary/tgsi/tgsi_scan.c | 20 ++-- src/gallium/auxiliary/tgsi/tgsi_scan.h | 46 ++++---- .../auxiliary/translate/translate_generic.c | 60 +++++----- src/gallium/auxiliary/util/u_blitter.c | 2 +- src/gallium/auxiliary/util/u_debug_image.c | 4 +- src/gallium/auxiliary/util/u_debug_image.h | 2 +- src/gallium/auxiliary/util/u_inlines.h | 4 +- src/gallium/auxiliary/util/u_pack_color.h | 128 ++++++++++----------- src/gallium/auxiliary/util/u_pstipple.c | 2 +- src/gallium/auxiliary/util/u_pwr8.h | 4 +- src/gallium/auxiliary/util/u_simple_shaders.c | 12 +- src/gallium/auxiliary/util/u_simple_shaders.h | 12 +- src/gallium/auxiliary/util/u_sse.h | 4 +- src/gallium/auxiliary/util/u_surface.c | 22 ++-- src/gallium/auxiliary/util/u_surface.h | 10 +- src/gallium/auxiliary/util/u_threaded_context.c | 28 ++--- src/gallium/auxiliary/util/u_threaded_context.h | 4 +- src/gallium/auxiliary/util/u_tile.c | 4 +- src/gallium/drivers/d3d12/d3d12_screen.cpp | 4 +- src/gallium/drivers/i915/i915_context.c | 2 +- src/gallium/drivers/i915/i915_context.h | 2 +- src/gallium/drivers/i915/i915_debug.c | 2 +- src/gallium/drivers/i915/i915_prim_vbuf.c | 10 +- src/gallium/drivers/i915/i915_state.c | 10 +- src/gallium/drivers/i915/i915_state_dynamic.c | 4 +- src/gallium/drivers/lima/lima_draw.c | 2 +- src/gallium/drivers/llvmpipe/lp_context.h | 2 +- src/gallium/drivers/llvmpipe/lp_draw_arrays.c | 2 +- src/gallium/drivers/llvmpipe/lp_jit.c | 10 +- src/gallium/drivers/llvmpipe/lp_linear_interp.c | 2 +- src/gallium/drivers/llvmpipe/lp_scene.h | 6 +- src/gallium/drivers/llvmpipe/lp_setup.c | 8 +- src/gallium/drivers/llvmpipe/lp_setup.h | 2 +- src/gallium/drivers/llvmpipe/lp_setup_vbuf.c | 8 +- src/gallium/drivers/llvmpipe/lp_state_cs.c | 4 +- src/gallium/drivers/llvmpipe/lp_state_fs.c | 8 +- src/gallium/drivers/llvmpipe/lp_surface.c | 6 +- src/gallium/drivers/llvmpipe/lp_texture.c | 6 +- src/gallium/drivers/llvmpipe/lp_texture.h | 2 +- src/gallium/drivers/nouveau/nv30/nv30_draw.c | 8 +- src/gallium/drivers/nouveau/nv50/nv50_program.c | 2 +- src/gallium/drivers/nouveau/nv50/nv50_program.h | 28 ++--- src/gallium/drivers/nouveau/nvc0/nvc0_program.c | 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_program.h | 2 +- .../drivers/nouveau/nvc0/nvc0_state_validate.c | 2 +- src/gallium/drivers/r300/r300_render.c | 10 +- src/gallium/drivers/r300/r300_render_stencilref.c | 2 +- src/gallium/drivers/r600/r600_pipe.h | 10 +- src/gallium/drivers/r600/r600_pipe_common.h | 2 +- src/gallium/drivers/r600/r600_texture.c | 2 +- src/gallium/drivers/radeonsi/si_pipe.h | 20 ++-- src/gallium/drivers/radeonsi/si_shader.c | 4 +- src/gallium/drivers/radeonsi/si_shader.h | 70 +++++------ src/gallium/drivers/radeonsi/si_shader_llvm_tess.c | 2 +- src/gallium/drivers/radeonsi/si_state.c | 8 +- src/gallium/drivers/radeonsi/si_state.h | 4 +- src/gallium/drivers/radeonsi/si_state_draw.cpp | 2 +- src/gallium/drivers/radeonsi/si_state_shaders.cpp | 2 +- src/gallium/drivers/softpipe/sp_context.h | 2 +- src/gallium/drivers/softpipe/sp_draw_arrays.c | 2 +- src/gallium/drivers/softpipe/sp_fs_exec.c | 4 +- src/gallium/drivers/softpipe/sp_prim_vbuf.c | 8 +- src/gallium/drivers/softpipe/sp_quad_blend.c | 2 +- src/gallium/drivers/softpipe/sp_quad_depth_test.c | 16 +-- .../drivers/softpipe/sp_quad_depth_test_tmp.h | 18 +-- src/gallium/drivers/softpipe/sp_tile_cache.c | 2 +- src/gallium/drivers/softpipe/sp_tile_cache.h | 6 +- src/gallium/drivers/svga/svga_draw.h | 2 +- src/gallium/drivers/svga/svga_draw_arrays.c | 4 +- src/gallium/drivers/svga/svga_draw_elements.c | 2 +- src/gallium/drivers/svga/svga_draw_private.h | 4 +- src/gallium/drivers/svga/svga_link.h | 4 +- src/gallium/drivers/svga/svga_pipe_draw.c | 2 +- src/gallium/drivers/svga/svga_resource_texture.h | 6 +- src/gallium/drivers/svga/svga_shader.h | 18 +-- src/gallium/drivers/svga/svga_swtnl_backend.c | 10 +- src/gallium/drivers/svga/svga_swtnl_draw.c | 4 +- src/gallium/drivers/svga/svga_swtnl_private.h | 4 +- src/gallium/drivers/svga/svga_tgsi_decl_sm30.c | 2 +- src/gallium/drivers/svga/svga_tgsi_vgpu10.c | 12 +- src/gallium/frontends/d3d10umd/Resource.cpp | 8 +- src/gallium/frontends/lavapipe/lvp_execute.c | 14 +-- src/gallium/frontends/osmesa/osmesa.c | 6 +- src/gallium/include/pipe/p_state.h | 6 +- src/mesa/main/shader_types.h | 4 +- src/mesa/state_tracker/st_cb_bitmap.c | 4 +- src/mesa/state_tracker/st_cb_drawpixels.c | 14 +-- src/mesa/state_tracker/st_cb_feedback.c | 2 +- src/mesa/state_tracker/st_cb_rasterpos.c | 6 +- src/mesa/state_tracker/st_cb_readpixels.c | 2 +- src/mesa/state_tracker/st_cb_texture.c | 6 +- src/mesa/state_tracker/st_context.h | 2 +- src/mesa/state_tracker/st_draw_feedback.c | 2 +- src/mesa/state_tracker/st_program.c | 2 +- src/mesa/state_tracker/st_texture.c | 2 +- 117 files changed, 503 insertions(+), 503 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_context.h b/src/gallium/auxiliary/draw/draw_context.h index 7e809ef..737bc34 100644 --- a/src/gallium/auxiliary/draw/draw_context.h +++ b/src/gallium/auxiliary/draw/draw_context.h @@ -82,7 +82,7 @@ struct draw_prim_info { bool linear; unsigned start; - const ushort *elts; + const uint16_t *elts; unsigned count; enum mesa_prim prim; diff --git a/src/gallium/auxiliary/draw/draw_decompose_tmp.h b/src/gallium/auxiliary/draw/draw_decompose_tmp.h index c5e5e01..d086354 100644 --- a/src/gallium/auxiliary/draw/draw_decompose_tmp.h +++ b/src/gallium/auxiliary/draw/draw_decompose_tmp.h @@ -48,7 +48,7 @@ static void FUNC(FUNC_VARS) { unsigned idx[6], i; - ushort flags; + uint16_t flags; LOCAL_VARS FUNC_ENTER; @@ -278,7 +278,7 @@ FUNC(FUNC_VARS) case MESA_PRIM_POLYGON: if (count >= 3) { - ushort edge_next, edge_finish; + uint16_t edge_next, edge_finish; if (last_vertex_last) { flags = (DRAW_PIPE_RESET_STIPPLE | diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c index fb07656..a00540a 100644 --- a/src/gallium/auxiliary/draw/draw_gs.c +++ b/src/gallium/auxiliary/draw/draw_gs.c @@ -51,8 +51,8 @@ static inline int draw_gs_get_input_index(int semantic, int index, const struct tgsi_shader_info *input_info) { - const ubyte *input_semantic_names = input_info->output_semantic_name; - const ubyte *input_semantic_indices = input_info->output_semantic_index; + const uint8_t *input_semantic_names = input_info->output_semantic_name; + const uint8_t *input_semantic_indices = input_info->output_semantic_index; for (int i = 0; i < PIPE_MAX_SHADER_OUTPUTS; i++) { if (input_semantic_names[i] == semantic && input_semantic_indices[i] == index) diff --git a/src/gallium/auxiliary/draw/draw_pipe.c b/src/gallium/auxiliary/draw/draw_pipe.c index 067c818..646aa19 100644 --- a/src/gallium/auxiliary/draw/draw_pipe.c +++ b/src/gallium/auxiliary/draw/draw_pipe.c @@ -136,7 +136,7 @@ do_point(struct draw_context *draw, */ static void do_line(struct draw_context *draw, - ushort flags, + uint16_t flags, const char *v0, const char *v1) { @@ -157,7 +157,7 @@ do_line(struct draw_context *draw, */ static void do_triangle(struct draw_context *draw, - ushort flags, + uint16_t flags, char *v0, char *v1, char *v2) @@ -210,7 +210,7 @@ do_triangle(struct draw_context *draw, unsigned prim_flags, \ struct vertex_header *vertices, \ unsigned stride, \ - const ushort *elts, \ + const uint16_t *elts, \ unsigned count, \ unsigned max_index diff --git a/src/gallium/auxiliary/draw/draw_pipe.h b/src/gallium/auxiliary/draw/draw_pipe.h index 9ab6883..2afb377 100644 --- a/src/gallium/auxiliary/draw/draw_pipe.h +++ b/src/gallium/auxiliary/draw/draw_pipe.h @@ -43,8 +43,8 @@ */ struct prim_header { float det; /**< front/back face determinant */ - ushort flags; - ushort pad; + uint16_t flags; + uint16_t pad; struct vertex_header *v[3]; /**< 1 to 3 vertex pointers */ }; diff --git a/src/gallium/auxiliary/draw/draw_pipe_clip.c b/src/gallium/auxiliary/draw/draw_pipe_clip.c index 9f0f9b3..7a47a7a 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_clip.c +++ b/src/gallium/auxiliary/draw/draw_pipe_clip.c @@ -222,7 +222,7 @@ emit_poly(struct draw_stage *stage, const struct prim_header *origPrim) { const struct clip_stage *clipper = clip_stage(stage); - ushort edge_first, edge_middle, edge_last; + uint16_t edge_first, edge_middle, edge_last; if (stage->draw->rasterizer->flatshade_first) { edge_first = DRAW_PIPE_EDGE_FLAG_0; diff --git a/src/gallium/auxiliary/draw/draw_pipe_stipple.c b/src/gallium/auxiliary/draw/draw_pipe_stipple.c index dc79eda..b379a3f 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_stipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_stipple.c @@ -48,8 +48,8 @@ struct stipple_stage { struct draw_stage stage; unsigned counter; - ushort pattern; - ushort factor; + uint16_t pattern; + uint16_t factor; bool rectangular; }; @@ -110,7 +110,7 @@ emit_segment(struct draw_stage *stage, struct prim_header *header, static inline bool -stipple_test(unsigned counter, ushort pattern, ushort factor) +stipple_test(unsigned counter, uint16_t pattern, uint16_t factor) { unsigned b = (counter / factor) & 0xf; return !!((1 << b) & pattern); diff --git a/src/gallium/auxiliary/draw/draw_pipe_util.c b/src/gallium/auxiliary/draw/draw_pipe_util.c index 91ed2dd..87c1913 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_util.c +++ b/src/gallium/auxiliary/draw/draw_pipe_util.c @@ -73,7 +73,7 @@ draw_alloc_temp_verts(struct draw_stage *stage, unsigned nr) stage->nr_tmps = nr; if (nr != 0) { - ubyte *store = (ubyte *) MALLOC(MAX_VERTEX_SIZE * nr + + uint8_t *store = (uint8_t *) MALLOC(MAX_VERTEX_SIZE * nr + DRAW_EXTRA_VERTICES_PADDING); if (!store) return false; diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c index c71defb..02f8207 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c +++ b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c @@ -69,7 +69,7 @@ struct vbuf_stage { unsigned nr_vertices; /** Indices */ - ushort *indices; + uint16_t *indices; unsigned max_indices; unsigned nr_indices; @@ -115,7 +115,7 @@ check_space(struct vbuf_stage *vbuf, unsigned nr) * have a couple of slots at the beginning (1-dword header, 4-dword * clip pos) that we ignore here. We only use the vertex->data[] fields. */ -static inline ushort +static inline uint16_t emit_vertex(struct vbuf_stage *vbuf, struct vertex_header *vertex) { if (vertex->vertex_id == UNDEFINED_VERTEX_ID && vbuf->vertex_ptr) { @@ -134,7 +134,7 @@ emit_vertex(struct vbuf_stage *vbuf, struct vertex_header *vertex) vertex->vertex_id = vbuf->nr_vertices++; } - return (ushort)vertex->vertex_id; + return (uint16_t)vertex->vertex_id; } @@ -362,8 +362,8 @@ vbuf_alloc_vertices(struct vbuf_stage *vbuf) * fail, we are basically without usable hardware. */ vbuf->render->allocate_vertices(vbuf->render, - (ushort) vbuf->vertex_size, - (ushort) vbuf->max_vertices); + (uint16_t) vbuf->vertex_size, + (uint16_t) vbuf->max_vertices); vbuf->vertex_ptr = vbuf->vertices = vbuf->render->map_vertices(vbuf->render); @@ -428,7 +428,7 @@ draw_vbuf_stage(struct draw_context *draw, struct vbuf_render *render) vbuf->render = render; vbuf->max_indices = MIN2(render->max_indices, UNDEFINED_VERTEX_ID-1); - vbuf->indices = (ushort *) align_malloc(vbuf->max_indices * + vbuf->indices = (uint16_t *) align_malloc(vbuf->max_indices * sizeof(vbuf->indices[0]), 16); if (!vbuf->indices) diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h index 0ffe8c9..670b482 100644 --- a/src/gallium/auxiliary/draw/draw_private.h +++ b/src/gallium/auxiliary/draw/draw_private.h @@ -178,7 +178,7 @@ struct draw_context /* Current active frontend */ struct draw_pt_front_end *frontend; enum mesa_prim prim; - ubyte vertices_per_patch; + uint8_t vertices_per_patch; bool rebind_parameters; unsigned opt; /**< bitmask of PT_x flags */ diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index ae3f543..197548e 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -297,7 +297,7 @@ draw_print_arrays(struct draw_context *draw, enum mesa_prim prim, for (unsigned j = 0; j < draw->pt.nr_vertex_elements; j++) { unsigned buf = draw->pt.vertex_element[j].vertex_buffer_index; - ubyte *ptr = (ubyte *) draw->pt.user.vbuffer[buf].map; + uint8_t *ptr = (uint8_t *) draw->pt.user.vbuffer[buf].map; if (draw->pt.vertex_element[j].instance_divisor) { ii = draw->instance_id / draw->pt.vertex_element[j].instance_divisor; @@ -336,14 +336,14 @@ draw_print_arrays(struct draw_context *draw, enum mesa_prim prim, break; case PIPE_FORMAT_B8G8R8A8_UNORM: { - ubyte *u = (ubyte *) ptr; + uint8_t *u = (uint8_t *) ptr; debug_printf("BGRA %d %d %d %d @ %p\n", u[0], u[1], u[2], u[3], (void *) u); } break; case PIPE_FORMAT_A8R8G8B8_UNORM: { - ubyte *u = (ubyte *) ptr; + uint8_t *u = (uint8_t *) ptr; debug_printf("ARGB %d %d %d %d @ %p\n", u[0], u[1], u[2], u[3], (void *) u); } diff --git a/src/gallium/auxiliary/draw/draw_pt.h b/src/gallium/auxiliary/draw/draw_pt.h index 591fc8c..705a77f 100644 --- a/src/gallium/auxiliary/draw/draw_pt.h +++ b/src/gallium/auxiliary/draw/draw_pt.h @@ -103,7 +103,7 @@ struct draw_pt_middle_end { void (*run)(struct draw_pt_middle_end *, const unsigned *fetch_elts, unsigned fetch_count, - const ushort *draw_elts, + const uint16_t *draw_elts, unsigned draw_count, unsigned prim_flags); @@ -118,7 +118,7 @@ struct draw_pt_middle_end { bool (*run_linear_elts)(struct draw_pt_middle_end *, unsigned fetch_start, unsigned fetch_count, - const ushort *draw_elts, + const uint16_t *draw_elts, unsigned draw_count, unsigned prim_flags); diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c index ebf6d5e..15eb76c 100644 --- a/src/gallium/auxiliary/draw/draw_pt_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_emit.c @@ -137,7 +137,7 @@ draw_pt_emit(struct pt_emit *emit, const float (*vertex_data)[4] = (const float (*)[4])vert_info->verts->data; unsigned vertex_count = vert_info->count; unsigned stride = vert_info->stride; - const ushort *elts = prim_info->elts; + const uint16_t *elts = prim_info->elts; struct draw_context *draw = emit->draw; struct translate *translate = emit->translate; struct vbuf_render *render = draw->render; @@ -160,8 +160,8 @@ draw_pt_emit(struct pt_emit *emit, assert(vertex_count <= 65535); render->allocate_vertices(render, - (ushort)translate->key.output_stride, - (ushort)vertex_count); + (uint16_t)translate->key.output_stride, + (uint16_t)vertex_count); hw_verts = render->map_vertices(render); if (!hw_verts) { @@ -242,8 +242,8 @@ draw_pt_emit_linear(struct pt_emit *emit, assert(count <= 65535); if (!render->allocate_vertices(render, - (ushort)translate->key.output_stride, - (ushort)count)) + (uint16_t)translate->key.output_stride, + (uint16_t)count)) goto fail; hw_verts = render->map_vertices(render); diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c index 08b10e5..26906c5 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c @@ -54,7 +54,7 @@ struct fetch_shade_emit { */ const float *constants; unsigned pitch[PIPE_MAX_ATTRIBS]; - const ubyte *src[PIPE_MAX_ATTRIBS]; + const uint8_t *src[PIPE_MAX_ATTRIBS]; unsigned prim; struct draw_vs_variant_key key; @@ -158,7 +158,7 @@ fse_prepare(struct draw_pt_middle_end *middle, for (unsigned i = 0; i < draw->pt.nr_vertex_buffers; i++) { fse->active->set_buffer(fse->active, i, - ((const ubyte *) draw->pt.user.vbuffer[i].map + + ((const uint8_t *) draw->pt.user.vbuffer[i].map + draw->pt.vertex_buffer[i].buffer_offset), draw->pt.vertex_buffer[i].stride, draw->pt.max_index); @@ -199,8 +199,8 @@ fse_run_linear(struct draw_pt_middle_end *middle, draw_do_flush(draw, DRAW_FLUSH_BACKEND); if (!draw->render->allocate_vertices(draw->render, - (ushort) fse->key.output_stride, - (ushort) count)) + (uint16_t) fse->key.output_stride, + (uint16_t) count)) goto fail; hw_verts = draw->render->map_vertices(draw->render); @@ -226,7 +226,7 @@ fse_run_linear(struct draw_pt_middle_end *middle, } } - draw->render->unmap_vertices(draw->render, 0, (ushort) (count - 1)); + draw->render->unmap_vertices(draw->render, 0, (uint16_t) (count - 1)); /* Draw arrays path to avoid re-emitting index list again and * again. @@ -247,7 +247,7 @@ static void fse_run(struct draw_pt_middle_end *middle, const unsigned *fetch_elts, unsigned fetch_count, - const ushort *draw_elts, + const uint16_t *draw_elts, unsigned draw_count, unsigned prim_flags) { @@ -260,8 +260,8 @@ fse_run(struct draw_pt_middle_end *middle, draw_do_flush(draw, DRAW_FLUSH_BACKEND); if (!draw->render->allocate_vertices(draw->render, - (ushort) fse->key.output_stride, - (ushort) fetch_count)) + (uint16_t) fse->key.output_stride, + (uint16_t) fetch_count)) goto fail; hw_verts = draw->render->map_vertices(draw->render); @@ -281,7 +281,7 @@ fse_run(struct draw_pt_middle_end *middle, } } - draw->render->unmap_vertices(draw->render, 0, (ushort)(fetch_count - 1)); + draw->render->unmap_vertices(draw->render, 0, (uint16_t)(fetch_count - 1)); draw->render->draw_elements(draw->render, draw_elts, draw_count); @@ -298,7 +298,7 @@ static bool fse_run_linear_elts(struct draw_pt_middle_end *middle, unsigned start, unsigned count, - const ushort *draw_elts, + const uint16_t *draw_elts, unsigned draw_count, unsigned prim_flags) { @@ -311,8 +311,8 @@ fse_run_linear_elts(struct draw_pt_middle_end *middle, draw_do_flush(draw, DRAW_FLUSH_BACKEND); if (!draw->render->allocate_vertices(draw->render, - (ushort) fse->key.output_stride, - (ushort) count)) + (uint16_t) fse->key.output_stride, + (uint16_t) count)) return false; hw_verts = draw->render->map_vertices(draw->render); @@ -327,7 +327,7 @@ fse_run_linear_elts(struct draw_pt_middle_end *middle, draw->render->draw_elements(draw->render, draw_elts, draw_count); - draw->render->unmap_vertices(draw->render, 0, (ushort)(count - 1)); + draw->render->unmap_vertices(draw->render, 0, (uint16_t)(count - 1)); draw->render->release_vertices(draw->render); diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c index 1ca4b07..a1791d9 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c @@ -378,7 +378,7 @@ static void fetch_pipeline_run(struct draw_pt_middle_end *middle, const unsigned *fetch_elts, unsigned fetch_count, - const ushort *draw_elts, + const uint16_t *draw_elts, unsigned draw_count, unsigned prim_flags) { @@ -436,7 +436,7 @@ static bool fetch_pipeline_linear_run_elts(struct draw_pt_middle_end *middle, unsigned start, unsigned count, - const ushort *draw_elts, + const uint16_t *draw_elts, unsigned draw_count, unsigned prim_flags) { diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c index 1650fa1..360aa8a 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c @@ -514,7 +514,7 @@ llvm_pipeline_generic(struct draw_pt_middle_end *middle, bool free_prim_info = false; unsigned opt = fpme->opt; bool clipped = 0; - ushort *tes_elts_out = NULL; + uint16_t *tes_elts_out = NULL; assert(fetch_info->count > 0); @@ -731,7 +731,7 @@ static void llvm_middle_end_run(struct draw_pt_middle_end *middle, const unsigned *fetch_elts, unsigned fetch_count, - const ushort *draw_elts, + const uint16_t *draw_elts, unsigned draw_count, unsigned prim_flags) { @@ -789,7 +789,7 @@ static bool llvm_middle_end_linear_run_elts(struct draw_pt_middle_end *middle, unsigned start, unsigned count, - const ushort *draw_elts, + const uint16_t *draw_elts, unsigned draw_count, unsigned prim_flags) { diff --git a/src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h b/src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h index 40a3ee1..5440a2e 100644 --- a/src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h +++ b/src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h @@ -39,7 +39,7 @@ CONCAT2(vsplit_primitive_, ELT_TYPE)(struct vsplit_frontend *vsplit, const unsigned max_index = draw->pt.user.max_index; const int elt_bias = draw->pt.user.eltBias; unsigned fetch_start, fetch_count; - const ushort *draw_elts = NULL; + const uint16_t *draw_elts = NULL; const unsigned start = istart; const unsigned end = istart + icount; @@ -60,7 +60,7 @@ CONCAT2(vsplit_primitive_, ELT_TYPE)(struct vsplit_frontend *vsplit, debug_printf("warning: index out of range\n"); } } - draw_elts = (const ushort *) (ib + istart); + draw_elts = (const uint16_t *) (ib + istart); } else { /* have to go through vsplit->draw_elts */ if (icount > vsplit->segment_size) @@ -95,7 +95,7 @@ CONCAT2(vsplit_primitive_, ELT_TYPE)(struct vsplit_frontend *vsplit, if (idx < min_index || idx > max_index) { debug_printf("warning: index out of range\n"); } - vsplit->draw_elts[i] = (ushort) idx; + vsplit->draw_elts[i] = (uint16_t) idx; } } else { for (unsigned i = 0; i < icount; i++) { @@ -104,7 +104,7 @@ CONCAT2(vsplit_primitive_, ELT_TYPE)(struct vsplit_frontend *vsplit, if (idx < min_index || idx > max_index) { debug_printf("warning: index out of range\n"); } - vsplit->draw_elts[i] = (ushort) (idx - min_index); + vsplit->draw_elts[i] = (uint16_t) (idx - min_index); } } diff --git a/src/gallium/auxiliary/draw/draw_tess.c b/src/gallium/auxiliary/draw/draw_tess.c index b93acc1..fcf013b 100644 --- a/src/gallium/auxiliary/draw/draw_tess.c +++ b/src/gallium/auxiliary/draw/draw_tess.c @@ -39,8 +39,8 @@ draw_tes_get_input_index(int semantic, int index, const struct tgsi_shader_info *input_info) { int i; - const ubyte *input_semantic_names = input_info->output_semantic_name; - const ubyte *input_semantic_indices = input_info->output_semantic_index; + const uint8_t *input_semantic_names = input_info->output_semantic_name; + const uint8_t *input_semantic_indices = input_info->output_semantic_index; for (i = 0; i < PIPE_MAX_SHADER_OUTPUTS; i++) { if (input_semantic_names[i] == semantic && input_semantic_indices[i] == index) @@ -324,13 +324,13 @@ int draw_tess_eval_shader_run(struct draw_tess_eval_shader *shader, const struct tgsi_shader_info *input_info, struct draw_vertex_info *output_verts, struct draw_prim_info *output_prims, - ushort **elts_out) + uint16_t **elts_out) { const float (*input)[4] = (const float (*)[4])input_verts->verts->data; unsigned num_outputs = draw_total_tes_outputs(shader->draw); unsigned input_stride = input_verts->vertex_size; unsigned vertex_size = sizeof(struct vertex_header) + num_outputs * 4 * sizeof(float); - ushort *elts = NULL; + uint16_t *elts = NULL; output_verts->vertex_size = vertex_size; output_verts->stride = output_verts->vertex_size; output_verts->count = 0; diff --git a/src/gallium/auxiliary/draw/draw_tess.h b/src/gallium/auxiliary/draw/draw_tess.h index 3c75e0c..af79f81 100644 --- a/src/gallium/auxiliary/draw/draw_tess.h +++ b/src/gallium/auxiliary/draw/draw_tess.h @@ -117,7 +117,7 @@ int draw_tess_eval_shader_run(struct draw_tess_eval_shader *shader, const struct tgsi_shader_info *input_info, struct draw_vertex_info *output_verts, struct draw_prim_info *output_prims, - ushort **elts_out); + uint16_t **elts_out); #ifdef DRAW_LLVM_AVAILABLE void draw_tcs_set_current_variant(struct draw_tess_ctrl_shader *shader, diff --git a/src/gallium/auxiliary/draw/draw_vbuf.h b/src/gallium/auxiliary/draw/draw_vbuf.h index fcbfc35..be8a5f4 100644 --- a/src/gallium/auxiliary/draw/draw_vbuf.h +++ b/src/gallium/auxiliary/draw/draw_vbuf.h @@ -83,13 +83,13 @@ struct vbuf_render { * something. */ bool (*allocate_vertices)(struct vbuf_render *, - ushort vertex_size, - ushort nr_vertices); + uint16_t vertex_size, + uint16_t nr_vertices); void *(*map_vertices)(struct vbuf_render *); void (*unmap_vertices)(struct vbuf_render *, - ushort min_index, - ushort max_index); + uint16_t min_index, + uint16_t max_index); /** * Notify the renderer of the current primitive when it changes. @@ -109,7 +109,7 @@ struct vbuf_render { * must complete this call, if necessary splitting the index list itself. */ void (*draw_elements)(struct vbuf_render *, - const ushort *indices, + const uint16_t *indices, unsigned nr_indices); /* Draw non-indexed primitives. diff --git a/src/gallium/auxiliary/indices/u_unfilled_indices.c b/src/gallium/auxiliary/indices/u_unfilled_indices.c index 1b45186..6575236 100644 --- a/src/gallium/auxiliary/indices/u_unfilled_indices.c +++ b/src/gallium/auxiliary/indices/u_unfilled_indices.c @@ -40,21 +40,21 @@ static void translate_ubyte_ushort( const void *in, unsigned restart_index, void *out ) { - const ubyte *in_ub = (const ubyte *)in; - ushort *out_us = (ushort *)out; + const uint8_t *in_ub = (const uint8_t *)in; + uint16_t *out_us = (uint16_t *)out; unsigned i; for (i = 0; i < out_nr; i++) - out_us[i] = (ushort) in_ub[i+start]; + out_us[i] = (uint16_t) in_ub[i+start]; } static void generate_linear_ushort( unsigned start, unsigned nr, void *out ) { - ushort *out_us = (ushort *)out; + uint16_t *out_us = (uint16_t *)out; unsigned i; for (i = 0; i < nr; i++) - out_us[i] = (ushort)(i + start); + out_us[i] = (uint16_t)(i + start); } static void generate_linear_uint( unsigned start, diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c index 098f886..1926a34 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c @@ -613,7 +613,7 @@ void nir_tgsi_scan_shader(const struct nir_shader *nir, } } - ubyte usagemask = 0; + uint8_t usagemask = 0; for (unsigned j = component; j < num_components + component; j++) { switch (j) { case 0: diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index 3c55e38..75b63d4 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -666,10 +666,10 @@ scan_declaration(struct tgsi_shader_info *info, break; case TGSI_FILE_INPUT: - info->input_semantic_name[reg] = (ubyte) semName; - info->input_semantic_index[reg] = (ubyte) semIndex; - info->input_interpolate[reg] = (ubyte)fulldecl->Interp.Interpolate; - info->input_interpolate_loc[reg] = (ubyte)fulldecl->Interp.Location; + info->input_semantic_name[reg] = (uint8_t) semName; + info->input_semantic_index[reg] = (uint8_t) semIndex; + info->input_interpolate[reg] = (uint8_t)fulldecl->Interp.Interpolate; + info->input_interpolate_loc[reg] = (uint8_t)fulldecl->Interp.Location; /* Vertex shaders can have inputs with holes between them. */ info->num_inputs = MAX2(info->num_inputs, reg + 1); @@ -732,25 +732,25 @@ scan_declaration(struct tgsi_shader_info *info, break; case TGSI_FILE_OUTPUT: - info->output_semantic_name[reg] = (ubyte) semName; - info->output_semantic_index[reg] = (ubyte) semIndex; + info->output_semantic_name[reg] = (uint8_t) semName; + info->output_semantic_index[reg] = (uint8_t) semIndex; info->output_usagemask[reg] |= fulldecl->Declaration.UsageMask; info->num_outputs = MAX2(info->num_outputs, reg + 1); if (fulldecl->Declaration.UsageMask & TGSI_WRITEMASK_X) { - info->output_streams[reg] |= (ubyte)fulldecl->Semantic.StreamX; + info->output_streams[reg] |= (uint8_t)fulldecl->Semantic.StreamX; info->num_stream_output_components[fulldecl->Semantic.StreamX]++; } if (fulldecl->Declaration.UsageMask & TGSI_WRITEMASK_Y) { - info->output_streams[reg] |= (ubyte)fulldecl->Semantic.StreamY << 2; + info->output_streams[reg] |= (uint8_t)fulldecl->Semantic.StreamY << 2; info->num_stream_output_components[fulldecl->Semantic.StreamY]++; } if (fulldecl->Declaration.UsageMask & TGSI_WRITEMASK_Z) { - info->output_streams[reg] |= (ubyte)fulldecl->Semantic.StreamZ << 4; + info->output_streams[reg] |= (uint8_t)fulldecl->Semantic.StreamZ << 4; info->num_stream_output_components[fulldecl->Semantic.StreamZ]++; } if (fulldecl->Declaration.UsageMask & TGSI_WRITEMASK_W) { - info->output_streams[reg] |= (ubyte)fulldecl->Semantic.StreamW << 6; + info->output_streams[reg] |= (uint8_t)fulldecl->Semantic.StreamW << 6; info->num_stream_output_components[fulldecl->Semantic.StreamW]++; } diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h index 0ec81bf..3ee6349 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h @@ -44,22 +44,22 @@ struct tgsi_shader_info { uint num_tokens; - ubyte num_inputs; - ubyte num_outputs; - ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS]; /**< TGSI_SEMANTIC_x */ - ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS]; - ubyte input_interpolate[PIPE_MAX_SHADER_INPUTS]; - ubyte input_interpolate_loc[PIPE_MAX_SHADER_INPUTS]; - ubyte input_usage_mask[PIPE_MAX_SHADER_INPUTS]; - ubyte output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; /**< TGSI_SEMANTIC_x */ - ubyte output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; - ubyte output_usagemask[PIPE_MAX_SHADER_OUTPUTS]; - ubyte output_streams[PIPE_MAX_SHADER_OUTPUTS]; - - ubyte num_system_values; - ubyte system_value_semantic_name[PIPE_MAX_SHADER_INPUTS]; - - ubyte processor; + uint8_t num_inputs; + uint8_t num_outputs; + uint8_t input_semantic_name[PIPE_MAX_SHADER_INPUTS]; /**< TGSI_SEMANTIC_x */ + uint8_t input_semantic_index[PIPE_MAX_SHADER_INPUTS]; + uint8_t input_interpolate[PIPE_MAX_SHADER_INPUTS]; + uint8_t input_interpolate_loc[PIPE_MAX_SHADER_INPUTS]; + uint8_t input_usage_mask[PIPE_MAX_SHADER_INPUTS]; + uint8_t output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; /**< TGSI_SEMANTIC_x */ + uint8_t output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t output_usagemask[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t output_streams[PIPE_MAX_SHADER_OUTPUTS]; + + uint8_t num_system_values; + uint8_t system_value_semantic_name[PIPE_MAX_SHADER_INPUTS]; + + uint8_t processor; uint file_mask[TGSI_FILE_COUNT]; /**< bitmask of declared registers */ uint file_count[TGSI_FILE_COUNT]; /**< number of declared registers */ @@ -67,12 +67,12 @@ struct tgsi_shader_info int const_file_max[PIPE_MAX_CONSTANT_BUFFERS]; unsigned const_buffers_declared; /**< bitmask of declared const buffers */ unsigned samplers_declared; /**< bitmask of declared samplers */ - ubyte sampler_targets[PIPE_MAX_SHADER_SAMPLER_VIEWS]; /**< TGSI_TEXTURE_x values */ - ubyte sampler_type[PIPE_MAX_SHADER_SAMPLER_VIEWS]; /**< TGSI_RETURN_TYPE_x */ - ubyte num_stream_output_components[4]; + uint8_t sampler_targets[PIPE_MAX_SHADER_SAMPLER_VIEWS]; /**< TGSI_TEXTURE_x values */ + uint8_t sampler_type[PIPE_MAX_SHADER_SAMPLER_VIEWS]; /**< TGSI_RETURN_TYPE_x */ + uint8_t num_stream_output_components[4]; - ubyte input_array_first[PIPE_MAX_SHADER_INPUTS]; - ubyte output_array_first[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t input_array_first[PIPE_MAX_SHADER_INPUTS]; + uint8_t output_array_first[PIPE_MAX_SHADER_OUTPUTS]; unsigned array_max[TGSI_FILE_COUNT]; /**< highest index array per register file */ uint immediate_count; /**< number of immediates declared */ @@ -88,8 +88,8 @@ struct tgsi_shader_info bool reads_perpatch_outputs; bool reads_tessfactor_outputs; - ubyte colors_read; /**< which color components are read by the FS */ - ubyte colors_written; + uint8_t colors_read; /**< which color components are read by the FS */ + uint8_t colors_written; bool reads_position; /**< does fragment shader read position? */ bool reads_z; /**< does fragment shader read depth? */ bool reads_samplemask; /**< does fragment shader read sample mask? */ diff --git a/src/gallium/auxiliary/translate/translate_generic.c b/src/gallium/auxiliary/translate/translate_generic.c index 93b5006..7caac5a 100644 --- a/src/gallium/auxiliary/translate/translate_generic.c +++ b/src/gallium/auxiliary/translate/translate_generic.c @@ -142,10 +142,10 @@ ATTRIB(R32G32B32_FLOAT, 3, float, float, TO_32_FLOAT) ATTRIB(R32G32_FLOAT, 2, float, float, TO_32_FLOAT) ATTRIB(R32_FLOAT, 1, float, float, TO_32_FLOAT) -ATTRIB(R16G16B16A16_FLOAT, 4, float, ushort, TO_16_FLOAT) -ATTRIB(R16G16B16_FLOAT, 3, float, ushort, TO_16_FLOAT) -ATTRIB(R16G16_FLOAT, 2, float, ushort, TO_16_FLOAT) -ATTRIB(R16_FLOAT, 1, float, ushort, TO_16_FLOAT) +ATTRIB(R16G16B16A16_FLOAT, 4, float, uint16_t, TO_16_FLOAT) +ATTRIB(R16G16B16_FLOAT, 3, float, uint16_t, TO_16_FLOAT) +ATTRIB(R16G16_FLOAT, 2, float, uint16_t, TO_16_FLOAT) +ATTRIB(R16_FLOAT, 1, float, uint16_t, TO_16_FLOAT) ATTRIB(R32G32B32A32_USCALED, 4, float, unsigned, TO_32_USCALED) ATTRIB(R32G32B32_USCALED, 3, float, unsigned, TO_32_USCALED) @@ -167,40 +167,40 @@ ATTRIB(R32G32B32_SNORM, 3, float, int, TO_32_SNORM) ATTRIB(R32G32_SNORM, 2, float, int, TO_32_SNORM) ATTRIB(R32_SNORM, 1, float, int, TO_32_SNORM) -ATTRIB(R16G16B16A16_USCALED, 4, float, ushort, TO_16_USCALED) -ATTRIB(R16G16B16_USCALED, 3, float, ushort, TO_16_USCALED) -ATTRIB(R16G16_USCALED, 2, float, ushort, TO_16_USCALED) -ATTRIB(R16_USCALED, 1, float, ushort, TO_16_USCALED) +ATTRIB(R16G16B16A16_USCALED, 4, float, uint16_t, TO_16_USCALED) +ATTRIB(R16G16B16_USCALED, 3, float, uint16_t, TO_16_USCALED) +ATTRIB(R16G16_USCALED, 2, float, uint16_t, TO_16_USCALED) +ATTRIB(R16_USCALED, 1, float, uint16_t, TO_16_USCALED) ATTRIB(R16G16B16A16_SSCALED, 4, float, short, TO_16_SSCALED) ATTRIB(R16G16B16_SSCALED, 3, float, short, TO_16_SSCALED) ATTRIB(R16G16_SSCALED, 2, float, short, TO_16_SSCALED) ATTRIB(R16_SSCALED, 1, float, short, TO_16_SSCALED) -ATTRIB(R16G16B16A16_UNORM, 4, float, ushort, TO_16_UNORM) -ATTRIB(R16G16B16_UNORM, 3, float, ushort, TO_16_UNORM) -ATTRIB(R16G16_UNORM, 2, float, ushort, TO_16_UNORM) -ATTRIB(R16_UNORM, 1, float, ushort, TO_16_UNORM) +ATTRIB(R16G16B16A16_UNORM, 4, float, uint16_t, TO_16_UNORM) +ATTRIB(R16G16B16_UNORM, 3, float, uint16_t, TO_16_UNORM) +ATTRIB(R16G16_UNORM, 2, float, uint16_t, TO_16_UNORM) +ATTRIB(R16_UNORM, 1, float, uint16_t, TO_16_UNORM) ATTRIB(R16G16B16A16_SNORM, 4, float, short, TO_16_SNORM) ATTRIB(R16G16B16_SNORM, 3, float, short, TO_16_SNORM) ATTRIB(R16G16_SNORM, 2, float, short, TO_16_SNORM) ATTRIB(R16_SNORM, 1, float, short, TO_16_SNORM) -ATTRIB(R8G8B8A8_USCALED, 4, float, ubyte, TO_8_USCALED) -ATTRIB(R8G8B8_USCALED, 3, float, ubyte, TO_8_USCALED) -ATTRIB(R8G8_USCALED, 2, float, ubyte, TO_8_USCALED) -ATTRIB(R8_USCALED, 1, float, ubyte, TO_8_USCALED) +ATTRIB(R8G8B8A8_USCALED, 4, float, uint8_t, TO_8_USCALED) +ATTRIB(R8G8B8_USCALED, 3, float, uint8_t, TO_8_USCALED) +ATTRIB(R8G8_USCALED, 2, float, uint8_t, TO_8_USCALED) +ATTRIB(R8_USCALED, 1, float, uint8_t, TO_8_USCALED) ATTRIB(R8G8B8A8_SSCALED, 4, float, char, TO_8_SSCALED) ATTRIB(R8G8B8_SSCALED, 3, float, char, TO_8_SSCALED) ATTRIB(R8G8_SSCALED, 2, float, char, TO_8_SSCALED) ATTRIB(R8_SSCALED, 1, float, char, TO_8_SSCALED) -ATTRIB(R8G8B8A8_UNORM, 4, float, ubyte, TO_8_UNORM) -ATTRIB(R8G8B8_UNORM, 3, float, ubyte, TO_8_UNORM) -ATTRIB(R8G8_UNORM, 2, float, ubyte, TO_8_UNORM) -ATTRIB(R8_UNORM, 1, float, ubyte, TO_8_UNORM) +ATTRIB(R8G8B8A8_UNORM, 4, float, uint8_t, TO_8_UNORM) +ATTRIB(R8G8B8_UNORM, 3, float, uint8_t, TO_8_UNORM) +ATTRIB(R8G8_UNORM, 2, float, uint8_t, TO_8_UNORM) +ATTRIB(R8_UNORM, 1, float, uint8_t, TO_8_UNORM) ATTRIB(R8G8B8A8_SNORM, 4, float, char, TO_8_SNORM) ATTRIB(R8G8B8_SNORM, 3, float, char, TO_8_SNORM) @@ -212,15 +212,15 @@ ATTRIB(R32G32B32_UINT, 3, uint32_t, unsigned, TO_INT) ATTRIB(R32G32_UINT, 2, uint32_t, unsigned, TO_INT) ATTRIB(R32_UINT, 1, uint32_t, unsigned, TO_INT) -ATTRIB(R16G16B16A16_UINT, 4, uint32_t, ushort, TO_INT) -ATTRIB(R16G16B16_UINT, 3, uint32_t, ushort, TO_INT) -ATTRIB(R16G16_UINT, 2, uint32_t, ushort, TO_INT) -ATTRIB(R16_UINT, 1, uint32_t, ushort, TO_INT) +ATTRIB(R16G16B16A16_UINT, 4, uint32_t, uint16_t, TO_INT) +ATTRIB(R16G16B16_UINT, 3, uint32_t, uint16_t, TO_INT) +ATTRIB(R16G16_UINT, 2, uint32_t, uint16_t, TO_INT) +ATTRIB(R16_UINT, 1, uint32_t, uint16_t, TO_INT) -ATTRIB(R8G8B8A8_UINT, 4, uint32_t, ubyte, TO_INT) -ATTRIB(R8G8B8_UINT, 3, uint32_t, ubyte, TO_INT) -ATTRIB(R8G8_UINT, 2, uint32_t, ubyte, TO_INT) -ATTRIB(R8_UINT, 1, uint32_t, ubyte, TO_INT) +ATTRIB(R8G8B8A8_UINT, 4, uint32_t, uint8_t, TO_INT) +ATTRIB(R8G8B8_UINT, 3, uint32_t, uint8_t, TO_INT) +ATTRIB(R8G8_UINT, 2, uint32_t, uint8_t, TO_INT) +ATTRIB(R8_UINT, 1, uint32_t, uint8_t, TO_INT) ATTRIB(R32G32B32A32_SINT, 4, int32_t, int, TO_INT) ATTRIB(R32G32B32_SINT, 3, int32_t, int, TO_INT) @@ -241,7 +241,7 @@ static void emit_A8R8G8B8_UNORM(const void *attrib, void *ptr) { float *in = (float *)attrib; - ubyte *out = (ubyte *)ptr; + uint8_t *out = (uint8_t *)ptr; out[0] = TO_8_UNORM(in[3]); out[1] = TO_8_UNORM(in[0]); out[2] = TO_8_UNORM(in[1]); @@ -252,7 +252,7 @@ static void emit_B8G8R8A8_UNORM(const void *attrib, void *ptr) { float *in = (float *)attrib; - ubyte *out = (ubyte *)ptr; + uint8_t *out = (uint8_t *)ptr; out[2] = TO_8_UNORM(in[0]); out[1] = TO_8_UNORM(in[1]); out[0] = TO_8_UNORM(in[2]); diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index ec71bf7..68b0ce3 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -743,7 +743,7 @@ void util_blitter_restore_fragment_states(struct blitter_context *blitter) static void blitter_check_saved_fb_state(ASSERTED struct blitter_context_priv *ctx) { - assert(ctx->base.saved_fb_state.nr_cbufs != (ubyte) ~0); + assert(ctx->base.saved_fb_state.nr_cbufs != (uint8_t) ~0); } static void blitter_disable_render_cond(struct blitter_context_priv *ctx) diff --git a/src/gallium/auxiliary/util/u_debug_image.c b/src/gallium/auxiliary/util/u_debug_image.c index fd0513f..d560a32 100644 --- a/src/gallium/auxiliary/util/u_debug_image.c +++ b/src/gallium/auxiliary/util/u_debug_image.c @@ -291,7 +291,7 @@ error1: void debug_dump_ubyte_rgba_bmp(const char *filename, unsigned width, unsigned height, - const ubyte *rgba, unsigned stride) + const uint8_t *rgba, unsigned stride) { FILE *stream; struct bmp_file_header bmfh; @@ -330,7 +330,7 @@ debug_dump_ubyte_rgba_bmp(const char *filename, y = height; while (y--) { - const ubyte *ptr = rgba + (stride * y * 4); + const uint8_t *ptr = rgba + (stride * y * 4); for (x = 0; x < width; ++x) { struct bmp_rgb_quad pixel; pixel.rgbRed = ptr[x*4 + 0]; diff --git a/src/gallium/auxiliary/util/u_debug_image.h b/src/gallium/auxiliary/util/u_debug_image.h index d687dae..03a5e5d 100644 --- a/src/gallium/auxiliary/util/u_debug_image.h +++ b/src/gallium/auxiliary/util/u_debug_image.h @@ -60,7 +60,7 @@ void debug_dump_float_rgba_bmp(const char *filename, float *rgba, unsigned stride); void debug_dump_ubyte_rgba_bmp(const char *filename, unsigned width, unsigned height, - const ubyte *rgba, unsigned stride); + const uint8_t *rgba, unsigned stride); #else #define debug_dump_image(prefix, format, cpp, width, height, stride, data) ((void)0) #define debug_dump_surface(pipe, prefix, surface) ((void)0) diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 39b82cf..439e578 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -526,9 +526,9 @@ pipe_buffer_read(struct pipe_context *pipe, void *data) { struct pipe_transfer *src_transfer; - ubyte *map; + uint8_t *map; - map = (ubyte *) pipe_buffer_map_range(pipe, + map = (uint8_t *) pipe_buffer_map_range(pipe, buf, offset, size, PIPE_MAP_READ, diff --git a/src/gallium/auxiliary/util/u_pack_color.h b/src/gallium/auxiliary/util/u_pack_color.h index 955bdcf..1b0a6a2 100644 --- a/src/gallium/auxiliary/util/u_pack_color.h +++ b/src/gallium/auxiliary/util/u_pack_color.h @@ -48,10 +48,10 @@ * Must be big enough to hold data for all formats (currently 256 bits). */ union util_color { - ubyte ub; - ushort us; + uint8_t ub; + uint16_t us; uint ui[4]; - ushort h[4]; /* half float */ + uint16_t h[4]; /* half float */ float f[4]; double d[4]; }; @@ -60,7 +60,7 @@ union util_color { * Pack ubyte R,G,B,A into dest pixel. */ static inline void -util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a, +util_pack_color_ub(uint8_t r, uint8_t g, uint8_t b, uint8_t a, enum pipe_format format, union util_color *uc) { switch (format) { @@ -145,7 +145,7 @@ util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a, */ default: { - ubyte src[4]; + uint8_t src[4]; src[0] = r; src[1] = g; @@ -162,116 +162,116 @@ util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a, */ static inline void util_unpack_color_ub(enum pipe_format format, union util_color *uc, - ubyte *r, ubyte *g, ubyte *b, ubyte *a) + uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *a) { switch (format) { case PIPE_FORMAT_ABGR8888_UNORM: { uint p = uc->ui[0]; - *r = (ubyte) ((p >> 24) & 0xff); - *g = (ubyte) ((p >> 16) & 0xff); - *b = (ubyte) ((p >> 8) & 0xff); - *a = (ubyte) ((p >> 0) & 0xff); + *r = (uint8_t) ((p >> 24) & 0xff); + *g = (uint8_t) ((p >> 16) & 0xff); + *b = (uint8_t) ((p >> 8) & 0xff); + *a = (uint8_t) ((p >> 0) & 0xff); } return; case PIPE_FORMAT_XBGR8888_UNORM: { uint p = uc->ui[0]; - *r = (ubyte) ((p >> 24) & 0xff); - *g = (ubyte) ((p >> 16) & 0xff); - *b = (ubyte) ((p >> 8) & 0xff); - *a = (ubyte) 0xff; + *r = (uint8_t) ((p >> 24) & 0xff); + *g = (uint8_t) ((p >> 16) & 0xff); + *b = (uint8_t) ((p >> 8) & 0xff); + *a = (uint8_t) 0xff; } return; case PIPE_FORMAT_BGRA8888_UNORM: { uint p = uc->ui[0]; - *r = (ubyte) ((p >> 16) & 0xff); - *g = (ubyte) ((p >> 8) & 0xff); - *b = (ubyte) ((p >> 0) & 0xff); - *a = (ubyte) ((p >> 24) & 0xff); + *r = (uint8_t) ((p >> 16) & 0xff); + *g = (uint8_t) ((p >> 8) & 0xff); + *b = (uint8_t) ((p >> 0) & 0xff); + *a = (uint8_t) ((p >> 24) & 0xff); } return; case PIPE_FORMAT_BGRX8888_UNORM: { uint p = uc->ui[0]; - *r = (ubyte) ((p >> 16) & 0xff); - *g = (ubyte) ((p >> 8) & 0xff); - *b = (ubyte) ((p >> 0) & 0xff); - *a = (ubyte) 0xff; + *r = (uint8_t) ((p >> 16) & 0xff); + *g = (uint8_t) ((p >> 8) & 0xff); + *b = (uint8_t) ((p >> 0) & 0xff); + *a = (uint8_t) 0xff; } return; case PIPE_FORMAT_ARGB8888_UNORM: { uint p = uc->ui[0]; - *r = (ubyte) ((p >> 8) & 0xff); - *g = (ubyte) ((p >> 16) & 0xff); - *b = (ubyte) ((p >> 24) & 0xff); - *a = (ubyte) ((p >> 0) & 0xff); + *r = (uint8_t) ((p >> 8) & 0xff); + *g = (uint8_t) ((p >> 16) & 0xff); + *b = (uint8_t) ((p >> 24) & 0xff); + *a = (uint8_t) ((p >> 0) & 0xff); } return; case PIPE_FORMAT_XRGB8888_UNORM: { uint p = uc->ui[0]; - *r = (ubyte) ((p >> 8) & 0xff); - *g = (ubyte) ((p >> 16) & 0xff); - *b = (ubyte) ((p >> 24) & 0xff); - *a = (ubyte) 0xff; + *r = (uint8_t) ((p >> 8) & 0xff); + *g = (uint8_t) ((p >> 16) & 0xff); + *b = (uint8_t) ((p >> 24) & 0xff); + *a = (uint8_t) 0xff; } return; case PIPE_FORMAT_B5G6R5_UNORM: { - ushort p = uc->us; - *r = (ubyte) (((p >> 8) & 0xf8) | ((p >> 13) & 0x7)); - *g = (ubyte) (((p >> 3) & 0xfc) | ((p >> 9) & 0x3)); - *b = (ubyte) (((p << 3) & 0xf8) | ((p >> 2) & 0x7)); - *a = (ubyte) 0xff; + uint16_t p = uc->us; + *r = (uint8_t) (((p >> 8) & 0xf8) | ((p >> 13) & 0x7)); + *g = (uint8_t) (((p >> 3) & 0xfc) | ((p >> 9) & 0x3)); + *b = (uint8_t) (((p << 3) & 0xf8) | ((p >> 2) & 0x7)); + *a = (uint8_t) 0xff; } return; case PIPE_FORMAT_B5G5R5X1_UNORM: { - ushort p = uc->us; - *r = (ubyte) (((p >> 7) & 0xf8) | ((p >> 12) & 0x7)); - *g = (ubyte) (((p >> 2) & 0xf8) | ((p >> 7) & 0x7)); - *b = (ubyte) (((p << 3) & 0xf8) | ((p >> 2) & 0x7)); - *a = (ubyte) 0xff; + uint16_t p = uc->us; + *r = (uint8_t) (((p >> 7) & 0xf8) | ((p >> 12) & 0x7)); + *g = (uint8_t) (((p >> 2) & 0xf8) | ((p >> 7) & 0x7)); + *b = (uint8_t) (((p << 3) & 0xf8) | ((p >> 2) & 0x7)); + *a = (uint8_t) 0xff; } return; case PIPE_FORMAT_B5G5R5A1_UNORM: { - ushort p = uc->us; - *r = (ubyte) (((p >> 7) & 0xf8) | ((p >> 12) & 0x7)); - *g = (ubyte) (((p >> 2) & 0xf8) | ((p >> 7) & 0x7)); - *b = (ubyte) (((p << 3) & 0xf8) | ((p >> 2) & 0x7)); - *a = (ubyte) (0xff * (p >> 15)); + uint16_t p = uc->us; + *r = (uint8_t) (((p >> 7) & 0xf8) | ((p >> 12) & 0x7)); + *g = (uint8_t) (((p >> 2) & 0xf8) | ((p >> 7) & 0x7)); + *b = (uint8_t) (((p << 3) & 0xf8) | ((p >> 2) & 0x7)); + *a = (uint8_t) (0xff * (p >> 15)); } return; case PIPE_FORMAT_B4G4R4A4_UNORM: { - ushort p = uc->us; - *r = (ubyte) (((p >> 4) & 0xf0) | ((p >> 8) & 0xf)); - *g = (ubyte) (((p >> 0) & 0xf0) | ((p >> 4) & 0xf)); - *b = (ubyte) (((p << 4) & 0xf0) | ((p >> 0) & 0xf)); - *a = (ubyte) (((p >> 8) & 0xf0) | ((p >> 12) & 0xf)); + uint16_t p = uc->us; + *r = (uint8_t) (((p >> 4) & 0xf0) | ((p >> 8) & 0xf)); + *g = (uint8_t) (((p >> 0) & 0xf0) | ((p >> 4) & 0xf)); + *b = (uint8_t) (((p << 4) & 0xf0) | ((p >> 0) & 0xf)); + *a = (uint8_t) (((p >> 8) & 0xf0) | ((p >> 12) & 0xf)); } return; case PIPE_FORMAT_A8_UNORM: { - ubyte p = uc->ub; - *r = *g = *b = (ubyte) 0xff; + uint8_t p = uc->ub; + *r = *g = *b = (uint8_t) 0xff; *a = p; } return; case PIPE_FORMAT_L8_UNORM: { - ubyte p = uc->ub; + uint8_t p = uc->ub; *r = *g = *b = p; - *a = (ubyte) 0xff; + *a = (uint8_t) 0xff; } return; case PIPE_FORMAT_I8_UNORM: { - ubyte p = uc->ub; + uint8_t p = uc->ub; *r = *g = *b = *a = p; } return; @@ -290,7 +290,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, *r = float_to_ubyte(p[0]); *g = float_to_ubyte(p[1]); *b = float_to_ubyte(p[2]); - *a = (ubyte) 0xff; + *a = (uint8_t) 0xff; } return; @@ -299,7 +299,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, const float *p = &uc->f[0]; *r = float_to_ubyte(p[0]); *g = float_to_ubyte(p[1]); - *b = *a = (ubyte) 0xff; + *b = *a = (uint8_t) 0xff; } return; @@ -307,7 +307,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, { const float *p = &uc->f[0]; *r = float_to_ubyte(p[0]); - *g = *b = *a = (ubyte) 0xff; + *g = *b = *a = (uint8_t) 0xff; } return; @@ -315,7 +315,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, */ default: { - ubyte dst[4]; + uint8_t dst[4]; util_format_read_4ub(format, dst, 0, uc, 0, 0, 0, 1, 1); *r = dst[0]; @@ -335,10 +335,10 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, static inline void util_pack_color(const float rgba[4], enum pipe_format format, union util_color *uc) { - ubyte r = 0; - ubyte g = 0; - ubyte b = 0; - ubyte a = 0; + uint8_t r = 0; + uint8_t g = 0; + uint8_t b = 0; + uint8_t a = 0; if (util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 0) <= 8) { /* format uses 8-bit components or less */ @@ -636,7 +636,7 @@ util_pack64_z_stencil(enum pipe_format format, double z, uint8_t s) * Pack 4 ubytes into a 4-byte word */ static inline unsigned -pack_ub4(ubyte b0, ubyte b1, ubyte b2, ubyte b3) +pack_ub4(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3) { return ((((unsigned int)b0) << 0) | (((unsigned int)b1) << 8) | diff --git a/src/gallium/auxiliary/util/u_pstipple.c b/src/gallium/auxiliary/util/u_pstipple.c index 8d44a2f..39c6e4b 100644 --- a/src/gallium/auxiliary/util/u_pstipple.c +++ b/src/gallium/auxiliary/util/u_pstipple.c @@ -65,7 +65,7 @@ util_pstipple_update_stipple_texture(struct pipe_context *pipe, { static const uint bit31 = 1u << 31; struct pipe_transfer *transfer; - ubyte *data; + uint8_t *data; int i, j; /* map texture memory */ diff --git a/src/gallium/auxiliary/util/u_pwr8.h b/src/gallium/auxiliary/util/u_pwr8.h index 7eb52ef..fbcf577 100644 --- a/src/gallium/auxiliary/util/u_pwr8.h +++ b/src/gallium/auxiliary/util/u_pwr8.h @@ -42,8 +42,8 @@ typedef VECTOR_ALIGN_16 union m128i { __m128i m128i; vector signed int m128si; vector unsigned int m128ui; - ubyte ub[16]; - ushort us[8]; + uint8_t ub[16]; + uint16_t us[8]; int i[4]; uint ui[4]; } __m128i_union; diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c index 49ec9f3..79fb7b9 100644 --- a/src/gallium/auxiliary/util/u_simple_shaders.c +++ b/src/gallium/auxiliary/util/u_simple_shaders.c @@ -914,8 +914,8 @@ util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe, void * util_make_geometry_passthrough_shader(struct pipe_context *pipe, uint num_attribs, - const ubyte *semantic_names, - const ubyte *semantic_indexes) + const uint8_t *semantic_names, + const uint8_t *semantic_indexes) { static const unsigned zero[4] = {0, 0, 0, 0}; @@ -1134,10 +1134,10 @@ void * util_make_tess_ctrl_passthrough_shader(struct pipe_context *pipe, uint num_vs_outputs, uint num_tes_inputs, - const ubyte *vs_semantic_names, - const ubyte *vs_semantic_indexes, - const ubyte *tes_semantic_names, - const ubyte *tes_semantic_indexes, + const uint8_t *vs_semantic_names, + const uint8_t *vs_semantic_indexes, + const uint8_t *tes_semantic_names, + const uint8_t *tes_semantic_indexes, const unsigned vertices_per_patch) { unsigned i, j; diff --git a/src/gallium/auxiliary/util/u_simple_shaders.h b/src/gallium/auxiliary/util/u_simple_shaders.h index 81c423d..daecca0 100644 --- a/src/gallium/auxiliary/util/u_simple_shaders.h +++ b/src/gallium/auxiliary/util/u_simple_shaders.h @@ -138,8 +138,8 @@ util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe, extern void * util_make_geometry_passthrough_shader(struct pipe_context *pipe, uint num_attribs, - const ubyte *semantic_names, - const ubyte *semantic_indexes); + const uint8_t *semantic_names, + const uint8_t *semantic_indexes); void * util_make_fs_pack_color_zs(struct pipe_context *pipe, @@ -151,10 +151,10 @@ extern void * util_make_tess_ctrl_passthrough_shader(struct pipe_context *pipe, uint num_vs_outputs, uint num_tes_inputs, - const ubyte *vs_semantic_names, - const ubyte *vs_semantic_indexes, - const ubyte *tes_semantic_names, - const ubyte *tes_semantic_indexes, + const uint8_t *vs_semantic_names, + const uint8_t *vs_semantic_indexes, + const uint8_t *tes_semantic_names, + const uint8_t *tes_semantic_indexes, const unsigned vertices_per_patch); void * diff --git a/src/gallium/auxiliary/util/u_sse.h b/src/gallium/auxiliary/util/u_sse.h index 4566a2d..5d44547 100644 --- a/src/gallium/auxiliary/util/u_sse.h +++ b/src/gallium/auxiliary/util/u_sse.h @@ -48,8 +48,8 @@ union m128i { __m128i m; - ubyte ub[16]; - ushort us[8]; + uint8_t ub[16]; + uint16_t us[8]; uint ui[4]; }; diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index 29c1dd9..5d3ac0c 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -62,12 +62,12 @@ u_surface_default_template(struct pipe_surface *surf, * Position and sizes are in pixels. */ void -util_copy_box(ubyte * dst, +util_copy_box(uint8_t * dst, enum pipe_format format, unsigned dst_stride, uint64_t dst_slice_stride, unsigned dst_x, unsigned dst_y, unsigned dst_z, unsigned width, unsigned height, unsigned depth, - const ubyte * src, + const uint8_t * src, int src_stride, uint64_t src_slice_stride, unsigned src_x, unsigned src_y, unsigned src_z) { @@ -91,7 +91,7 @@ util_copy_box(ubyte * dst, void -util_fill_rect(ubyte * dst, +util_fill_rect(uint8_t * dst, enum pipe_format format, unsigned dst_stride, unsigned dst_x, @@ -153,7 +153,7 @@ util_fill_rect(ubyte * dst, break; default: for (i = 0; i < height; i++) { - ubyte *row = dst; + uint8_t *row = dst; for (j = 0; j < width; j++) { memcpy(row, uc, blocksize); row += blocksize; @@ -166,7 +166,7 @@ util_fill_rect(ubyte * dst, void -util_fill_box(ubyte * dst, +util_fill_box(uint8_t * dst, enum pipe_format format, unsigned stride, uintptr_t layer_stride, @@ -360,7 +360,7 @@ util_resource_copy_region(struct pipe_context *pipe, static void util_clear_color_texture_helper(struct pipe_transfer *dst_trans, - ubyte *dst_map, + uint8_t *dst_map, enum pipe_format format, const union pipe_color_union *color, unsigned width, unsigned height, unsigned depth) @@ -386,7 +386,7 @@ util_clear_color_texture(struct pipe_context *pipe, unsigned width, unsigned height, unsigned depth) { struct pipe_transfer *dst_trans; - ubyte *dst_map; + uint8_t *dst_map; dst_map = pipe_texture_map_3d(pipe, texture, @@ -425,7 +425,7 @@ util_clear_render_target(struct pipe_context *pipe, unsigned width, unsigned height) { struct pipe_transfer *dst_trans; - ubyte *dst_map; + uint8_t *dst_map; assert(dst->texture); if (!dst->texture) @@ -461,7 +461,7 @@ util_clear_render_target(struct pipe_context *pipe, } static void -util_fill_zs_rect(ubyte *dst_map, +util_fill_zs_rect(uint8_t *dst_map, enum pipe_format format, bool need_rmw, unsigned clear_flags, @@ -551,7 +551,7 @@ util_fill_zs_rect(ubyte *dst_map, } void -util_fill_zs_box(ubyte *dst, +util_fill_zs_box(uint8_t *dst, enum pipe_format format, bool need_rmw, unsigned clear_flags, @@ -581,7 +581,7 @@ util_clear_depth_stencil_texture(struct pipe_context *pipe, unsigned width, unsigned height, unsigned depth) { struct pipe_transfer *dst_trans; - ubyte *dst_map; + uint8_t *dst_map; bool need_rmw = false; if ((clear_flags & PIPE_CLEAR_DEPTHSTENCIL) && diff --git a/src/gallium/auxiliary/util/u_surface.h b/src/gallium/auxiliary/util/u_surface.h index 3cbb4bf..e534005 100644 --- a/src/gallium/auxiliary/util/u_surface.h +++ b/src/gallium/auxiliary/util/u_surface.h @@ -45,29 +45,29 @@ u_surface_default_template(struct pipe_surface *view, const struct pipe_resource *texture); extern void -util_copy_box(ubyte * dst, +util_copy_box(uint8_t * dst, enum pipe_format format, unsigned dst_stride, uint64_t dst_slice_stride, unsigned dst_x, unsigned dst_y, unsigned dst_z, unsigned width, unsigned height, unsigned depth, - const ubyte * src, + const uint8_t * src, int src_stride, uint64_t src_slice_stride, unsigned src_x, unsigned src_y, unsigned src_z); extern void -util_fill_rect(ubyte * dst, enum pipe_format format, +util_fill_rect(uint8_t * dst, enum pipe_format format, unsigned dst_stride, unsigned dst_x, unsigned dst_y, unsigned width, unsigned height, union util_color *uc); extern void -util_fill_box(ubyte * dst, enum pipe_format format, +util_fill_box(uint8_t * dst, enum pipe_format format, unsigned stride, uintptr_t layer_stride, unsigned x, unsigned y, unsigned z, unsigned width, unsigned height, unsigned depth, union util_color *uc); extern void -util_fill_zs_box(ubyte *dst, enum pipe_format format, +util_fill_zs_box(uint8_t *dst, enum pipe_format format, bool need_rmw, unsigned clear_flags, unsigned stride, unsigned layer_stride, unsigned width, unsigned height, unsigned depth, diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 7472928..c37ae25 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -1380,7 +1380,7 @@ tc_create_vertex_elements_state(struct pipe_context *_pipe, unsigned count, struct tc_sampler_states { struct tc_call_base base; - ubyte shader, start, count; + uint8_t shader, start, count; void *slot[0]; /* more will be allocated if needed */ }; @@ -1533,7 +1533,7 @@ tc_set_tess_state(struct pipe_context *_pipe, struct tc_patch_vertices { struct tc_call_base base; - ubyte patch_vertices; + uint8_t patch_vertices; }; static uint16_t @@ -1556,7 +1556,7 @@ tc_set_patch_vertices(struct pipe_context *_pipe, uint8_t patch_vertices) struct tc_constant_buffer_base { struct tc_call_base base; - ubyte shader, index; + uint8_t shader, index; bool is_null; }; @@ -1639,8 +1639,8 @@ tc_set_constant_buffer(struct pipe_context *_pipe, struct tc_inlinable_constants { struct tc_call_base base; - ubyte shader; - ubyte num_values; + uint8_t shader; + uint8_t num_values; uint32_t values[MAX_INLINABLE_UNIFORMS]; }; @@ -1696,7 +1696,7 @@ tc_set_sample_locations(struct pipe_context *_pipe, size_t size, const uint8_t * struct tc_scissors { struct tc_call_base base; - ubyte start, count; + uint8_t start, count; struct pipe_scissor_state slot[0]; /* more will be allocated if needed */ }; @@ -1725,7 +1725,7 @@ tc_set_scissor_states(struct pipe_context *_pipe, struct tc_viewports { struct tc_call_base base; - ubyte start, count; + uint8_t start, count; struct pipe_viewport_state slot[0]; /* more will be allocated if needed */ }; @@ -1758,7 +1758,7 @@ tc_set_viewport_states(struct pipe_context *_pipe, struct tc_window_rects { struct tc_call_base base; bool include; - ubyte count; + uint8_t count; struct pipe_scissor_state slot[0]; /* more will be allocated if needed */ }; @@ -1787,7 +1787,7 @@ tc_set_window_rectangles(struct pipe_context *_pipe, bool include, struct tc_sampler_views { struct tc_call_base base; - ubyte shader, start, count, unbind_num_trailing_slots; + uint8_t shader, start, count, unbind_num_trailing_slots; struct pipe_sampler_view *slot[0]; /* more will be allocated if needed */ }; @@ -1864,8 +1864,8 @@ tc_set_sampler_views(struct pipe_context *_pipe, struct tc_shader_images { struct tc_call_base base; - ubyte shader, start, count; - ubyte unbind_num_trailing_slots; + uint8_t shader, start, count; + uint8_t unbind_num_trailing_slots; struct pipe_image_view slot[0]; /* more will be allocated if needed */ }; @@ -1955,7 +1955,7 @@ tc_set_shader_images(struct pipe_context *_pipe, struct tc_shader_buffers { struct tc_call_base base; - ubyte shader, start, count; + uint8_t shader, start, count; bool unbind; unsigned writable_bitmask; struct pipe_shader_buffer slot[0]; /* more will be allocated if needed */ @@ -2039,8 +2039,8 @@ tc_set_shader_buffers(struct pipe_context *_pipe, struct tc_vertex_buffers { struct tc_call_base base; - ubyte start, count; - ubyte unbind_num_trailing_slots; + uint8_t start, count; + uint8_t unbind_num_trailing_slots; struct pipe_vertex_buffer slot[0]; /* more will be allocated if needed */ }; diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h index dbc5d69..5411da0 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.h +++ b/src/gallium/auxiliary/util/u_threaded_context.h @@ -395,8 +395,8 @@ struct tc_call_base { #if !defined(NDEBUG) && TC_DEBUG >= 1 uint32_t sentinel; #endif - ushort num_slots; - ushort call_id; + uint16_t num_slots; + uint16_t call_id; }; /** diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index 5677074..64fa427 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -98,7 +98,7 @@ pipe_put_tile_raw(struct pipe_transfer *pt, * Return each Z value as four floats in [0,1]. */ static void -z16_get_tile_rgba(const ushort *src, +z16_get_tile_rgba(const uint16_t *src, unsigned w, unsigned h, float *p, unsigned dst_stride) @@ -404,7 +404,7 @@ pipe_get_tile_rgba(struct pipe_transfer *pt, switch (format) { case PIPE_FORMAT_Z16_UNORM: - z16_get_tile_rgba((ushort *) packed, w, h, dst, dst_stride); + z16_get_tile_rgba((uint16_t *) packed, w, h, dst, dst_stride); break; case PIPE_FORMAT_Z32_UNORM: z32_get_tile_rgba((unsigned *) packed, w, h, dst, dst_stride); diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp index a428096..3db6dcb 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp @@ -782,9 +782,9 @@ d3d12_flush_frontbuffer(struct pipe_screen * pscreen, u_minify(pres->height0, level), &transfer); if (res_map) { - util_copy_rect((ubyte*)map, pres->format, res->dt_stride, 0, 0, + util_copy_rect((uint8_t*)map, pres->format, res->dt_stride, 0, 0, transfer->box.width, transfer->box.height, - (const ubyte*)res_map, transfer->stride, 0, 0); + (const uint8_t*)res_map, transfer->stride, 0, 0); pipe_texture_unmap(pctx, transfer); } winsys->displaytarget_unmap(winsys, res->dt); diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c index 5c8bcbe..f9ecb6c 100644 --- a/src/gallium/drivers/i915/i915_context.c +++ b/src/gallium/drivers/i915/i915_context.c @@ -97,7 +97,7 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info, mapped_indices = info->has_user_indices ? info->index.user : NULL; if (!mapped_indices) mapped_indices = i915_buffer(info->index.resource)->data; - draw_set_indexes(draw, (ubyte *)mapped_indices, info->index_size, ~0); + draw_set_indexes(draw, (uint8_t *)mapped_indices, info->index_size, ~0); } if (i915->constants[PIPE_SHADER_VERTEX]) diff --git a/src/gallium/drivers/i915/i915_context.h b/src/gallium/drivers/i915/i915_context.h index 2ff659b..436c699 100644 --- a/src/gallium/drivers/i915/i915_context.h +++ b/src/gallium/drivers/i915/i915_context.h @@ -120,7 +120,7 @@ struct i915_fragment_shader { * slot of the user's constant buffer. (set by pipe->set_constant_buffer()) * Else, the bitmask indicates which components are occupied by immediates. */ - ubyte constant_flags[I915_MAX_CONSTANT]; + uint8_t constant_flags[I915_MAX_CONSTANT]; /** * The mapping between TGSI inputs and hw texture coords. diff --git a/src/gallium/drivers/i915/i915_debug.c b/src/gallium/drivers/i915/i915_debug.c index 2b426ea..36ebb2b 100644 --- a/src/gallium/drivers/i915/i915_debug.c +++ b/src/gallium/drivers/i915/i915_debug.c @@ -210,7 +210,7 @@ debug_variable_length_prim(struct debug_stream *stream) const char *prim = get_prim_name(ptr[0]); unsigned i, len; - ushort *idx = (ushort *)(ptr + 1); + uint16_t *idx = (uint16_t *)(ptr + 1); for (i = 0; idx[i] != 0xffff; i++) ; diff --git a/src/gallium/drivers/i915/i915_prim_vbuf.c b/src/gallium/drivers/i915/i915_prim_vbuf.c index 73ad83c..1145cb7 100644 --- a/src/gallium/drivers/i915/i915_prim_vbuf.c +++ b/src/gallium/drivers/i915/i915_prim_vbuf.c @@ -202,7 +202,7 @@ i915_vbuf_render_new_buf(struct i915_vbuf_render *i915_render, size_t size) */ static bool i915_vbuf_render_allocate_vertices(struct vbuf_render *render, - ushort vertex_size, ushort nr_vertices) + uint16_t vertex_size, uint16_t nr_vertices) { struct i915_vbuf_render *i915_render = i915_vbuf_render(render); size_t size = (size_t)vertex_size * (size_t)nr_vertices; @@ -251,8 +251,8 @@ i915_vbuf_render_map_vertices(struct vbuf_render *render) } static void -i915_vbuf_render_unmap_vertices(struct vbuf_render *render, ushort min_index, - ushort max_index) +i915_vbuf_render_unmap_vertices(struct vbuf_render *render, uint16_t min_index, + uint16_t max_index) { struct i915_vbuf_render *i915_render = i915_vbuf_render(render); @@ -497,7 +497,7 @@ out: * If type is zero normal operation assumed. */ static void -draw_generate_indices(struct vbuf_render *render, const ushort *indices, +draw_generate_indices(struct vbuf_render *render, const uint16_t *indices, uint32_t nr_indices, unsigned type) { struct i915_vbuf_render *i915_render = i915_vbuf_render(render); @@ -564,7 +564,7 @@ draw_calc_nr_indices(uint32_t nr_indices, unsigned type) static void i915_vbuf_render_draw_elements(struct vbuf_render *render, - const ushort *indices, uint32_t nr_indices) + const uint16_t *indices, uint32_t nr_indices) { struct i915_vbuf_render *i915_render = i915_vbuf_render(render); struct i915_context *i915 = i915_render->i915; diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index f4640c0..df17e05 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -335,10 +335,10 @@ i915_create_sampler_state(struct pipe_context *pipe, } { - ubyte r = float_to_ubyte(sampler->border_color.f[0]); - ubyte g = float_to_ubyte(sampler->border_color.f[1]); - ubyte b = float_to_ubyte(sampler->border_color.f[2]); - ubyte a = float_to_ubyte(sampler->border_color.f[3]); + uint8_t r = float_to_ubyte(sampler->border_color.f[0]); + uint8_t g = float_to_ubyte(sampler->border_color.f[1]); + uint8_t b = float_to_ubyte(sampler->border_color.f[2]); + uint8_t a = float_to_ubyte(sampler->border_color.f[3]); cso->state[2] = I915PACKCOLOR8888(r, g, b, a); } return cso; @@ -488,7 +488,7 @@ i915_create_depth_stencil_state( if (depth_stencil->alpha_enabled) { int test = i915_translate_compare_func(depth_stencil->alpha_func); - ubyte refByte = float_to_ubyte(depth_stencil->alpha_ref_value); + uint8_t refByte = float_to_ubyte(depth_stencil->alpha_ref_value); cso->depth_LIS6 |= (S6_ALPHA_TEST_ENABLE | (test << S6_ALPHA_TEST_FUNC_SHIFT) | diff --git a/src/gallium/drivers/i915/i915_state_dynamic.c b/src/gallium/drivers/i915/i915_state_dynamic.c index bb15a36..875df7b 100644 --- a/src/gallium/drivers/i915/i915_state_dynamic.c +++ b/src/gallium/drivers/i915/i915_state_dynamic.c @@ -218,8 +218,8 @@ upload_STIPPLE(struct i915_context *i915) /* I915_NEW_STIPPLE */ { - const ubyte *mask = (const ubyte *)i915->poly_stipple.stipple; - ubyte p[4]; + const uint8_t *mask = (const uint8_t *)i915->poly_stipple.stipple; + uint8_t p[4]; p[0] = mask[12] & 0xf; p[1] = mask[8] & 0xf; diff --git a/src/gallium/drivers/lima/lima_draw.c b/src/gallium/drivers/lima/lima_draw.c index ff8cbbd..856b24a 100644 --- a/src/gallium/drivers/lima/lima_draw.c +++ b/src/gallium/drivers/lima/lima_draw.c @@ -631,7 +631,7 @@ lima_pack_render_state(struct lima_context *ctx, const struct pipe_draw_info *in render->depth_test |= 0x801; } - ushort far, near; + uint16_t far, near; near = float_to_ushort(ctx->viewport.near); far = float_to_ushort(ctx->viewport.far); diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index 80034fa..bb31ea5 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -117,7 +117,7 @@ struct llvmpipe_context { uint64_t dirty; /**< Mask of LP_NEW_x flags */ unsigned cs_dirty; /**< Mask of LP_CSNEW_x flags */ /** Mapped vertex buffers */ - ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS]; + uint8_t *mapped_vbuffer[PIPE_MAX_ATTRIBS]; /** Vertex format */ struct vertex_info vertex_info; diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c index ed38a27..6eb88c7 100644 --- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c +++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c @@ -102,7 +102,7 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info, available_space = info->index.resource->width0; } draw_set_indexes(draw, - (ubyte *) mapped_indices, + (uint8_t *) mapped_indices, info->index_size, available_space); } diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index 6ed285d..bb50323 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -308,11 +308,11 @@ lp_jit_init_cs_types(struct lp_compute_shader_variant *lp) void lp_jit_buffer_from_pipe(struct lp_jit_buffer *jit, const struct pipe_shader_buffer *buffer) { - const ubyte *current_data = NULL; + const uint8_t *current_data = NULL; /* resource buffer */ if (buffer->buffer) - current_data = (ubyte *)llvmpipe_resource_data(buffer->buffer); + current_data = (uint8_t *)llvmpipe_resource_data(buffer->buffer); if (current_data) { current_data += buffer->buffer_offset; @@ -329,13 +329,13 @@ lp_jit_buffer_from_pipe_const(struct lp_jit_buffer *jit, const struct pipe_const { uint64_t current_size = buffer->buffer_size; - const ubyte *current_data = NULL; + const uint8_t *current_data = NULL; if (buffer->buffer) { /* resource buffer */ - current_data = (ubyte *)llvmpipe_resource_data(buffer->buffer); + current_data = (uint8_t *)llvmpipe_resource_data(buffer->buffer); } else if (buffer->user_buffer) { /* user-space buffer */ - current_data = (ubyte *)buffer->user_buffer; + current_data = (uint8_t *)buffer->user_buffer; } if (current_data && current_size >= sizeof(float)) { diff --git a/src/gallium/drivers/llvmpipe/lp_linear_interp.c b/src/gallium/drivers/llvmpipe/lp_linear_interp.c index 3aaea61..51b8135 100644 --- a/src/gallium/drivers/llvmpipe/lp_linear_interp.c +++ b/src/gallium/drivers/llvmpipe/lp_linear_interp.c @@ -48,7 +48,7 @@ /* Translate floating point value to 1.15 unsigned fixed-point. */ -static inline ushort +static inline uint16_t float_to_ufixed_1_15(float f) { return CLAMP((unsigned)(f * (float)FIXED15_ONE), 0, FIXED15_ONE); diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h index 7bf6be1..41dffd7 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.h +++ b/src/gallium/drivers/llvmpipe/lp_scene.h @@ -84,7 +84,7 @@ struct cmd_block { struct data_block { - ubyte data[DATA_BLOCK_SIZE]; + uint8_t data[DATA_BLOCK_SIZE]; unsigned used; struct data_block *next; }; @@ -258,7 +258,7 @@ lp_scene_alloc(struct lp_scene *scene, unsigned size) } { - ubyte *data = block->data + block->used; + uint8_t *data = block->data + block->used; block->used += size; return data; } @@ -290,7 +290,7 @@ lp_scene_alloc_aligned(struct lp_scene *scene, unsigned size, } { - ubyte *data = block->data + block->used; + uint8_t *data = block->data + block->used; unsigned offset = (((uintptr_t)data + alignment - 1) & ~(alignment - 1)) - (uintptr_t)data; block->used += offset + size; return data + offset; diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 778caee..98e372b 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -714,7 +714,7 @@ lp_setup_set_alpha_ref_value(struct lp_setup_context *setup, void lp_setup_set_stencil_ref_values(struct lp_setup_context *setup, - const ubyte refs[2]) + const uint8_t refs[2]) { LP_DBG(DEBUG_SETUP, "%s %d %d\n", __func__, refs[0], refs[1]); @@ -1067,16 +1067,16 @@ try_update_scene_state(struct lp_setup_context *setup) struct pipe_resource *buffer = setup->constants[i].current.buffer; const unsigned current_size = MIN2(setup->constants[i].current.buffer_size, LP_MAX_TGSI_CONST_BUFFER_SIZE); - const ubyte *current_data = NULL; + const uint8_t *current_data = NULL; STATIC_ASSERT(DATA_BLOCK_SIZE >= LP_MAX_TGSI_CONST_BUFFER_SIZE); if (buffer) { /* resource buffer */ - current_data = (ubyte *) llvmpipe_resource_data(buffer); + current_data = (uint8_t *) llvmpipe_resource_data(buffer); } else if (setup->constants[i].current.user_buffer) { /* user-space buffer */ - current_data = (ubyte *) setup->constants[i].current.user_buffer; + current_data = (uint8_t *) setup->constants[i].current.user_buffer; } if (current_data && current_size >= sizeof(float)) { diff --git a/src/gallium/drivers/llvmpipe/lp_setup.h b/src/gallium/drivers/llvmpipe/lp_setup.h index d278501..8d33004 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.h +++ b/src/gallium/drivers/llvmpipe/lp_setup.h @@ -101,7 +101,7 @@ lp_setup_set_alpha_ref_value(struct lp_setup_context *setup, void lp_setup_set_stencil_ref_values(struct lp_setup_context *setup, - const ubyte refs[2]); + const uint8_t refs[2]); void lp_setup_set_blend_color(struct lp_setup_context *setup, diff --git a/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c b/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c index f72fb8c..38e170a 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c @@ -80,7 +80,7 @@ lp_setup_get_vertex_info(struct vbuf_render *vbr) static bool lp_setup_allocate_vertices(struct vbuf_render *vbr, - ushort vertex_size, ushort nr_vertices) + uint16_t vertex_size, uint16_t nr_vertices) { struct lp_setup_context *setup = lp_setup_context(vbr); unsigned size = vertex_size * nr_vertices; @@ -115,8 +115,8 @@ lp_setup_map_vertices(struct vbuf_render *vbr) static void lp_setup_unmap_vertices(struct vbuf_render *vbr, - ushort min_index, - ushort max_index) + uint16_t min_index, + uint16_t max_index) { ASSERTED struct lp_setup_context *setup = lp_setup_context(vbr); assert(setup->vertex_buffer_size >= (max_index+1) * setup->vertex_size); @@ -169,7 +169,7 @@ rect(struct lp_setup_context *setup, * draw elements / indexed primitives */ static void -lp_setup_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) +lp_setup_draw_elements(struct vbuf_render *vbr, const uint16_t *indices, uint nr) { struct lp_setup_context *setup = lp_setup_context(vbr); const unsigned stride = setup->vertex_info->size * sizeof(float); diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.c b/src/gallium/drivers/llvmpipe/lp_state_cs.c index 6118d73..e09b154 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_cs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_cs.c @@ -1689,11 +1689,11 @@ update_csctx_ssbo(struct llvmpipe_context *llvmpipe, { for (int i = 0; i < ARRAY_SIZE(csctx->ssbos); ++i) { struct pipe_resource *buffer = csctx->ssbos[i].current.buffer; - const ubyte *current_data = NULL; + const uint8_t *current_data = NULL; /* resource buffer */ if (buffer) - current_data = (ubyte *) llvmpipe_resource_data(buffer); + current_data = (uint8_t *) llvmpipe_resource_data(buffer); if (current_data) { current_data += csctx->ssbos[i].current.buffer_offset; diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 6615e61..3732fd0 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -4203,9 +4203,9 @@ llvmpipe_set_constant_buffer(struct pipe_context *pipe, case PIPE_SHADER_TESS_EVAL: { const unsigned size = cb ? cb->buffer_size : 0; - const ubyte *data = NULL; + const uint8_t *data = NULL; if (constants->buffer) { - data = (ubyte *) llvmpipe_resource_data(constants->buffer) + data = (uint8_t *) llvmpipe_resource_data(constants->buffer) + constants->buffer_offset; } @@ -4259,9 +4259,9 @@ llvmpipe_set_shader_buffers(struct pipe_context *pipe, case PIPE_SHADER_TESS_CTRL: case PIPE_SHADER_TESS_EVAL: { const unsigned size = buffer ? buffer->buffer_size : 0; - const ubyte *data = NULL; + const uint8_t *data = NULL; if (buffer && buffer->buffer) - data = (ubyte *) llvmpipe_resource_data(buffer->buffer); + data = (uint8_t *) llvmpipe_resource_data(buffer->buffer); if (data) data += buffer->buffer_offset; draw_set_mapped_shader_buffer(llvmpipe->draw, shader, diff --git a/src/gallium/drivers/llvmpipe/lp_surface.c b/src/gallium/drivers/llvmpipe/lp_surface.c index 8a3745a..5ad475e 100644 --- a/src/gallium/drivers/llvmpipe/lp_surface.c +++ b/src/gallium/drivers/llvmpipe/lp_surface.c @@ -281,7 +281,7 @@ llvmpipe_get_sample_position(struct pipe_context *pipe, static void lp_clear_color_texture_helper(struct pipe_transfer *dst_trans, - ubyte *dst_map, + uint8_t *dst_map, enum pipe_format format, const union pipe_color_union *color, unsigned width, unsigned height, @@ -308,7 +308,7 @@ lp_clear_color_texture_msaa(struct pipe_context *pipe, const struct pipe_box *box) { struct pipe_transfer *dst_trans; - ubyte *dst_map; + uint8_t *dst_map; dst_map = llvmpipe_transfer_map_ms(pipe, texture, 0, PIPE_MAP_WRITE, sample, box, &dst_trans); @@ -374,7 +374,7 @@ lp_clear_depth_stencil_texture_msaa(struct pipe_context *pipe, need_rmw = true; } - ubyte *dst_map = llvmpipe_transfer_map_ms(pipe, + uint8_t *dst_map = llvmpipe_transfer_map_ms(pipe, texture, 0, (need_rmw ? PIPE_MAP_READ_WRITE : diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 5a9c44f..772ea67 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -696,7 +696,7 @@ llvmpipe_transfer_map_ms(struct pipe_context *pipe, struct llvmpipe_resource *lpr = llvmpipe_resource(resource); struct llvmpipe_transfer *lpt; struct pipe_transfer *pt; - ubyte *map; + uint8_t *map; enum pipe_format format; assert(resource); @@ -921,7 +921,7 @@ tex_image_face_size(const struct llvmpipe_resource *lpr, unsigned level) * Return pointer to a 2D texture image/face/slice. * No tiled/linear conversion is done. */ -ubyte * +uint8_t * llvmpipe_get_texture_image_address(struct llvmpipe_resource *lpr, unsigned face_slice, unsigned level) { @@ -932,7 +932,7 @@ llvmpipe_get_texture_image_address(struct llvmpipe_resource *lpr, if (face_slice > 0) offset += face_slice * tex_image_face_size(lpr, level); - return (ubyte *) lpr->tex_data + offset; + return (uint8_t *) lpr->tex_data + offset; } diff --git a/src/gallium/drivers/llvmpipe/lp_texture.h b/src/gallium/drivers/llvmpipe/lp_texture.h index 72d1ff5..43559cd 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.h +++ b/src/gallium/drivers/llvmpipe/lp_texture.h @@ -248,7 +248,7 @@ unsigned llvmpipe_resource_size(const struct pipe_resource *resource); -ubyte * +uint8_t * llvmpipe_get_texture_image_address(struct llvmpipe_resource *lpr, unsigned face_slice, unsigned level); diff --git a/src/gallium/drivers/nouveau/nv30/nv30_draw.c b/src/gallium/drivers/nouveau/nv30/nv30_draw.c index d349255..fca6407 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_draw.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_draw.c @@ -67,7 +67,7 @@ nv30_render_get_vertex_info(struct vbuf_render *render) static bool nv30_render_allocate_vertices(struct vbuf_render *render, - ushort vertex_size, ushort nr_vertices) + uint16_t vertex_size, uint16_t nr_vertices) { struct nv30_render *r = nv30_render(render); struct nv30_context *nv30 = r->nv30; @@ -104,7 +104,7 @@ nv30_render_map_vertices(struct vbuf_render *render) static void nv30_render_unmap_vertices(struct vbuf_render *render, - ushort min_index, ushort max_index) + uint16_t min_index, uint16_t max_index) { struct nv30_render *r = nv30_render(render); pipe_buffer_unmap(&r->nv30->base.pipe, r->transfer); @@ -121,7 +121,7 @@ nv30_render_set_primitive(struct vbuf_render *render, enum mesa_prim prim) static void nv30_render_draw_elements(struct vbuf_render *render, - const ushort *indices, uint count) + const uint16_t *indices, uint count) { struct nv30_render *r = nv30_render(render); struct nv30_context *nv30 = r->nv30; @@ -440,7 +440,7 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info, PIPE_MAP_UNSYNCHRONIZED | PIPE_MAP_READ, &transferi); draw_set_indexes(draw, - (ubyte *) map, + (uint8_t *) map, info->index_size, ~0); } else { draw_set_indexes(draw, NULL, 0, 0); diff --git a/src/gallium/drivers/nouveau/nv50/nv50_program.c b/src/gallium/drivers/nouveau/nv50/nv50_program.c index 7f3f182..4a3e744 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_program.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_program.c @@ -544,7 +544,7 @@ void nv50_program_destroy(struct nv50_context *nv50, struct nv50_program *p) { const struct pipe_shader_state pipe = p->pipe; - const ubyte type = p->type; + const uint8_t type = p->type; if (p->mem) { if (nv50) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_program.h b/src/gallium/drivers/nouveau/nv50/nv50_program.h index f2b945c..ef632b7 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_program.h +++ b/src/gallium/drivers/nouveau/nv50/nv50_program.h @@ -35,8 +35,8 @@ struct nv50_varying { unsigned linear : 1; unsigned pad : 3; - ubyte sn; /* semantic name */ - ubyte si; /* semantic index */ + uint8_t sn; /* semantic name */ + uint8_t si; /* semantic index */ }; struct nv50_stream_output_state @@ -57,7 +57,7 @@ struct nv50_gmem_state { struct nv50_program { struct pipe_shader_state pipe; - ubyte type; + uint8_t type; bool translated; uint32_t *code; @@ -67,21 +67,21 @@ struct nv50_program { unsigned parm_size; /* size limit of uniform buffer */ uint32_t tls_space; /* required local memory per thread */ - ubyte max_gpr; /* REG_ALLOC_TEMP */ - ubyte max_out; /* REG_ALLOC_RESULT or FP_RESULT_COUNT */ + uint8_t max_gpr; /* REG_ALLOC_TEMP */ + uint8_t max_out; /* REG_ALLOC_RESULT or FP_RESULT_COUNT */ - ubyte in_nr; - ubyte out_nr; + uint8_t in_nr; + uint8_t out_nr; struct nv50_varying in[16]; struct nv50_varying out[16]; struct { uint32_t attrs[3]; /* VP_ATTR_EN_0,1 and VP_GP_BUILTIN_ATTR_EN */ - ubyte psiz; /* output slot of point size */ - ubyte bfc[2]; /* indices into varying for FFC (FP) or BFC (VP) */ - ubyte edgeflag; - ubyte clpd[2]; /* output slot of clip distance[i]'s 1st component */ - ubyte clpd_nr; + uint8_t psiz; /* output slot of point size */ + uint8_t bfc[2]; /* indices into varying for FFC (FP) or BFC (VP) */ + uint8_t edgeflag; + uint8_t clpd[2]; /* output slot of clip distance[i]'s 1st component */ + uint8_t clpd_nr; bool need_vertex_id; uint32_t clip_mode; uint8_t clip_enable; /* mask of defined clip planes */ @@ -101,9 +101,9 @@ struct nv50_program { uint32_t vert_count; uint8_t prim_type; /* point, line strip or tri strip */ uint8_t has_layer; - ubyte layerid; /* hw value of layer output */ + uint8_t layerid; /* hw value of layer output */ uint8_t has_viewport; - ubyte viewportid; /* hw value of viewport index output */ + uint8_t viewportid; /* hw value of viewport index output */ } gp; struct { diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_program.c b/src/gallium/drivers/nouveau/nvc0/nvc0_program.c index 1151a7e..63f781b 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_program.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_program.c @@ -989,7 +989,7 @@ void nvc0_program_destroy(struct nvc0_context *nvc0, struct nvc0_program *prog) { const struct pipe_shader_state pipe = prog->pipe; - const ubyte type = prog->type; + const uint8_t type = prog->type; if (prog->mem) { if (nvc0) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_program.h b/src/gallium/drivers/nouveau/nvc0/nvc0_program.h index 536841f..616a689 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_program.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_program.h @@ -22,7 +22,7 @@ struct nvc0_transform_feedback_state { struct nvc0_program { struct pipe_shader_state pipe; - ubyte type; + uint8_t type; bool translated; bool need_tls; uint8_t num_gprs; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c index 3dd7d0b..0c56796 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c @@ -287,7 +287,7 @@ static void nvc0_validate_stencil_ref(struct nvc0_context *nvc0) { struct nouveau_pushbuf *push = nvc0->base.pushbuf; - const ubyte *ref = &nvc0->stencil_ref.ref_value[0]; + const uint8_t *ref = &nvc0->stencil_ref.ref_value[0]; IMMED_NVC0(push, NVC0_3D(STENCIL_FRONT_FUNC_REF), ref[0]); IMMED_NVC0(push, NVC0_3D(STENCIL_BACK_FUNC_REF), ref[1]); diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 8458293..17a0b7c 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -940,8 +940,8 @@ r300_render_get_vertex_info(struct vbuf_render* render) } static bool r300_render_allocate_vertices(struct vbuf_render* render, - ushort vertex_size, - ushort count) + uint16_t vertex_size, + uint16_t count) { struct r300_render* r300render = r300_render(render); struct r300_context* r300 = r300render->r300; @@ -984,8 +984,8 @@ static void* r300_render_map_vertices(struct vbuf_render* render) } static void r300_render_unmap_vertices(struct vbuf_render* render, - ushort min, - ushort max) + uint16_t min, + uint16_t max) { struct r300_render* r300render = r300_render(render); struct r300_context* r300 = r300render->r300; @@ -1051,7 +1051,7 @@ static void r300_render_draw_arrays(struct vbuf_render* render, } static void r300_render_draw_elements(struct vbuf_render* render, - const ushort* indices, + const uint16_t* indices, uint count) { struct r300_render* r300render = r300_render(render); diff --git a/src/gallium/drivers/r300/r300_render_stencilref.c b/src/gallium/drivers/r300/r300_render_stencilref.c index 18086c1..201fd41 100644 --- a/src/gallium/drivers/r300/r300_render_stencilref.c +++ b/src/gallium/drivers/r300/r300_render_stencilref.c @@ -43,7 +43,7 @@ struct r300_stencilref_context { uint32_t rs_cull_mode; uint32_t zb_stencilrefmask; - ubyte ref_value_front; + uint8_t ref_value_front; }; static bool r300_stencilref_needed(struct r300_context *r300) diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index 20844b8..544809e 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -233,9 +233,9 @@ struct r600_config_state { struct r600_stencil_ref { - ubyte ref_value[2]; - ubyte valuemask[2]; - ubyte writemask[2]; + uint8_t ref_value[2]; + uint8_t valuemask[2]; + uint8_t writemask[2]; }; struct r600_stencil_ref_state { @@ -331,8 +331,8 @@ struct r600_blend_state { struct r600_dsa_state { struct r600_command_buffer buffer; unsigned alpha_ref; - ubyte valuemask[2]; - ubyte writemask[2]; + uint8_t valuemask[2]; + uint8_t writemask[2]; unsigned zwritemask; unsigned sx_alpha_test_control; }; diff --git a/src/gallium/drivers/r600/r600_pipe_common.h b/src/gallium/drivers/r600/r600_pipe_common.h index c0ca557..1d2227f 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.h +++ b/src/gallium/drivers/r600/r600_pipe_common.h @@ -771,7 +771,7 @@ unsigned r600_translate_colorswap(enum pipe_format format, bool do_endian_swap); void evergreen_do_fast_color_clear(struct r600_common_context *rctx, struct pipe_framebuffer_state *fb, struct r600_atom *fb_state, - unsigned *buffers, ubyte *dirty_cbufs, + unsigned *buffers, uint8_t *dirty_cbufs, const union pipe_color_union *color); void r600_init_screen_texture_functions(struct r600_common_screen *rscreen); void r600_init_context_texture_functions(struct r600_common_context *rctx); diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index babed50..2e82a68 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -1733,7 +1733,7 @@ static void evergreen_set_clear_color(struct r600_texture *rtex, void evergreen_do_fast_color_clear(struct r600_common_context *rctx, struct pipe_framebuffer_state *fb, struct r600_atom *fb_state, - unsigned *buffers, ubyte *dirty_cbufs, + unsigned *buffers, uint8_t *dirty_cbufs, const union pipe_color_union *color) { int i; diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 807db22..46b09fb 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -699,7 +699,7 @@ struct si_sampler_view { uint32_t state[8]; uint32_t fmask_state[8]; const struct legacy_surf_level *base_level_info; - ubyte block_width; + uint8_t block_width; bool is_stencil_sampler; bool dcc_incompatible; }; @@ -746,15 +746,15 @@ struct si_framebuffer { unsigned spi_shader_col_format_alpha; unsigned spi_shader_col_format_blend; unsigned spi_shader_col_format_blend_alpha; - ubyte nr_samples : 5; /* at most 16xAA */ - ubyte log_samples : 3; /* at most 4 = 16xAA */ - ubyte nr_color_samples; /* at most 8xAA */ - ubyte compressed_cb_mask; - ubyte uncompressed_cb_mask; - ubyte color_is_int8; - ubyte color_is_int10; - ubyte dirty_cbufs; - ubyte min_bytes_per_pixel; + uint8_t nr_samples : 5; /* at most 16xAA */ + uint8_t log_samples : 3; /* at most 4 = 16xAA */ + uint8_t nr_color_samples; /* at most 8xAA */ + uint8_t compressed_cb_mask; + uint8_t uncompressed_cb_mask; + uint8_t color_is_int8; + uint8_t color_is_int10; + uint8_t dirty_cbufs; + uint8_t min_bytes_per_pixel; bool dirty_zsbuf; bool any_dst_linear; bool CB_has_shader_readable_metadata; diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 23146b0..fc8ba78 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2704,7 +2704,7 @@ bool si_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compi sel->stage == MESA_SHADER_TESS_EVAL || sel->stage == MESA_SHADER_GEOMETRY) && !shader->key.ge.as_ls && !shader->key.ge.as_es) { - ubyte *vs_output_param_offset = shader->info.vs_output_param_offset; + uint8_t *vs_output_param_offset = shader->info.vs_output_param_offset; if (sel->stage == MESA_SHADER_GEOMETRY && !shader->key.ge.as_ngg) vs_output_param_offset = shader->gs_copy_shader->info.vs_output_param_offset; @@ -3025,7 +3025,7 @@ void si_get_ps_prolog_key(struct si_shader *shader, union si_shader_part_key *ke shader->info.uses_vmem_load_other = true; if (info->colors_read) { - ubyte *color = shader->selector->info.color_attr_index; + uint8_t *color = shader->selector->info.color_attr_index; if (shader->key.ps.part.prolog.color_two_side) { /* BCOLORs are stored after the last input. */ diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index e0aa5e7..6b5b6d7 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -404,10 +404,10 @@ enum si_color_output_type { union si_input_info { struct { - ubyte semantic; - ubyte interpolate; - ubyte fp16_lo_hi_valid; - ubyte usage_mask; + uint8_t semantic; + uint8_t interpolate; + uint8_t fp16_lo_hi_valid; + uint8_t usage_mask; }; uint32_t _unused; /* this just forces 4-byte alignment */ }; @@ -417,18 +417,18 @@ struct si_shader_info { uint32_t options; /* bitmask of SI_PROFILE_* */ - ubyte num_inputs; - ubyte num_outputs; + uint8_t num_inputs; + uint8_t num_outputs; union si_input_info input[PIPE_MAX_SHADER_INPUTS]; - ubyte output_semantic[PIPE_MAX_SHADER_OUTPUTS]; - ubyte output_usagemask[PIPE_MAX_SHADER_OUTPUTS]; - ubyte output_readmask[PIPE_MAX_SHADER_OUTPUTS]; - ubyte output_streams[PIPE_MAX_SHADER_OUTPUTS]; - ubyte output_type[PIPE_MAX_SHADER_OUTPUTS]; /* enum nir_alu_type */ - - ubyte num_vs_inputs; - ubyte num_vbos_in_user_sgprs; - ubyte num_stream_output_components[4]; + uint8_t output_semantic[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t output_usagemask[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t output_readmask[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t output_streams[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t output_type[PIPE_MAX_SHADER_OUTPUTS]; /* enum nir_alu_type */ + + uint8_t num_vs_inputs; + uint8_t num_vbos_in_user_sgprs; + uint8_t num_stream_output_components[4]; uint16_t enabled_streamout_buffer_mask; uint64_t inputs_read; /* "get_unique_index" bits */ @@ -438,13 +438,13 @@ struct si_shader_info { uint64_t outputs_written; /* "get_unique_index" bits */ uint32_t patch_outputs_written; /* "get_unique_index_patch" bits */ - ubyte clipdist_mask; - ubyte culldist_mask; + uint8_t clipdist_mask; + uint8_t culldist_mask; uint16_t lshs_vertex_stride; uint16_t esgs_vertex_stride; uint16_t gsvs_vertex_size; - ubyte gs_input_verts_per_prim; + uint8_t gs_input_verts_per_prim; unsigned max_gsvs_emit_size; /* Set 0xf or 0x0 (4 bits) per each written output. @@ -454,11 +454,11 @@ struct si_shader_info { int constbuf0_num_slots; uint num_memory_stores; - ubyte color_attr_index[2]; - ubyte color_interpolate[2]; - ubyte color_interpolate_loc[2]; - ubyte colors_read; /**< which color components are read by the FS */ - ubyte colors_written; + uint8_t color_attr_index[2]; + uint8_t color_interpolate[2]; + uint8_t color_interpolate_loc[2]; + uint8_t colors_read; /**< which color components are read by the FS */ + uint8_t colors_written; uint16_t output_color_types; /**< Each bit pair is enum si_color_output_type */ bool vs_needs_prolog; bool color0_writes_all_cbufs; /**< gl_FragColor */ @@ -559,13 +559,13 @@ struct si_shader_selector { struct si_shader_info info; enum pipe_shader_type pipe_shader_type; - ubyte const_and_shader_buf_descriptors_index; - ubyte sampler_and_images_descriptors_index; - ubyte cs_shaderbufs_sgpr_index; - ubyte cs_num_shaderbufs_in_user_sgprs; - ubyte cs_images_sgpr_index; - ubyte cs_images_num_sgprs; - ubyte cs_num_images_in_user_sgprs; + uint8_t const_and_shader_buf_descriptors_index; + uint8_t sampler_and_images_descriptors_index; + uint8_t cs_shaderbufs_sgpr_index; + uint8_t cs_num_shaderbufs_in_user_sgprs; + uint8_t cs_images_sgpr_index; + uint8_t cs_images_num_sgprs; + uint8_t cs_num_images_in_user_sgprs; unsigned ngg_cull_vert_threshold; /* UINT32_MAX = disabled */ enum mesa_prim rast_prim; @@ -815,18 +815,18 @@ union si_shader_key { /* GCN-specific shader info. */ struct si_shader_binary_info { - ubyte vs_output_param_offset[NUM_TOTAL_VARYING_SLOTS]; + uint8_t vs_output_param_offset[NUM_TOTAL_VARYING_SLOTS]; uint32_t vs_output_ps_input_cntl[NUM_TOTAL_VARYING_SLOTS]; - ubyte num_input_sgprs; - ubyte num_input_vgprs; + uint8_t num_input_sgprs; + uint8_t num_input_vgprs; bool uses_vmem_load_other; /* all other VMEM loads and atomics with return */ bool uses_vmem_sampler_or_bvh; signed char face_vgpr_index; signed char ancillary_vgpr_index; signed char sample_coverage_vgpr_index; bool uses_instanceid; - ubyte nr_pos_exports; - ubyte nr_param_exports; + uint8_t nr_pos_exports; + uint8_t nr_param_exports; unsigned private_mem_vgprs; unsigned max_simd_waves; }; diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c index 60df62b..15bbb7b 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c @@ -215,7 +215,7 @@ static LLVMValueRef si_nir_load_tcs_varyings(struct ac_shader_abi *abi, LLVMType assert(ctx->shader->key.ge.opt.same_patch_vertices && !param_index); - ubyte semantic = info->input[driver_location].semantic; + uint8_t semantic = info->input[driver_location].semantic; /* Load the TCS input from a VGPR. */ unsigned func_param = ctx->args->ac.tcs_rel_ids.arg_index + 1 + si_shader_io_get_unique_index(semantic) * 4; diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index e7a56f1..b0285b5 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -3065,19 +3065,19 @@ static void si_set_framebuffer_state(struct pipe_context *ctx, break; case 2: constbuf.buffer_offset = - (ubyte *)sctx->sample_positions.x2 - (ubyte *)sctx->sample_positions.x1; + (uint8_t *)sctx->sample_positions.x2 - (uint8_t *)sctx->sample_positions.x1; break; case 4: constbuf.buffer_offset = - (ubyte *)sctx->sample_positions.x4 - (ubyte *)sctx->sample_positions.x1; + (uint8_t *)sctx->sample_positions.x4 - (uint8_t *)sctx->sample_positions.x1; break; case 8: constbuf.buffer_offset = - (ubyte *)sctx->sample_positions.x8 - (ubyte *)sctx->sample_positions.x1; + (uint8_t *)sctx->sample_positions.x8 - (uint8_t *)sctx->sample_positions.x1; break; case 16: constbuf.buffer_offset = - (ubyte *)sctx->sample_positions.x16 - (ubyte *)sctx->sample_positions.x1; + (uint8_t *)sctx->sample_positions.x16 - (uint8_t *)sctx->sample_positions.x1; break; default: PRINT_ERR("Requested an invalid number of samples %i.\n", sctx->framebuffer.nr_samples); diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index 9896f75..8bbc8a8 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -109,7 +109,7 @@ struct si_state_dsa { /* 0 = without stencil buffer, 1 = when both Z and S buffers are present */ struct si_dsa_order_invariance order_invariance[2]; - ubyte alpha_func : 3; + uint8_t alpha_func : 3; bool depth_enabled : 1; bool depth_write_enabled : 1; bool stencil_enabled : 1; @@ -468,7 +468,7 @@ struct si_descriptors { * to the descriptor array will be stored. */ short shader_userdata_offset; /* The size of one descriptor. */ - ubyte element_dw_size; + uint8_t element_dw_size; /* If there is only one slot enabled, bind it directly instead of * uploading descriptors. -1 if disabled. */ signed char slot_index_to_bind_directly; diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp index 03d66e3..eb951f0 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.cpp +++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp @@ -1113,7 +1113,7 @@ static bool num_instanced_prims_less_than(const struct pipe_draw_indirect_info * unsigned min_vertex_count, unsigned instance_count, unsigned num_prims, - ubyte vertices_per_patch) + uint8_t vertices_per_patch) { if (IS_DRAW_VERTEX_STATE) return 0; diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.cpp b/src/gallium/drivers/radeonsi/si_state_shaders.cpp index c4ea4e6..79a5f08 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.cpp +++ b/src/gallium/drivers/radeonsi/si_state_shaders.cpp @@ -986,7 +986,7 @@ static void si_emit_shader_gs(struct si_context *sctx) static void si_shader_gs(struct si_screen *sscreen, struct si_shader *shader) { struct si_shader_selector *sel = shader->selector; - const ubyte *num_components = sel->info.num_stream_output_components; + const uint8_t *num_components = sel->info.num_stream_output_components; unsigned gs_num_invocations = sel->info.base.gs.invocations; struct si_pm4_state *pm4; uint64_t va; diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h index cea5ea4..89ddd30 100644 --- a/src/gallium/drivers/softpipe/sp_context.h +++ b/src/gallium/drivers/softpipe/sp_context.h @@ -106,7 +106,7 @@ struct softpipe_context { unsigned active_query_count; /** Mapped vertex buffers */ - ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS]; + uint8_t *mapped_vbuffer[PIPE_MAX_ATTRIBS]; /** Mapped constant buffers */ struct tgsi_exec_consts_info mapped_constants[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT_BUFFERS]; diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index 5c9b6c6..e97ed1b 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -117,7 +117,7 @@ softpipe_draw_vbo(struct pipe_context *pipe, } draw_set_indexes(draw, - (ubyte *) mapped_indices, + (uint8_t *) mapped_indices, info->index_size, available_space); } diff --git a/src/gallium/drivers/softpipe/sp_fs_exec.c b/src/gallium/drivers/softpipe/sp_fs_exec.c index de709e5..f1adb21 100644 --- a/src/gallium/drivers/softpipe/sp_fs_exec.c +++ b/src/gallium/drivers/softpipe/sp_fs_exec.c @@ -127,8 +127,8 @@ exec_run( const struct sp_fragment_shader_variant *var, /* store outputs */ { - const ubyte *sem_name = var->info.output_semantic_name; - const ubyte *sem_index = var->info.output_semantic_index; + const uint8_t *sem_name = var->info.output_semantic_name; + const uint8_t *sem_index = var->info.output_semantic_index; const uint n = var->info.num_outputs; uint i; for (i = 0; i < n; i++) { diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c index be8e058..d919463 100644 --- a/src/gallium/drivers/softpipe/sp_prim_vbuf.c +++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c @@ -87,7 +87,7 @@ sp_vbuf_get_vertex_info(struct vbuf_render *vbr) static bool sp_vbuf_allocate_vertices(struct vbuf_render *vbr, - ushort vertex_size, ushort nr_vertices) + uint16_t vertex_size, uint16_t nr_vertices) { struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr); unsigned size = vertex_size * nr_vertices; @@ -122,8 +122,8 @@ sp_vbuf_map_vertices(struct vbuf_render *vbr) static void sp_vbuf_unmap_vertices(struct vbuf_render *vbr, - ushort min_index, - ushort max_index ) + uint16_t min_index, + uint16_t max_index ) { struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr); assert( cvbr->vertex_buffer_size >= (max_index+1) * cvbr->vertex_size ); @@ -157,7 +157,7 @@ static inline cptrf4 get_vert( const void *vertex_buffer, * draw elements / indexed primitives */ static void -sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) +sp_vbuf_draw_elements(struct vbuf_render *vbr, const uint16_t *indices, uint nr) { struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr); struct softpipe_context *softpipe = cvbr->softpipe; diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c index a1e2478..2127be2 100644 --- a/src/gallium/drivers/softpipe/sp_quad_blend.c +++ b/src/gallium/drivers/softpipe/sp_quad_blend.c @@ -152,7 +152,7 @@ logicop_quad(struct quad_stage *qs, float (*dest)[4]) { struct softpipe_context *softpipe = qs->softpipe; - ubyte src[4][4], dst[4][4], res[4][4]; + uint8_t src[4][4], dst[4][4], res[4][4]; uint *src4 = (uint *) src; uint *dst4 = (uint *) dst; uint *res4 = (uint *) res; diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c index 9bf9056..0bde3c9 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c @@ -47,9 +47,9 @@ struct depth_data { enum pipe_format format; unsigned bzzzz[TGSI_QUAD_SIZE]; /**< Z values fetched from depth buffer */ unsigned qzzzz[TGSI_QUAD_SIZE]; /**< Z values from the quad */ - ubyte stencilVals[TGSI_QUAD_SIZE]; + uint8_t stencilVals[TGSI_QUAD_SIZE]; bool use_shader_stencil_refs; - ubyte shader_stencil_refs[TGSI_QUAD_SIZE]; + uint8_t shader_stencil_refs[TGSI_QUAD_SIZE]; struct softpipe_cached_tile *tile; float minval, maxval; bool clamp; @@ -275,7 +275,7 @@ write_depth_stencil_values( struct depth_data *data, for (j = 0; j < TGSI_QUAD_SIZE; j++) { int x = quad->input.x0 % TILE_SIZE + (j & 1); int y = quad->input.y0 % TILE_SIZE + (j >> 1); - tile->data.depth16[y][x] = (ushort) data->bzzzz[j]; + tile->data.depth16[y][x] = (uint16_t) data->bzzzz[j]; } break; case PIPE_FORMAT_Z24X8_UNORM: @@ -357,7 +357,7 @@ do_stencil_test(struct depth_data *data, { unsigned passMask = 0x0; unsigned j; - ubyte refs[TGSI_QUAD_SIZE]; + uint8_t refs[TGSI_QUAD_SIZE]; for (j = 0; j < TGSI_QUAD_SIZE; j++) { if (data->use_shader_stencil_refs) @@ -435,11 +435,11 @@ do_stencil_test(struct depth_data *data, */ static void apply_stencil_op(struct depth_data *data, - unsigned mask, unsigned op, ubyte ref, ubyte wrtMask) + unsigned mask, unsigned op, uint8_t ref, uint8_t wrtMask) { unsigned j; - ubyte newstencil[TGSI_QUAD_SIZE]; - ubyte refs[TGSI_QUAD_SIZE]; + uint8_t newstencil[TGSI_QUAD_SIZE]; + uint8_t refs[TGSI_QUAD_SIZE]; for (j = 0; j < TGSI_QUAD_SIZE; j++) { newstencil[j] = data->stencilVals[j]; @@ -621,7 +621,7 @@ depth_stencil_test_quad(struct quad_stage *qs, { struct softpipe_context *softpipe = qs->softpipe; unsigned func, zFailOp, zPassOp, failOp; - ubyte ref, wrtMask, valMask; + uint8_t ref, wrtMask, valMask; uint face = quad->input.facing; if (!softpipe->depth_stencil->stencil[1].enabled) { diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test_tmp.h b/src/gallium/drivers/softpipe/sp_quad_depth_test_tmp.h index 7128bf8..2b56289 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test_tmp.h +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test_tmp.h @@ -59,17 +59,17 @@ NAME(struct quad_stage *qs, const float dzdy = quads[0]->posCoef->dady[2]; const float z0 = quads[0]->posCoef->a0[2] + dzdx * fx + dzdy * fy; struct softpipe_cached_tile *tile; - ushort (*depth16)[TILE_SIZE]; - ushort init_idepth[4], idepth[4], depth_step; + uint16_t (*depth16)[TILE_SIZE]; + uint16_t init_idepth[4], idepth[4], depth_step; const float scale = 65535.0; /* compute scaled depth of the four pixels in first quad */ - init_idepth[0] = (ushort)((z0) * scale); - init_idepth[1] = (ushort)((z0 + dzdx) * scale); - init_idepth[2] = (ushort)((z0 + dzdy) * scale); - init_idepth[3] = (ushort)((z0 + dzdx + dzdy) * scale); + init_idepth[0] = (uint16_t)((z0) * scale); + init_idepth[1] = (uint16_t)((z0 + dzdx) * scale); + init_idepth[2] = (uint16_t)((z0 + dzdy) * scale); + init_idepth[3] = (uint16_t)((z0 + dzdx + dzdy) * scale); - depth_step = (ushort)(dzdx * scale); + depth_step = (uint16_t)(dzdx * scale); tile = sp_get_cached_tile(qs->softpipe->zsbuf_cache, ix, iy, quads[0]->input.layer); @@ -84,7 +84,7 @@ NAME(struct quad_stage *qs, idepth[2] = init_idepth[2] + dx * depth_step; idepth[3] = init_idepth[3] + dx * depth_step; - depth16 = (ushort (*)[TILE_SIZE]) + depth16 = (uint16_t (*)[TILE_SIZE]) &tile->data.depth16[iy % TILE_SIZE][(ix + dx)% TILE_SIZE]; #ifdef ALWAYS @@ -130,7 +130,7 @@ NAME(struct quad_stage *qs, } #endif - depth16 = (ushort (*)[TILE_SIZE]) &depth16[0][2]; + depth16 = (uint16_t (*)[TILE_SIZE]) &depth16[0][2]; quads[i]->inout.mask = mask; if (quads[i]->inout.mask) diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c index 33f58bc..c35d418 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tile_cache.c @@ -298,7 +298,7 @@ clear_tile(struct softpipe_cached_tile *tile, else { for (i = 0; i < TILE_SIZE; i++) { for (j = 0; j < TILE_SIZE; j++) { - tile->data.depth16[i][j] = (ushort) clear_value; + tile->data.depth16[i][j] = (uint16_t) clear_value; } } } diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.h b/src/gallium/drivers/softpipe/sp_tile_cache.h index 3608b79..0d6d93d 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.h +++ b/src/gallium/drivers/softpipe/sp_tile_cache.h @@ -67,12 +67,12 @@ struct softpipe_cached_tile float color[TILE_SIZE][TILE_SIZE][4]; uint color32[TILE_SIZE][TILE_SIZE]; uint depth32[TILE_SIZE][TILE_SIZE]; - ushort depth16[TILE_SIZE][TILE_SIZE]; - ubyte stencil8[TILE_SIZE][TILE_SIZE]; + uint16_t depth16[TILE_SIZE][TILE_SIZE]; + uint8_t stencil8[TILE_SIZE][TILE_SIZE]; uint colorui128[TILE_SIZE][TILE_SIZE][4]; int colori128[TILE_SIZE][TILE_SIZE][4]; uint64_t depth64[TILE_SIZE][TILE_SIZE]; - ubyte any[1]; + uint8_t any[1]; } data; }; diff --git a/src/gallium/drivers/svga/svga_draw.h b/src/gallium/drivers/svga/svga_draw.h index 0981da9..345539a 100644 --- a/src/gallium/drivers/svga/svga_draw.h +++ b/src/gallium/drivers/svga/svga_draw.h @@ -61,7 +61,7 @@ enum pipe_error svga_hwtnl_draw_arrays(struct svga_hwtnl *hwtnl, enum mesa_prim prim, unsigned start, unsigned count, unsigned start_instance, unsigned instance_count, - ubyte vertices_per_patch); + uint8_t vertices_per_patch); enum pipe_error svga_hwtnl_draw_range_elements(struct svga_hwtnl *hwtnl, diff --git a/src/gallium/drivers/svga/svga_draw_arrays.c b/src/gallium/drivers/svga/svga_draw_arrays.c index ecd83f4..904c9b7 100644 --- a/src/gallium/drivers/svga/svga_draw_arrays.c +++ b/src/gallium/drivers/svga/svga_draw_arrays.c @@ -176,7 +176,7 @@ static enum pipe_error simple_draw_arrays(struct svga_hwtnl *hwtnl, enum mesa_prim prim, unsigned start, unsigned count, unsigned start_instance, unsigned instance_count, - ubyte vertices_per_patch) + uint8_t vertices_per_patch) { SVGA3dPrimitiveRange range; unsigned hw_prim; @@ -210,7 +210,7 @@ enum pipe_error svga_hwtnl_draw_arrays(struct svga_hwtnl *hwtnl, enum mesa_prim prim, unsigned start, unsigned count, unsigned start_instance, unsigned instance_count, - ubyte vertices_per_patch) + uint8_t vertices_per_patch) { enum mesa_prim gen_prim; unsigned gen_size, gen_nr; diff --git a/src/gallium/drivers/svga/svga_draw_elements.c b/src/gallium/drivers/svga/svga_draw_elements.c index 4dea43d..952ebb7 100644 --- a/src/gallium/drivers/svga/svga_draw_elements.c +++ b/src/gallium/drivers/svga/svga_draw_elements.c @@ -188,7 +188,7 @@ svga_hwtnl_simple_draw_range_elements(struct svga_hwtnl *hwtnl, unsigned count, unsigned start_instance, unsigned instance_count, - ubyte vertices_per_patch) + uint8_t vertices_per_patch) { SVGA3dPrimitiveRange range; unsigned hw_prim; diff --git a/src/gallium/drivers/svga/svga_draw_private.h b/src/gallium/drivers/svga/svga_draw_private.h index d4866e7..329f539 100644 --- a/src/gallium/drivers/svga/svga_draw_private.h +++ b/src/gallium/drivers/svga/svga_draw_private.h @@ -66,7 +66,7 @@ static const unsigned svga_hw_prims = */ static inline SVGA3dPrimitiveType svga_translate_prim(unsigned mode, unsigned vcount, unsigned *prim_count, - ubyte vertices_per_patch) + uint8_t vertices_per_patch) { switch (mode) { case MESA_PRIM_POINTS: @@ -243,6 +243,6 @@ svga_hwtnl_simple_draw_range_elements(struct svga_hwtnl *hwtnl, unsigned count, unsigned start_instance, unsigned instance_count, - ubyte vertices_per_patch); + uint8_t vertices_per_patch); #endif diff --git a/src/gallium/drivers/svga/svga_link.h b/src/gallium/drivers/svga/svga_link.h index eecbabc..558f972 100644 --- a/src/gallium/drivers/svga/svga_link.h +++ b/src/gallium/drivers/svga/svga_link.h @@ -12,11 +12,11 @@ struct shader_linkage unsigned num_inputs; /* number of inputs in the current shader */ unsigned position_index; /* position register index */ unsigned input_map_max; /* highest index of mapped inputs */ - ubyte input_map[PIPE_MAX_SHADER_INPUTS]; + uint8_t input_map[PIPE_MAX_SHADER_INPUTS]; struct { unsigned num_outputs; - ubyte output_map[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t output_map[PIPE_MAX_SHADER_OUTPUTS]; } prevShader; }; diff --git a/src/gallium/drivers/svga/svga_pipe_draw.c b/src/gallium/drivers/svga/svga_pipe_draw.c index ed1e93f..bd88f5b 100644 --- a/src/gallium/drivers/svga/svga_pipe_draw.c +++ b/src/gallium/drivers/svga/svga_pipe_draw.c @@ -61,7 +61,7 @@ static enum pipe_error retry_draw_arrays( struct svga_context *svga, enum mesa_prim prim, unsigned start, unsigned count, unsigned start_instance, unsigned instance_count, - ubyte vertices_per_patch) + uint8_t vertices_per_patch) { enum pipe_error ret; diff --git a/src/gallium/drivers/svga/svga_resource_texture.h b/src/gallium/drivers/svga/svga_resource_texture.h index e1d82db..bad5c18 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.h +++ b/src/gallium/drivers/svga/svga_resource_texture.h @@ -48,7 +48,7 @@ struct svga_texture { struct pipe_resource b; - ushort *defined; + uint16_t *defined; struct svga_sampler_view *cached_view; @@ -93,12 +93,12 @@ struct svga_texture unsigned size; /**< Approximate size in bytes */ /** array indexed by cube face or 3D/array slice, one bit per mipmap level */ - ushort *rendered_to; + uint16_t *rendered_to; /** array indexed by cube face or 3D/array slice, one bit per mipmap level. * Set if the level is marked as dirty. */ - ushort *dirty; + uint16_t *dirty; enum svga_surface_state surface_state; diff --git a/src/gallium/drivers/svga/svga_shader.h b/src/gallium/drivers/svga/svga_shader.h index bdc56a3..c164398 100644 --- a/src/gallium/drivers/svga/svga_shader.h +++ b/src/gallium/drivers/svga/svga_shader.h @@ -300,15 +300,15 @@ struct svga_cs_variant struct svga_shader_info { - ubyte num_inputs; - ubyte num_outputs; - - ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS]; - ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS]; - ubyte input_usage_mask[PIPE_MAX_SHADER_INPUTS]; - ubyte output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; - ubyte output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; - ubyte output_usage_mask[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t num_inputs; + uint8_t num_outputs; + + uint8_t input_semantic_name[PIPE_MAX_SHADER_INPUTS]; + uint8_t input_semantic_index[PIPE_MAX_SHADER_INPUTS]; + uint8_t input_usage_mask[PIPE_MAX_SHADER_INPUTS]; + uint8_t output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t output_usage_mask[PIPE_MAX_SHADER_OUTPUTS]; uint64_t generic_inputs_mask; uint64_t generic_outputs_mask; diff --git a/src/gallium/drivers/svga/svga_swtnl_backend.c b/src/gallium/drivers/svga/svga_swtnl_backend.c index 6f80cbd..7f5f1be 100644 --- a/src/gallium/drivers/svga/svga_swtnl_backend.c +++ b/src/gallium/drivers/svga/svga_swtnl_backend.c @@ -58,8 +58,8 @@ svga_vbuf_render_get_vertex_info(struct vbuf_render *render) static bool svga_vbuf_render_allocate_vertices(struct vbuf_render *render, - ushort vertex_size, - ushort nr_vertices) + uint16_t vertex_size, + uint16_t nr_vertices) { struct svga_vbuf_render *svga_render = svga_vbuf_render(render); struct svga_context *svga = svga_render->svga; @@ -165,8 +165,8 @@ svga_vbuf_render_map_vertices(struct vbuf_render *render) static void svga_vbuf_render_unmap_vertices(struct vbuf_render *render, - ushort min_index, - ushort max_index) + uint16_t min_index, + uint16_t max_index) { struct svga_vbuf_render *svga_render = svga_vbuf_render(render); struct svga_context *svga = svga_render->svga; @@ -313,7 +313,7 @@ svga_vbuf_render_draw_arrays(struct vbuf_render *render, static void svga_vbuf_render_draw_elements(struct vbuf_render *render, - const ushort *indices, + const uint16_t *indices, uint nr_indices) { struct svga_vbuf_render *svga_render = svga_vbuf_render(render); diff --git a/src/gallium/drivers/svga/svga_swtnl_draw.c b/src/gallium/drivers/svga/svga_swtnl_draw.c index d649721..6a56f18 100644 --- a/src/gallium/drivers/svga/svga_swtnl_draw.c +++ b/src/gallium/drivers/svga/svga_swtnl_draw.c @@ -86,14 +86,14 @@ svga_swtnl_draw_vbo(struct svga_context *svga, map = NULL; if (info->index_size) { if (info->has_user_indices) { - map = (ubyte *) info->index.user; + map = (uint8_t *) info->index.user; } else { map = pipe_buffer_map(&svga->pipe, info->index.resource, PIPE_MAP_READ | PIPE_MAP_UNSYNCHRONIZED, &ib_transfer); } draw_set_indexes(draw, - (const ubyte *) map, + (const uint8_t *) map, info->index_size, ~0); } diff --git a/src/gallium/drivers/svga/svga_swtnl_private.h b/src/gallium/drivers/svga/svga_swtnl_private.h index 17cf2bc..b50aed9 100644 --- a/src/gallium/drivers/svga/svga_swtnl_private.h +++ b/src/gallium/drivers/svga/svga_swtnl_private.h @@ -73,8 +73,8 @@ struct svga_vbuf_render { unsigned vdecl_offset; unsigned vdecl_count; - ushort min_index; - ushort max_index; + uint16_t min_index; + uint16_t max_index; }; /** diff --git a/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c b/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c index 524f38e..e23072b 100644 --- a/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c +++ b/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c @@ -516,7 +516,7 @@ vs30_output(struct svga_shader_emitter *emit, /** Translate PIPE_TEXTURE_x to SVGA3DSAMP_x */ -static ubyte +static uint8_t svga_tgsi_sampler_type(const struct svga_shader_emitter *emit, int idx) { switch (emit->sampler_target[idx]) { diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c index 21a7e3e..8ccd2b5 100644 --- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c +++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c @@ -258,8 +258,8 @@ struct svga_shader_emitter_v10 /* Samplers */ unsigned num_samplers; bool sampler_view[PIPE_MAX_SAMPLERS]; /**< True if sampler view exists*/ - ubyte sampler_target[PIPE_MAX_SAMPLERS]; /**< TGSI_TEXTURE_x */ - ubyte sampler_return_type[PIPE_MAX_SAMPLERS]; /**< TGSI_RETURN_TYPE_x */ + uint8_t sampler_target[PIPE_MAX_SAMPLERS]; /**< TGSI_TEXTURE_x */ + uint8_t sampler_return_type[PIPE_MAX_SAMPLERS]; /**< TGSI_RETURN_TYPE_x */ /* Images */ unsigned num_images; @@ -293,10 +293,10 @@ struct svga_shader_emitter_v10 unsigned address_reg_index[MAX_VGPU10_ADDR_REGS]; /* Output register usage masks */ - ubyte output_usage_mask[PIPE_MAX_SHADER_OUTPUTS]; + uint8_t output_usage_mask[PIPE_MAX_SHADER_OUTPUTS]; /* To map TGSI system value index to VGPU shader input indexes */ - ubyte system_value_indexes[MAX_SYSTEM_VALUES]; + uint8_t system_value_indexes[MAX_SYSTEM_VALUES]; struct { /* vertex position scale/translation */ @@ -4237,8 +4237,8 @@ emit_vs_output_declarations(struct svga_shader_emitter_v10 *emit) * for the specified stream. */ static unsigned -output_writemask_for_stream(unsigned stream, ubyte output_streams, - ubyte output_usagemask) +output_writemask_for_stream(unsigned stream, uint8_t output_streams, + uint8_t output_usagemask) { unsigned i; unsigned writemask = 0; diff --git a/src/gallium/frontends/d3d10umd/Resource.cpp b/src/gallium/frontends/d3d10umd/Resource.cpp index 90d0622..a792508 100644 --- a/src/gallium/frontends/d3d10umd/Resource.cpp +++ b/src/gallium/frontends/d3d10umd/Resource.cpp @@ -360,8 +360,8 @@ CreateResource(D3D10DDI_HDEVICE hDevice, // IN assert(map); if (map) { for (int z = 0; z < box.depth; ++z) { - ubyte *dst = (ubyte*)map + z*transfer->layer_stride; - const ubyte *src = (const ubyte*)pInitialDataUP->pSysMem + z*pInitialDataUP->SysMemSlicePitch; + uint8_t *dst = (uint8_t*)map + z*transfer->layer_stride; + const uint8_t *src = (const uint8_t*)pInitialDataUP->pSysMem + z*pInitialDataUP->SysMemSlicePitch; util_copy_rect(dst, templat.format, transfer->stride, @@ -917,8 +917,8 @@ ResourceUpdateSubResourceUP(D3D10DDI_HDEVICE hDevice, // IN assert(map); if (map) { for (int z = 0; z < box.depth; ++z) { - ubyte *dst = (ubyte*)map + z*transfer->layer_stride; - const ubyte *src = (const ubyte*)pSysMemUP + z*DepthPitch; + uint8_t *dst = (uint8_t*)map + z*transfer->layer_stride; + const uint8_t *src = (const uint8_t*)pSysMemUP + z*DepthPitch; util_copy_rect(dst, dst_resource->format, transfer->stride, diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index 26d2d9e..38be62d 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -124,7 +124,7 @@ struct rendering_state { } depth[16]; uint8_t patch_vertices; - ubyte index_size; + uint8_t index_size; unsigned index_offset; struct pipe_resource *index_buffer; struct pipe_constant_buffer const_buffer[LVP_SHADER_STAGES][16]; @@ -2329,14 +2329,14 @@ static void handle_set_stencil_reference(struct vk_cmd_queue_entry *cmd, } static void -copy_depth_rect(ubyte * dst, +copy_depth_rect(uint8_t * dst, enum pipe_format dst_format, unsigned dst_stride, unsigned dst_x, unsigned dst_y, unsigned width, unsigned height, - const ubyte * src, + const uint8_t * src, enum pipe_format src_format, int src_stride, unsigned src_x, @@ -2409,12 +2409,12 @@ copy_depth_rect(ubyte * dst, } static void -copy_depth_box(ubyte *dst, +copy_depth_box(uint8_t *dst, enum pipe_format dst_format, unsigned dst_stride, uint64_t dst_slice_stride, unsigned dst_x, unsigned dst_y, unsigned dst_z, unsigned width, unsigned height, unsigned depth, - const ubyte * src, + const uint8_t * src, enum pipe_format src_format, int src_stride, uint64_t src_slice_stride, unsigned src_x, unsigned src_y, unsigned src_z) @@ -2444,7 +2444,7 @@ static void handle_copy_image_to_buffer2(struct vk_cmd_queue_entry *cmd, LVP_FROM_HANDLE(lvp_image, src_image, copycmd->srcImage); struct pipe_box box, dbox; struct pipe_transfer *src_t, *dst_t; - ubyte *src_data, *dst_data; + uint8_t *src_data, *dst_data; for (uint32_t i = 0; i < copycmd->regionCount; i++) { @@ -2497,7 +2497,7 @@ static void handle_copy_image_to_buffer2(struct vk_cmd_queue_entry *cmd, box.depth, src_data, src_format, src_t->stride, src_t->layer_stride, 0, 0, 0); } else { - util_copy_box((ubyte *)dst_data, src_format, + util_copy_box((uint8_t *)dst_data, src_format, buffer_layout.row_stride_B, buffer_layout.image_stride_B, 0, 0, 0, diff --git a/src/gallium/frontends/osmesa/osmesa.c b/src/gallium/frontends/osmesa/osmesa.c index 3cb0cba..9962f7f 100644 --- a/src/gallium/frontends/osmesa/osmesa.c +++ b/src/gallium/frontends/osmesa/osmesa.c @@ -185,7 +185,7 @@ osmesa_read_buffer(OSMesaContext osmesa, struct pipe_resource *res, void *dst, u_box_2d(0, 0, res->width0, res->height0, &box); struct pipe_transfer *transfer = NULL; - ubyte *src = pipe->texture_map(pipe, res, 0, PIPE_MAP_READ, &box, + uint8_t *src = pipe->texture_map(pipe, res, 0, PIPE_MAP_READ, &box, &transfer); /* @@ -194,7 +194,7 @@ osmesa_read_buffer(OSMesaContext osmesa, struct pipe_resource *res, void *dst, if (y_up) { /* need to flip image upside down */ - dst = (ubyte *)dst + (res->height0 - 1) * dst_stride; + dst = (uint8_t *)dst + (res->height0 - 1) * dst_stride; dst_stride = -dst_stride; } @@ -202,7 +202,7 @@ osmesa_read_buffer(OSMesaContext osmesa, struct pipe_resource *res, void *dst, for (unsigned y = 0; y < res->height0; y++) { memcpy(dst, src, bpp * res->width0); - dst = (ubyte *)dst + dst_stride; + dst = (uint8_t *)dst + dst_stride; src += transfer->stride; } diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 1ebe5f7..8d412f5 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -395,7 +395,7 @@ struct pipe_blend_color struct pipe_stencil_ref { - ubyte ref_value[2]; + uint8_t ref_value[2]; }; @@ -409,10 +409,10 @@ struct pipe_framebuffer_state { uint16_t width, height; uint16_t layers; /**< Number of layers in a no-attachment framebuffer */ - ubyte samples; /**< Number of samples in a no-attachment framebuffer */ + uint8_t samples; /**< Number of samples in a no-attachment framebuffer */ /** multiple color buffers for multiple render targets */ - ubyte nr_cbufs; + uint8_t nr_cbufs; struct pipe_surface *cbufs[PIPE_MAX_COLOR_BUFS]; struct pipe_surface *zsbuf; /**< Z/stencil buffer */ diff --git a/src/mesa/main/shader_types.h b/src/mesa/main/shader_types.h index 79995a4..9e2b614 100644 --- a/src/mesa/main/shader_types.h +++ b/src/mesa/main/shader_types.h @@ -700,10 +700,10 @@ struct gl_vertex_program struct gl_program Base; uint32_t vert_attrib_mask; /**< mask of sourced vertex attribs */ - ubyte num_inputs; + uint8_t num_inputs; /** Maps VARYING_SLOT_x to slot */ - ubyte result_to_output[VARYING_SLOT_MAX]; + uint8_t result_to_output[VARYING_SLOT_MAX]; }; /** diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 11064cd..71bbb3b 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -104,7 +104,7 @@ unpack_bitmap(struct st_context *st, GLint px, GLint py, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap, - ubyte *destBuffer, uint destStride) + uint8_t *destBuffer, uint destStride) { destBuffer += py * destStride + px; @@ -124,7 +124,7 @@ st_make_bitmap_texture(struct gl_context *ctx, GLsizei width, GLsizei height, struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; struct pipe_transfer *transfer; - ubyte *dest; + uint8_t *dest; struct pipe_resource *pt; if (!st->bitmap.tex_format) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 03b9e12..bfbccec 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -956,7 +956,7 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, enum pipe_map_flags usage; struct pipe_transfer *pt; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; - ubyte *stmap; + uint8_t *stmap; struct gl_pixelstore_attrib clippedUnpack = *unpack; GLubyte *sValues; GLuint *zValues; @@ -1030,7 +1030,7 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, switch (pt->resource->format) { case PIPE_FORMAT_S8_UINT: { - ubyte *dest = stmap + spanY * pt->stride; + uint8_t *dest = stmap + spanY * pt->stride; assert(usage == PIPE_MAP_WRITE); memcpy(dest, sValues, width); } @@ -1409,11 +1409,11 @@ copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, struct pipe_context *pipe = st_context(ctx)->pipe; enum pipe_map_flags usage; struct pipe_transfer *ptDraw; - ubyte *drawMap; - ubyte *buffer; + uint8_t *drawMap; + uint8_t *buffer; int i; - buffer = malloc(width * height * sizeof(ubyte)); + buffer = malloc(width * height * sizeof(uint8_t)); if (!buffer) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)"); return; @@ -1462,8 +1462,8 @@ copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, /* draw */ /* XXX PixelZoom not handled yet */ for (i = 0; i < height; i++) { - ubyte *dst; - const ubyte *src; + uint8_t *dst; + const uint8_t *src; int y; y = i; diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index 5680097..e0dc5e9 100644 --- a/src/mesa/state_tracker/st_cb_feedback.c +++ b/src/mesa/state_tracker/st_cb_feedback.c @@ -90,7 +90,7 @@ feedback_vertex(struct gl_context *ctx, const struct draw_context *draw, (struct gl_vertex_program *)ctx->VertexProgram._Current; GLfloat win[4]; const GLfloat *color, *texcoord; - ubyte slot; + uint8_t slot; win[0] = v->data[0][0]; if (_mesa_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index 542224e..d6ff88f 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -119,13 +119,13 @@ rastpos_destroy(struct draw_stage *stage) * else copy the current attrib. */ static void -update_attrib(struct gl_context *ctx, const ubyte *outputMapping, +update_attrib(struct gl_context *ctx, const uint8_t *outputMapping, const struct vertex_header *vert, GLfloat *dest, GLuint result, GLuint defaultAttrib) { const GLfloat *src; - const ubyte k = outputMapping[result]; + const uint8_t k = outputMapping[result]; if (k != 0xff) src = vert->data[k]; else @@ -145,7 +145,7 @@ rastpos_point(struct draw_stage *stage, struct prim_header *prim) const GLfloat height = (GLfloat) ctx->DrawBuffer->Height; struct gl_vertex_program *stvp = (struct gl_vertex_program *)ctx->VertexProgram._Current; - const ubyte *outputMapping = stvp->result_to_output; + const uint8_t *outputMapping = stvp->result_to_output; const GLfloat *pos; GLuint i; diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index dea7554..341c7bf 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -424,7 +424,7 @@ st_ReadPixels(struct gl_context *ctx, GLint x, GLint y, enum pipe_format dst_format, src_format; unsigned bind; struct pipe_transfer *tex_xfer; - ubyte *map = NULL; + uint8_t *map = NULL; int dst_x, dst_y; /* Validate state (to be sure we have up-to-date framebuffer surfaces) diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 0564968..258ffb7 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -199,7 +199,7 @@ copy_to_staging_dest(struct gl_context * ctx, struct pipe_resource *dst, GLenum gl_target = texImage->TexObject->Target; unsigned dims; struct pipe_transfer *tex_xfer; - ubyte *map = NULL; + uint8_t *map = NULL; bool done = false; pixels = _mesa_map_pbo_dest(ctx, &ctx->Pack, pixels); @@ -221,7 +221,7 @@ copy_to_staging_dest(struct gl_context * ctx, struct pipe_resource *dst, GLuint row, slice; for (slice = 0; slice < depth; slice++) { - ubyte *slice_map = map; + uint8_t *slice_map = map; for (row = 0; row < height; row++) { void *dest = _mesa_image_address(dims, &ctx->Pack, pixels, @@ -2285,7 +2285,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims, memcpy(map, src, bytesPerRow); } else { - ubyte *slice_map = map; + uint8_t *slice_map = map; for (row = 0; row < (unsigned) height; row++) { void *src = _mesa_image_address(dims, unpack, pixels, diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index bbe76a0..bc63dfb 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -77,7 +77,7 @@ struct st_bitmap_cache GLboolean empty; /** An I8 texture image: */ - ubyte *buffer; + uint8_t *buffer; }; struct st_bound_handles diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index 5b5420e..3544cb1 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -177,7 +177,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, PIPE_MAP_READ, &ib_transfer); } - draw_set_indexes(draw, (ubyte *)mapped_indices, info->index_size, ~0); + draw_set_indexes(draw, (uint8_t *)mapped_indices, info->index_size, ~0); } /* set constant buffer 0 */ diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 0296ecf..adf4099 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -446,7 +446,7 @@ st_translate_stream_output_info(struct gl_program *prog) /* Determine the (default) output register mapping for each output. */ unsigned num_outputs = 0; - ubyte output_mapping[VARYING_SLOT_TESS_MAX]; + uint8_t output_mapping[VARYING_SLOT_TESS_MAX]; memset(output_mapping, 0, sizeof(output_mapping)); for (unsigned attr = 0; attr < VARYING_SLOT_MAX; attr++) { diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index c38b442..98b53d8 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -349,7 +349,7 @@ print_center_pixel(struct pipe_context *pipe, struct pipe_resource *src) { struct pipe_transfer *xfer; struct pipe_box region; - ubyte *map; + uint8_t *map; region.x = src->width0 / 2; region.y = src->height0 / 2; -- 2.7.4