diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-04-02 09:30:07 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-04-02 09:30:07 +0000 |
commit | f54e142455cb3c9d1662dae7e096a32a47e5409b (patch) | |
tree | 440ecd46269f0eac25e349e1ed58f246490c5e26 /lib/mesa/src/gallium/drivers/softpipe | |
parent | 36d8503c27530f68d655d3ef77a6eaa4dfd8ad65 (diff) |
Import Mesa 23.3.6
Diffstat (limited to 'lib/mesa/src/gallium/drivers/softpipe')
19 files changed, 145 insertions, 128 deletions
diff --git a/lib/mesa/src/gallium/drivers/softpipe/ci/gitlab-ci-inc.yml b/lib/mesa/src/gallium/drivers/softpipe/ci/gitlab-ci-inc.yml new file mode 100644 index 000000000..645637443 --- /dev/null +++ b/lib/mesa/src/gallium/drivers/softpipe/ci/gitlab-ci-inc.yml @@ -0,0 +1,25 @@ +.softpipe-rules: + stage: software-renderer + rules: + - !reference [.gl-rules, rules] + - changes: &softpipe_file_list + - src/gallium/drivers/softpipe/**/* + - src/gallium/winsys/sw/**/* + when: on_success + +.softpipe-test: + variables: + GPU_VERSION: softpipe + LIBGL_ALWAYS_SOFTWARE: "true" + FLAKES_CHANNEL: "#mesa-swrast-ci" + GALLIUM_DRIVER: "softpipe" + +.softpipe-deqp-test: + extends: + - .test-gl + - .deqp-test + - .softpipe-test + # this must be last to avoid breaking dependency rules + - .softpipe-rules + variables: + DEQP_EXPECTED_RENDERER: softpipe diff --git a/lib/mesa/src/gallium/drivers/softpipe/ci/gitlab-ci.yml b/lib/mesa/src/gallium/drivers/softpipe/ci/gitlab-ci.yml index 40554a7a9..3f4fa1cd5 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/ci/gitlab-ci.yml +++ b/lib/mesa/src/gallium/drivers/softpipe/ci/gitlab-ci.yml @@ -1,19 +1,5 @@ -.softpipe-test: - variables: - GPU_VERSION: softpipe - LIBGL_ALWAYS_SOFTWARE: "true" - FLAKES_CHANNEL: "#mesa-swrast-ci" - GALLIUM_DRIVER: "softpipe" - -.softpipe-deqp-test: - extends: - - .test-gl - - .deqp-test - - .softpipe-test - # this must be last to avoid breaking dependency rules - - .softpipe-rules - variables: - DEQP_EXPECTED_RENDERER: softpipe +include: + - local: 'src/gallium/drivers/softpipe/ci/gitlab-ci-inc.yml' softpipe: variables: @@ -30,8 +16,8 @@ softpipe-asan-gles31: GPU_VERSION: softpipe-asan DEQP_FRACTION: 10 DEQP_VER: gles31 - DEQP_RUNNER_OPTIONS: "--env LD_PRELOAD=libasan.so.6" + DEQP_RUNNER_OPTIONS: "--env LD_PRELOAD=libasan.so.8" extends: .softpipe-deqp-test needs: - - debian/x86_test-gl + - debian/x86_64_test-gl - debian-testing-asan diff --git a/lib/mesa/src/gallium/drivers/softpipe/ci/softpipe-fails.txt b/lib/mesa/src/gallium/drivers/softpipe/ci/softpipe-fails.txt index f61f9e7a7..cc3090165 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/ci/softpipe-fails.txt +++ b/lib/mesa/src/gallium/drivers/softpipe/ci/softpipe-fails.txt @@ -992,7 +992,6 @@ spec@!opengl 3.2@layered-rendering@clear-color-all-types 2d_multisample_array si spec@!opengl 3.2@minmax,Fail spec@!opengl 3.2@pointsprite-origin,Fail spec@!opengl 3.3@minmax,Fail -spec@!opengl es 3.0@gles-3.0-transform-feedback-uniform-buffer-object,Fail spec@!opengl es 3.0@minmax,Fail spec@arb_blend_func_extended@arb_blend_func_extended-fbo-extended-blend-pattern_gles2,Crash spec@arb_color_buffer_float@gl_rgba8_snorm-render,Fail @@ -1275,4 +1274,12 @@ spec@!opengl 1.0@depth-clear-precision-check,Fail spec@!opengl 1.0@depth-clear-precision-check@depth32,Fail spec@arb_texture_buffer_object@texture-buffer-size-clamp,Fail +spec@nv_shader_atomic_float@execution@ssbo-atomicexchange-float,Fail +spec@arb_viewport_array@display-list,Fail +spec@arb_texture_buffer_object@texture-buffer-size-clamp@r8ui_texture_buffer_size_via_image,Fail +spec@arb_texture_buffer_object@texture-buffer-size-clamp@r8ui_texture_buffer_size_via_sampler,Fail +spec@arb_texture_buffer_object@texture-buffer-size-clamp@rg8ui_texture_buffer_size_via_image,Fail +spec@arb_texture_buffer_object@texture-buffer-size-clamp@rg8ui_texture_buffer_size_via_sampler,Fail +spec@arb_texture_buffer_object@texture-buffer-size-clamp@rgba8ui_texture_buffer_size_via_image,Fail +spec@arb_texture_buffer_object@texture-buffer-size-clamp@rgba8ui_texture_buffer_size_via_sampler,Fail diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_clear.c b/lib/mesa/src/gallium/drivers/softpipe/sp_clear.c index 7ad4b0946..bc896db07 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_clear.c +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_clear.c @@ -65,7 +65,7 @@ softpipe_clear(struct pipe_context *pipe, unsigned buffers, return; #if 0 - softpipe_update_derived(softpipe, PIPE_PRIM_TRIANGLES); /* not needed?? */ + softpipe_update_derived(softpipe, MESA_PRIM_TRIANGLES); /* not needed?? */ #endif if (buffers & PIPE_CLEAR_COLOR) { @@ -89,5 +89,5 @@ softpipe_clear(struct pipe_context *pipe, unsigned buffers, sp_tile_cache_clear(softpipe->zsbuf_cache, &zero, cv); } - softpipe->dirty_render_cache = TRUE; + softpipe->dirty_render_cache = true; } diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_fence.c b/lib/mesa/src/gallium/drivers/softpipe/sp_fence.c index 64ed9de47..3b8c0496d 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_fence.c +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_fence.c @@ -47,7 +47,7 @@ softpipe_fence_finish(struct pipe_screen *screen, uint64_t timeout) { assert(fence); - return TRUE; + return true; } diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/lib/mesa/src/gallium/drivers/softpipe/sp_prim_vbuf.c index 12734314b..d91946377 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_prim_vbuf.c +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_prim_vbuf.c @@ -60,7 +60,7 @@ struct softpipe_vbuf_render struct softpipe_context *softpipe; struct setup_context *setup; - enum pipe_prim_type prim; + enum mesa_prim prim; uint vertex_size; uint nr_vertices; uint vertex_buffer_size; @@ -85,9 +85,9 @@ sp_vbuf_get_vertex_info(struct vbuf_render *vbr) } -static boolean +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 ); @@ -133,7 +133,7 @@ sp_vbuf_unmap_vertices(struct vbuf_render *vbr, static void -sp_vbuf_set_primitive(struct vbuf_render *vbr, enum pipe_prim_type prim) +sp_vbuf_set_primitive(struct vbuf_render *vbr, enum mesa_prim prim) { struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr); struct setup_context *setup_ctx = cvbr->setup; @@ -157,25 +157,25 @@ 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; const unsigned stride = softpipe->vertex_info.size * sizeof(float); const void *vertex_buffer = cvbr->vertex_buffer; struct setup_context *setup = cvbr->setup; - const boolean flatshade_first = softpipe->rasterizer->flatshade_first; + const bool flatshade_first = softpipe->rasterizer->flatshade_first; unsigned i; switch (cvbr->prim) { - case PIPE_PRIM_POINTS: + case MESA_PRIM_POINTS: for (i = 0; i < nr; i++) { sp_setup_point( setup, get_vert(vertex_buffer, indices[i-0], stride) ); } break; - case PIPE_PRIM_LINES: + case MESA_PRIM_LINES: for (i = 1; i < nr; i += 2) { sp_setup_line( setup, get_vert(vertex_buffer, indices[i-1], stride), @@ -183,7 +183,7 @@ sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) } break; - case PIPE_PRIM_LINE_STRIP: + case MESA_PRIM_LINE_STRIP: for (i = 1; i < nr; i ++) { sp_setup_line( setup, get_vert(vertex_buffer, indices[i-1], stride), @@ -191,7 +191,7 @@ sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) } break; - case PIPE_PRIM_LINE_LOOP: + case MESA_PRIM_LINE_LOOP: for (i = 1; i < nr; i ++) { sp_setup_line( setup, get_vert(vertex_buffer, indices[i-1], stride), @@ -204,7 +204,7 @@ sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) } break; - case PIPE_PRIM_TRIANGLES: + case MESA_PRIM_TRIANGLES: for (i = 2; i < nr; i += 3) { sp_setup_tri( setup, get_vert(vertex_buffer, indices[i-2], stride), @@ -213,7 +213,7 @@ sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) } break; - case PIPE_PRIM_TRIANGLE_STRIP: + case MESA_PRIM_TRIANGLE_STRIP: if (flatshade_first) { for (i = 2; i < nr; i += 1) { /* emit first triangle vertex as first triangle vertex */ @@ -235,7 +235,7 @@ sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) } break; - case PIPE_PRIM_TRIANGLE_FAN: + case MESA_PRIM_TRIANGLE_FAN: if (flatshade_first) { for (i = 2; i < nr; i += 1) { /* emit first non-spoke vertex as first vertex */ @@ -256,7 +256,7 @@ sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) } break; - case PIPE_PRIM_QUADS: + case MESA_PRIM_QUADS: /* GL quads don't follow provoking vertex convention */ if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ @@ -288,7 +288,7 @@ sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) } break; - case PIPE_PRIM_QUAD_STRIP: + case MESA_PRIM_QUAD_STRIP: /* GL quad strips don't follow provoking vertex convention */ if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ @@ -318,7 +318,7 @@ sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) } break; - case PIPE_PRIM_POLYGON: + case MESA_PRIM_POLYGON: /* Almost same as tri fan but the _first_ vertex specifies the flat * shading color. */ @@ -361,18 +361,18 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) const unsigned stride = softpipe->vertex_info.size * sizeof(float); const void *vertex_buffer = (void *) get_vert(cvbr->vertex_buffer, start, stride); - const boolean flatshade_first = softpipe->rasterizer->flatshade_first; + const bool flatshade_first = softpipe->rasterizer->flatshade_first; unsigned i; switch (cvbr->prim) { - case PIPE_PRIM_POINTS: + case MESA_PRIM_POINTS: for (i = 0; i < nr; i++) { sp_setup_point( setup, get_vert(vertex_buffer, i-0, stride) ); } break; - case PIPE_PRIM_LINES: + case MESA_PRIM_LINES: for (i = 1; i < nr; i += 2) { sp_setup_line( setup, get_vert(vertex_buffer, i-1, stride), @@ -380,7 +380,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_LINES_ADJACENCY: + case MESA_PRIM_LINES_ADJACENCY: for (i = 3; i < nr; i += 4) { sp_setup_line( setup, get_vert(vertex_buffer, i-2, stride), @@ -388,7 +388,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_LINE_STRIP: + case MESA_PRIM_LINE_STRIP: for (i = 1; i < nr; i ++) { sp_setup_line( setup, get_vert(vertex_buffer, i-1, stride), @@ -396,7 +396,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_LINE_STRIP_ADJACENCY: + case MESA_PRIM_LINE_STRIP_ADJACENCY: for (i = 3; i < nr; i++) { sp_setup_line( setup, get_vert(vertex_buffer, i-2, stride), @@ -404,7 +404,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_LINE_LOOP: + case MESA_PRIM_LINE_LOOP: for (i = 1; i < nr; i ++) { sp_setup_line( setup, get_vert(vertex_buffer, i-1, stride), @@ -417,7 +417,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_TRIANGLES: + case MESA_PRIM_TRIANGLES: for (i = 2; i < nr; i += 3) { sp_setup_tri( setup, get_vert(vertex_buffer, i-2, stride), @@ -426,7 +426,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_TRIANGLES_ADJACENCY: + case MESA_PRIM_TRIANGLES_ADJACENCY: for (i = 5; i < nr; i += 6) { sp_setup_tri( setup, get_vert(vertex_buffer, i-5, stride), @@ -435,7 +435,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_TRIANGLE_STRIP: + case MESA_PRIM_TRIANGLE_STRIP: if (flatshade_first) { for (i = 2; i < nr; i++) { /* emit first triangle vertex as first triangle vertex */ @@ -456,7 +456,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY: + case MESA_PRIM_TRIANGLE_STRIP_ADJACENCY: if (flatshade_first) { for (i = 5; i < nr; i += 2) { /* emit first triangle vertex as first triangle vertex */ @@ -477,7 +477,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_TRIANGLE_FAN: + case MESA_PRIM_TRIANGLE_FAN: if (flatshade_first) { for (i = 2; i < nr; i += 1) { /* emit first non-spoke vertex as first vertex */ @@ -498,7 +498,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_QUADS: + case MESA_PRIM_QUADS: /* GL quads don't follow provoking vertex convention */ if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ @@ -528,7 +528,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_QUAD_STRIP: + case MESA_PRIM_QUAD_STRIP: /* GL quad strips don't follow provoking vertex convention */ if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ @@ -558,7 +558,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) } break; - case PIPE_PRIM_POLYGON: + case MESA_PRIM_POLYGON: /* Almost same as tri fan but the _first_ vertex specifies the flat * shading color. */ diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_quad_blend.c b/lib/mesa/src/gallium/drivers/softpipe/sp_quad_blend.c index 1a3f92a91..2127be2b3 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_quad_blend.c +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_quad_blend.c @@ -56,7 +56,7 @@ enum format struct blend_quad_stage { struct quad_stage base; - boolean clamp[PIPE_MAX_COLOR_BUFS]; /**< clamp colors to [0,1]? */ + bool clamp[PIPE_MAX_COLOR_BUFS]; /**< clamp colors to [0,1]? */ enum format base_format[PIPE_MAX_COLOR_BUFS]; enum util_format_type format_type[PIPE_MAX_COLOR_BUFS]; }; @@ -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; @@ -925,7 +925,7 @@ blend_fallback(struct quad_stage *qs, struct softpipe_context *softpipe = qs->softpipe; const struct pipe_blend_state *blend = softpipe->blend; unsigned cbuf; - boolean write_all = + bool write_all = softpipe->fs_variant->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS]; for (cbuf = 0; cbuf < softpipe->framebuffer.nr_cbufs; cbuf++) { @@ -937,9 +937,9 @@ blend_fallback(struct quad_stage *qs, = sp_get_cached_tile(softpipe->cbuf_cache[cbuf], quads[0]->input.x0, quads[0]->input.y0, quads[0]->input.layer); - const boolean clamp = bqs->clamp[cbuf]; + const bool clamp = bqs->clamp[cbuf]; const float *blend_color; - const boolean dual_source_blend = util_blend_state_is_dual(blend, cbuf); + const bool dual_source_blend = util_blend_state_is_dual(blend, cbuf); uint q, i, j; if (clamp) diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/lib/mesa/src/gallium/drivers/softpipe/sp_quad_depth_test.c index 17caf75dd..0bde3c999 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_quad_depth_test.c +++ b/lib/mesa/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]; - boolean use_shader_stencil_refs; - ubyte shader_stencil_refs[TGSI_QUAD_SIZE]; + uint8_t stencilVals[TGSI_QUAD_SIZE]; + bool use_shader_stencil_refs; + uint8_t shader_stencil_refs[TGSI_QUAD_SIZE]; struct softpipe_cached_tile *tile; float minval, maxval; bool clamp; @@ -238,7 +238,7 @@ convert_quad_stencil( struct depth_data *data, { unsigned j; - data->use_shader_stencil_refs = TRUE; + data->use_shader_stencil_refs = true; /* Copy quads stencil values */ switch (data->format) { @@ -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]; @@ -533,7 +533,7 @@ apply_stencil_op(struct depth_data *data, * of this function that are specifically for Z16, Z32 and FP Z buffers. * Try to effectively do that with codegen... */ -static boolean +static bool depth_test_quad(struct quad_stage *qs, struct depth_data *data, struct quad_header *quad) @@ -591,7 +591,7 @@ depth_test_quad(struct quad_stage *qs, quad->inout.mask &= zmask; if (quad->inout.mask == 0) - return FALSE; + return false; /* Update our internal copy only if writemask set. Even if * depth.writemask is FALSE, may still need to write out buffer @@ -605,7 +605,7 @@ depth_test_quad(struct quad_stage *qs, } } - return TRUE; + return true; } @@ -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) { @@ -849,13 +849,13 @@ depth_test_quads_fallback(struct quad_stage *qs, { unsigned i, pass = 0; const struct tgsi_shader_info *fsInfo = &qs->softpipe->fs_variant->info; - boolean interp_depth = !fsInfo->writes_z || qs->softpipe->early_depth; - boolean shader_stencil_ref = fsInfo->writes_stencil; - boolean have_zs = !!qs->softpipe->framebuffer.zsbuf; + bool interp_depth = !fsInfo->writes_z || qs->softpipe->early_depth; + bool shader_stencil_ref = fsInfo->writes_stencil; + bool have_zs = !!qs->softpipe->framebuffer.zsbuf; struct depth_data data; unsigned vp_idx = quads[0]->input.viewport_index; - data.use_shader_stencil_refs = FALSE; + data.use_shader_stencil_refs = false; if (have_zs && (qs->softpipe->depth_stencil->depth_enabled || qs->softpipe->depth_stencil->stencil[0].enabled || @@ -988,26 +988,26 @@ choose_depth_test(struct quad_stage *qs, { const struct tgsi_shader_info *fsInfo = &qs->softpipe->fs_variant->info; - boolean interp_depth = !fsInfo->writes_z || qs->softpipe->early_depth; + bool interp_depth = !fsInfo->writes_z || qs->softpipe->early_depth; - boolean alpha = qs->softpipe->depth_stencil->alpha_enabled; + bool alpha = qs->softpipe->depth_stencil->alpha_enabled; - boolean depth = qs->softpipe->depth_stencil->depth_enabled; + bool depth = qs->softpipe->depth_stencil->depth_enabled; unsigned depthfunc = qs->softpipe->depth_stencil->depth_func; - boolean stencil = qs->softpipe->depth_stencil->stencil[0].enabled; + bool stencil = qs->softpipe->depth_stencil->stencil[0].enabled; - boolean depthwrite = qs->softpipe->depth_stencil->depth_writemask; + bool depthwrite = qs->softpipe->depth_stencil->depth_writemask; - boolean occlusion = qs->softpipe->active_query_count; + bool occlusion = qs->softpipe->active_query_count; - boolean clipped = !qs->softpipe->rasterizer->depth_clip_near; + bool clipped = !qs->softpipe->rasterizer->depth_clip_near; - boolean depth_bounds = qs->softpipe->depth_stencil->depth_bounds_test; + bool depth_bounds = qs->softpipe->depth_stencil->depth_bounds_test; if(!qs->softpipe->framebuffer.zsbuf) - depth = depthwrite = stencil = FALSE; + depth = depthwrite = stencil = false; /* default */ qs->run = depth_test_quads_fallback; diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_quad_depth_test_tmp.h b/lib/mesa/src/gallium/drivers/softpipe/sp_quad_depth_test_tmp.h index 7128bf848..2b562892a 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_quad_depth_test_tmp.h +++ b/lib/mesa/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/lib/mesa/src/gallium/drivers/softpipe/sp_quad_pipe.c b/lib/mesa/src/gallium/drivers/softpipe/sp_quad_pipe.c index 444509104..b11be303f 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_quad_pipe.c +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_quad_pipe.c @@ -42,7 +42,7 @@ insert_stage_at_head(struct softpipe_context *sp, struct quad_stage *quad) void sp_build_quad_pipeline(struct softpipe_context *sp) { - boolean early_depth_test = + bool early_depth_test = (sp->depth_stencil->depth_enabled && sp->framebuffer.zsbuf && !sp->depth_stencil->alpha_enabled && diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_query.c b/lib/mesa/src/gallium/drivers/softpipe/sp_query.c index 6a6fa4952..1a2b7d17a 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_query.c +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_query.c @@ -310,16 +310,16 @@ is_result_nonzero(struct pipe_query *q, * Called by rendering function to check rendering is conditional. * \return TRUE if we should render, FALSE if we should skip rendering */ -boolean +bool softpipe_check_render_cond(struct softpipe_context *sp) { struct pipe_context *pipe = &sp->pipe; - boolean b, wait; + bool b, wait; union pipe_query_result result; memset(&result, 0, sizeof(union pipe_query_result)); if (!sp->render_cond_query) { - return TRUE; /* no query predicate, draw normally */ + return true; /* no query predicate, draw normally */ } wait = (sp->render_cond_mode == PIPE_RENDER_COND_WAIT || @@ -330,7 +330,7 @@ softpipe_check_render_cond(struct softpipe_context *sp) if (b) return !is_result_nonzero(sp->render_cond_query, &result) == sp->render_cond_cond; else - return TRUE; + return true; } diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_query.h b/lib/mesa/src/gallium/drivers/softpipe/sp_query.h index 8ac766043..2ce526161 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_query.h +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_query.h @@ -32,7 +32,7 @@ #ifndef SP_QUERY_H #define SP_QUERY_H -extern boolean +extern bool softpipe_check_render_cond(struct softpipe_context *sp); diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_screen.h b/lib/mesa/src/gallium/drivers/softpipe/sp_screen.h index 755ba00ee..06ac15b09 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_screen.h +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_screen.h @@ -46,7 +46,7 @@ struct softpipe_screen { * this. */ unsigned timestamp; - boolean use_llvm; + bool use_llvm; }; static inline struct softpipe_screen * @@ -64,7 +64,6 @@ enum sp_debug_flag { SP_DBG_CS = BITFIELD_BIT(5), SP_DBG_USE_LLVM = BITFIELD_BIT(6), SP_DBG_NO_RAST = BITFIELD_BIT(7), - SP_DBG_USE_TGSI = BITFIELD_BIT(8), }; extern int sp_debug; diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_setup.c b/lib/mesa/src/gallium/drivers/softpipe/sp_setup.c index 496e14d91..c3c660cee 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_setup.c +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_setup.c @@ -285,7 +285,7 @@ print_vertex(const struct setup_context *setup, * edge fields (ebot, emaj, etop). * \return FALSE if coords are inf/nan (cull the tri), TRUE otherwise */ -static boolean +static bool setup_sort_vertices(struct setup_context *setup, float det, const float (*v0)[4], @@ -372,7 +372,7 @@ setup_sort_vertices(struct setup_context *setup, __func__, setup->oneoverarea, area, det ); */ if (util_is_inf_or_nan(setup->oneoverarea)) - return FALSE; + return false; } /* We need to know if this is a front or back-facing triangle for: @@ -388,10 +388,10 @@ setup_sort_vertices(struct setup_context *setup, unsigned face = setup->facing == 0 ? PIPE_FACE_FRONT : PIPE_FACE_BACK; if (face & setup->cull_face) - return FALSE; + return false; } - return TRUE; + return true; } @@ -506,9 +506,9 @@ static void setup_fragcoord_coeff(struct setup_context *setup, uint slot) { const struct tgsi_shader_info *fsInfo = &setup->softpipe->fs_variant->info; - boolean origin_lower_left = + bool origin_lower_left = fsInfo->properties[TGSI_PROPERTY_FS_COORD_ORIGIN]; - boolean pixel_center_integer = + bool pixel_center_integer = fsInfo->properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER]; /*X*/ @@ -779,7 +779,7 @@ sp_setup_tri(struct setup_context *setup, setup_tri_coefficients( setup ); setup_tri_edges( setup ); - assert(setup->softpipe->reduced_prim == PIPE_PRIM_TRIANGLES); + assert(setup->softpipe->reduced_prim == MESA_PRIM_TRIANGLES); setup->span.y = 0; setup->span.right[0] = 0; @@ -876,7 +876,7 @@ line_persp_coeff(const struct setup_context *setup, * Compute the setup->coef[] array dadx, dady, a0 values. * Must be called after setup->vmin,vmax are initialized. */ -static boolean +static bool setup_line_coefficients(struct setup_context *setup, const float (*v0)[4], const float (*v1)[4]) @@ -904,7 +904,7 @@ setup_line_coefficients(struct setup_context *setup, /* NOTE: this is not really area but something proportional to it */ area = setup->emaj.dx * setup->emaj.dx + setup->emaj.dy * setup->emaj.dy; if (area == 0.0f || util_is_inf_or_nan(area)) - return FALSE; + return false; setup->oneoverarea = 1.0f / area; /* z and w are done by linear interpolation: @@ -956,7 +956,7 @@ setup_line_coefficients(struct setup_context *setup, setup->coef[fragSlot].dady[0] = 0.0; } } - return TRUE; + return true; } @@ -1048,7 +1048,7 @@ sp_setup_line(struct setup_context *setup, assert(dx >= 0); assert(dy >= 0); - assert(setup->softpipe->reduced_prim == PIPE_PRIM_LINES); + assert(setup->softpipe->reduced_prim == MESA_PRIM_LINES); setup->quad[0].input.x0 = setup->quad[0].input.y0 = -1; setup->quad[0].inout.mask = 0x0; @@ -1149,7 +1149,7 @@ sp_setup_point(struct setup_context *setup, = sizeAttr > 0 ? v0[sizeAttr][0] : setup->softpipe->rasterizer->point_size; const float halfSize = 0.5F * size; - const boolean round = (boolean) setup->softpipe->rasterizer->point_smooth; + const bool round = (bool) setup->softpipe->rasterizer->point_smooth; const float x = v0[0][0]; /* Note: data[0] is always position */ const float y = v0[0][1]; const struct sp_setup_info *sinfo = &softpipe->setup_info; @@ -1167,7 +1167,7 @@ sp_setup_point(struct setup_context *setup, setup->softpipe->rasterizer->rasterizer_discard) return; - assert(setup->softpipe->reduced_prim == PIPE_PRIM_POINTS); + assert(setup->softpipe->reduced_prim == MESA_PRIM_POINTS); if (setup->softpipe->layer_slot > 0) { layer = *(unsigned *)v0[setup->softpipe->layer_slot]; @@ -1403,7 +1403,7 @@ sp_setup_prepare(struct setup_context *setup) sp->quad.first->begin( sp->quad.first ); - if (sp->reduced_api_prim == PIPE_PRIM_TRIANGLES && + if (sp->reduced_api_prim == MESA_PRIM_TRIANGLES && sp->rasterizer->fill_front == PIPE_POLYGON_MODE_FILL && sp->rasterizer->fill_back == PIPE_POLYGON_MODE_FILL) { /* we'll do culling */ diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.c b/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.c index 30bca7557..4bc8e3e4a 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.c +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.c @@ -102,12 +102,12 @@ sp_tex_tile_cache_validate_texture(struct softpipe_tex_tile_cache *tc) } } -static boolean +static bool sp_tex_tile_is_compat_view(struct softpipe_tex_tile_cache *tc, struct pipe_sampler_view *view) { if (!view) - return FALSE; + return false; return (tc->texture == view->texture && tc->format == view->format && tc->swizzle_r == view->swizzle_r && diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.h b/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.h index 2e4635f38..a6bb2eb5a 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.h +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.h @@ -29,7 +29,7 @@ #define SP_TEX_TILE_CACHE_H -#include "pipe/p_compiler.h" +#include "util/compiler.h" #include "sp_limits.h" diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_texture.h b/lib/mesa/src/gallium/drivers/softpipe/sp_texture.h index 450c4b1ce..18870df6c 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_texture.h +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_texture.h @@ -62,8 +62,8 @@ struct softpipe_resource /* True if texture images are power-of-two in all dimensions: */ - boolean pot; - boolean userBuffer; + bool pot; + bool userBuffer; unsigned timestamp; }; diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.c b/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.c index 33f58bcca..c35d418a3 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.c +++ b/lib/mesa/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/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.h b/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.h index 2c0bafad6..dbb46d32d 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.h +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.h @@ -29,7 +29,7 @@ #define SP_TILE_CACHE_H -#include "pipe/p_compiler.h" +#include "util/compiler.h" #include "sp_texture.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; }; @@ -93,7 +93,7 @@ struct softpipe_tile_cache uint clear_flags_size; union pipe_color_union clear_color; /**< for color bufs */ uint64_t clear_val; /**< for z+stencil */ - boolean depth_stencil; /**< Is the surface a depth/stencil format? */ + bool depth_stencil; /**< Is the surface a depth/stencil format? */ struct softpipe_cached_tile *tile; /**< scratch tile for clears */ |