diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-09-02 05:47:02 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-09-02 05:47:02 +0000 |
commit | 0dbbf1e0708df85a357d70e2708c0a11aeb5480e (patch) | |
tree | 6656ff8eb8b15a2fc1c02888973caf618388cfd0 /lib/mesa/src/gallium/auxiliary/draw | |
parent | 5f66494d31f735486b8222ecfa0a0c9046e92543 (diff) |
Merge Mesa 22.1.7
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/draw')
8 files changed, 20 insertions, 22 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_context.c b/lib/mesa/src/gallium/auxiliary/draw/draw_context.c index 7a9416889..39d3a61b9 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_context.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_context.c @@ -945,6 +945,8 @@ draw_current_shader_outputs(const struct draw_context *draw) { if (draw->gs.geometry_shader) return draw->gs.num_gs_outputs; + if (draw->tes.tess_eval_shader) + return draw->tes.num_tes_outputs; return draw->vs.num_vs_outputs; } diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_llvm.c b/lib/mesa/src/gallium/auxiliary/draw/draw_llvm.c index 483bf62b4..e0d0ebad0 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_llvm.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_llvm.c @@ -3397,6 +3397,8 @@ draw_tcs_llvm_generate(struct draw_llvm *llvm, LLVMSetFunctionCallConv(variant_coro, LLVMCCallConv); + LLVMAddTargetDependentFunctionAttr(variant_coro, "coroutine.presplit", "0"); + for (i = 0; i < ARRAY_SIZE(arg_types); ++i) { if (LLVMGetTypeKind(arg_types[i]) == LLVMPointerTypeKind) { lp_add_function_attr(variant_coro, i + 1, LP_FUNC_ATTR_NOALIAS); diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_aaline.c index 49d5c65b6..7dac40785 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_aaline.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_aaline.c @@ -281,9 +281,6 @@ generate_aaline_fs(struct aaline_stage *aaline) const uint newLen = tgsi_num_tokens(orig_fs->tokens) + NUM_NEW_TOKENS; aaline_fs = *orig_fs; /* copy to init */ - aaline_fs.tokens = tgsi_alloc_tokens(newLen); - if (aaline_fs.tokens == NULL) - return FALSE; memset(&transform, 0, sizeof(transform)); transform.colorOutput = -1; @@ -296,9 +293,9 @@ generate_aaline_fs(struct aaline_stage *aaline) transform.base.transform_instruction = aa_transform_inst; transform.base.transform_declaration = aa_transform_decl; - tgsi_transform_shader(orig_fs->tokens, - (struct tgsi_token *) aaline_fs.tokens, - newLen, &transform.base); + aaline_fs.tokens = tgsi_transform_shader(orig_fs->tokens, newLen, &transform.base); + if (!aaline_fs.tokens) + return false; #if 0 /* DEBUG */ debug_printf("draw_aaline, orig shader:\n"); diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_aapoint.c index 08adcddf6..16ebba3fd 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_aapoint.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_aapoint.c @@ -368,9 +368,6 @@ generate_aapoint_fs(struct aapoint_stage *aapoint) aapoint_fs = *orig_fs; /* copy to init */ assert(aapoint_fs.type == PIPE_SHADER_IR_TGSI); - aapoint_fs.tokens = tgsi_alloc_tokens(newLen); - if (aapoint_fs.tokens == NULL) - return FALSE; memset(&transform, 0, sizeof(transform)); transform.colorOutput = -1; @@ -383,9 +380,9 @@ generate_aapoint_fs(struct aapoint_stage *aapoint) transform.base.transform_instruction = aa_transform_inst; transform.base.transform_declaration = aa_transform_decl; - tgsi_transform_shader(orig_fs->tokens, - (struct tgsi_token *) aapoint_fs.tokens, - newLen, &transform.base); + aapoint_fs.tokens = tgsi_transform_shader(orig_fs->tokens, newLen, &transform.base); + if (!aapoint_fs.tokens) + return false; #if 0 /* DEBUG */ debug_printf("draw_aapoint, orig shader:\n"); diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_user_cull.c b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_user_cull.c index fcc177e04..86968a257 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_user_cull.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_pipe_user_cull.c @@ -38,11 +38,6 @@ struct user_cull_stage { struct draw_stage stage; }; -static inline struct user_cull_stage *user_cull_stage( struct draw_stage *stage ) -{ - return (struct user_cull_stage *)stage; -} - static inline boolean cull_distance_is_out(float dist) { diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_private.h b/lib/mesa/src/gallium/auxiliary/draw/draw_private.h index ffdc8b987..bf3fc0810 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_private.h +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_private.h @@ -359,6 +359,7 @@ struct draw_context struct { struct draw_tess_eval_shader *tess_eval_shader; + uint num_tes_outputs; /**< convenience, from tess_eval_shader */ uint position_output; uint clipvertex_output; diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_pt.c b/lib/mesa/src/gallium/auxiliary/draw/draw_pt.c index f1821878b..8a25b6ea1 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_pt.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_pt.c @@ -154,7 +154,7 @@ draw_pt_arrays(struct draw_context *draw, if (count >= first) frontend->run( frontend, draw_info[i].start, count ); - if (draw->pt.user.increment_draw_id) + if (num_draws > 1 && draw->pt.user.increment_draw_id) draw->pt.user.drawid++; } @@ -524,11 +524,14 @@ draw_vbo(struct draw_context *draw, num_draws = 1; } - if (info->index_size) + if (info->index_size) { assert(draw->pt.user.elts); - - draw->pt.user.min_index = use_info->index_bounds_valid ? use_info->min_index : 0; - draw->pt.user.max_index = use_info->index_bounds_valid ? use_info->max_index : ~0; + draw->pt.user.min_index = use_info->index_bounds_valid ? use_info->min_index : 0; + draw->pt.user.max_index = use_info->index_bounds_valid ? use_info->max_index : ~0; + } else { + draw->pt.user.min_index = 0; + draw->pt.user.max_index = ~0; + } draw->pt.user.eltSize = use_info->index_size ? draw->pt.user.eltSizeIB : 0; draw->pt.user.drawid = drawid_offset; draw->pt.user.increment_draw_id = use_info->increment_draw_id; diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_tess.c b/lib/mesa/src/gallium/auxiliary/draw/draw_tess.c index 7aa64f076..c1742eb03 100644 --- a/lib/mesa/src/gallium/auxiliary/draw/draw_tess.c +++ b/lib/mesa/src/gallium/auxiliary/draw/draw_tess.c @@ -602,6 +602,7 @@ void draw_bind_tess_eval_shader(struct draw_context *draw, draw_do_flush(draw, DRAW_FLUSH_STATE_CHANGE); if (dtes) { draw->tes.tess_eval_shader = dtes; + draw->tes.num_tes_outputs = dtes->info.num_outputs; draw->tes.position_output = dtes->position_output; draw->tes.clipvertex_output = dtes->clipvertex_output; } else { |