diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-11-02 04:34:57 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-11-02 04:34:57 +0000 |
commit | 32aeb3c41fedbbd7b11aacfec48e8f699d16bff0 (patch) | |
tree | fc5893a490729ebf6b87b83eebf5d4ebfdfccf27 /lib/mesa/src/gallium/auxiliary/draw | |
parent | 286ec9d289bada8abb84753c461cfa3432866e98 (diff) |
Import Mesa 23.1.9
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/draw')
10 files changed, 27 insertions, 17 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_decompose_tmp.h b/lib/mesa/src/gallium/auxiliary/draw/draw_decompose_tmp.h index 7686afebe..344c90ae9 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_decompose_tmp.h +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_decompose_tmp.h @@ -56,7 +56,7 @@ FUNC(FUNC_VARS) /* prim, prim_flags, count, and last_vertex_last should have been defined */ if (0) { debug_printf("%s: prim 0x%x, prim_flags 0x%x, count %d, last_vertex_last %d\n", - __FUNCTION__, prim, prim_flags, count, last_vertex_last); + __func__, prim, prim_flags, count, last_vertex_last); } switch (prim) { diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_gs.c b/lib/mesa/src/gallium/auxiliary/draw/draw_gs.c index a3aaf0f44..2810e7da2 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_gs.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_gs.c @@ -123,7 +123,7 @@ tgsi_fetch_gs_outputs(struct draw_geometry_shader *shader, } -/*#define DEBUG_INPUTS 1*/ +#define DEBUG_INPUTS 0 static void tgsi_fetch_gs_input(struct draw_geometry_shader *shader, unsigned *indices, @@ -612,7 +612,7 @@ draw_geometry_shader_run(struct draw_geometry_shader *shader, #if 0 debug_printf("%s count = %d (in prims # = %d, invocs = %d, streams = %d)\n", - __FUNCTION__, num_input_verts, num_in_primitives, + __func__, num_input_verts, num_in_primitives, shader->num_invocations, shader->num_vertex_streams); debug_printf("\tlinear = %d, prim_info->count = %d\n", input_prim->linear, input_prim->count); diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe.c b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe.c index 9be097678..2a7f42245 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe.c @@ -257,7 +257,7 @@ draw_pipeline_run(struct draw_context *draw, } if (max_index >= vert_info->count) { debug_printf("%s: max_index (%u) outside vertex buffer (%u)\n", - __FUNCTION__, + __func__, max_index, vert_info->count); } diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index 1aff54afa..e708c8ade 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -147,7 +147,8 @@ generate_pstip_fs(struct pstip_stage *pstip) } else { pstip_fs.ir.nir = nir_shader_clone(NULL, orig_fs->ir.nir); nir_lower_pstipple_fs(pstip_fs.ir.nir, - &pstip->fs->sampler_unit, 0, wincoord_file == TGSI_FILE_SYSTEM_VALUE); + &pstip->fs->sampler_unit, 0, wincoord_file == TGSI_FILE_SYSTEM_VALUE, + nir_type_bool32); } assert(pstip->fs->sampler_unit < PIPE_MAX_SAMPLERS); diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_pt_emit.c b/lib/mesa/src/gallium/auxiliary/draw/draw_pt_emit.c index e49d0681d..c33e24724 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_pt_emit.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_pt_emit.c @@ -257,7 +257,7 @@ draw_pt_emit_linear(struct pt_emit *emit, if (0) { for (unsigned i = 0; i < count; i++) { - debug_printf("\n\n%s vertex %d:\n", __FUNCTION__, i); + debug_printf("\n\n%s vertex %d:\n", __func__, i); draw_dump_emitted_vertex(emit->vinfo, (const uint8_t *)hw_verts + translate->key.output_stride * i); diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/lib/mesa/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c index 5efbee7e8..69461e0a3 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c @@ -119,7 +119,7 @@ fse_prepare(struct draw_pt_middle_end *middle, } if (0) debug_printf("%s: lookup const_vbuffers: %x\n", - __FUNCTION__, fse->key.const_vbuffers); + __func__, fse->key.const_vbuffers); { unsigned dst_offset = 0; @@ -150,7 +150,7 @@ fse_prepare(struct draw_pt_middle_end *middle, return ; } - if (0) debug_printf("%s: found const_vbuffers: %x\n", __FUNCTION__, + if (0) debug_printf("%s: found const_vbuffers: %x\n", __func__, fse->active->key.const_vbuffers); /* Now set buffer pointers: @@ -216,7 +216,7 @@ fse_run_linear(struct draw_pt_middle_end *middle, if (0) { for (unsigned i = 0; i < count; i++) { debug_printf("\n\n%s vertex %d: (stride %d, offset %d)\n", - __FUNCTION__, i, + __func__, i, fse->key.output_stride, fse->key.output_stride * i); @@ -274,7 +274,7 @@ fse_run(struct draw_pt_middle_end *middle, if (0) { for (unsigned i = 0; i < fetch_count; i++) { - debug_printf("\n\n%s vertex %d:\n", __FUNCTION__, i); + debug_printf("\n\n%s vertex %d:\n", __func__, i); draw_dump_emitted_vertex(fse->vinfo, (const uint8_t *)hw_verts + fse->key.output_stride * i); diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_split_tmp.h b/lib/mesa/src/gallium/auxiliary/draw/draw_split_tmp.h index 325a4bac6..3f9b01d27 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_split_tmp.h +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_split_tmp.h @@ -36,7 +36,7 @@ FUNC(FUNC_VARS) if (0) { debug_printf("%s: prim 0x%x, start %d, count %d, max_count_simple %d, " "max_count_loop %d, max_count_fan %d\n", - __FUNCTION__, prim, start, count, max_count_simple, + __func__, prim, start, count, max_count_simple, max_count_loop, max_count_fan); } diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_vs.c b/lib/mesa/src/gallium/auxiliary/draw/draw_vs.c index bdd886f48..e5d88c6e8 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_vs.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_vs.c @@ -47,6 +47,7 @@ #include "tgsi/tgsi_dump.h" #include "tgsi/tgsi_exec.h" +#include "tgsi/tgsi_ureg.h" #include "nir/nir_to_tgsi.h" @@ -65,6 +66,7 @@ draw_create_vertex_shader(struct draw_context *draw, } #ifdef DRAW_LLVM_AVAILABLE + bool is_allocated = false; if (draw->pt.middle.llvm) { struct pipe_screen *screen = draw->pipe->screen; if (shader->type == PIPE_SHADER_IR_NIR && @@ -75,6 +77,7 @@ draw_create_vertex_shader(struct draw_context *draw, PIPE_SHADER_IR_TGSI))) { state.type = PIPE_SHADER_IR_TGSI; state.tokens = nir_to_tgsi(shader->ir.nir, screen); + is_allocated = true; } vs = draw_create_vs_llvm(draw, &state); } @@ -84,6 +87,12 @@ draw_create_vertex_shader(struct draw_context *draw, vs = draw_create_vs_exec(draw, &state); } +#ifdef DRAW_LLVM_AVAILABLE + if (is_allocated) { + ureg_free_tokens(state.tokens); + } +#endif + if (vs) { bool found_clipvertex = FALSE; vs->position_output = -1; diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_vs.h b/lib/mesa/src/gallium/auxiliary/draw/draw_vs.h index e31d23724..2732a9d22 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_vs.h +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_vs.h @@ -79,12 +79,12 @@ struct draw_vs_variant { unsigned stride, unsigned max_stride); - void (PIPE_CDECL *run_linear)(struct draw_vs_variant *shader, + void (UTIL_CDECL *run_linear)(struct draw_vs_variant *shader, unsigned start, unsigned count, void *output_buffer); - void (PIPE_CDECL *run_elts)(struct draw_vs_variant *shader, + void (UTIL_CDECL *run_elts)(struct draw_vs_variant *shader, const unsigned *elts, unsigned count, void *output_buffer); diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_vs_variant.c b/lib/mesa/src/gallium/auxiliary/draw/draw_vs_variant.c index 354a694c3..74ebf14ea 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_vs_variant.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_vs_variant.c @@ -149,7 +149,7 @@ do_viewport(struct draw_vs_variant_generic *vsvg, } -static void PIPE_CDECL +static void UTIL_CDECL vsvg_run_elts(struct draw_vs_variant *variant, const unsigned *elts, unsigned count, @@ -160,7 +160,7 @@ vsvg_run_elts(struct draw_vs_variant *variant, void *temp_buffer = MALLOC(align(count,4) * temp_vertex_stride + DRAW_EXTRA_VERTICES_PADDING); - if (0) debug_printf("%s %d \n", __FUNCTION__, count); + if (0) debug_printf("%s %d \n", __func__, count); /* Want to do this in small batches for cache locality? */ @@ -214,7 +214,7 @@ vsvg_run_elts(struct draw_vs_variant *variant, } -static void PIPE_CDECL +static void UTIL_CDECL vsvg_run_linear(struct draw_vs_variant *variant, unsigned start, unsigned count, @@ -225,7 +225,7 @@ vsvg_run_linear(struct draw_vs_variant *variant, void *temp_buffer = MALLOC(align(count,4) * temp_vertex_stride + DRAW_EXTRA_VERTICES_PADDING); - if (0) debug_printf("%s %d %d (sz %d, %d)\n", __FUNCTION__, start, count, + if (0) debug_printf("%s %d %d (sz %d, %d)\n", __func__, start, count, vsvg->base.key.output_stride, temp_vertex_stride); |