summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-04-21 04:37:21 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-04-21 04:37:21 +0000
commit09a91eb2d5bd3dcae073e25b08def9bce6cb32b1 (patch)
tree3719f9a7d09ae49da28e356df309cfac1d2580c8 /lib/mesa/src/gallium/auxiliary
parenta09152815d99b8a68f7f5ed0e44bab39dd14a1e5 (diff)
Merge Mesa 21.3.8
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary')
-rw-r--r--lib/mesa/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c2
-rw-r--r--lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.c5
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_threaded_context.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c b/lib/mesa/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
index ee804003c..8abed8703 100644
--- a/lib/mesa/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
+++ b/lib/mesa/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
@@ -316,7 +316,7 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
draw->rasterizer->clip_halfz,
(draw->vs.edgeflag_output ? TRUE : FALSE) );
- draw_pt_so_emit_prepare( fpme->so_emit, gs == NULL );
+ draw_pt_so_emit_prepare( fpme->so_emit, (gs == NULL && tes == NULL));
if (!(opt & PT_PIPELINE)) {
draw_pt_emit_prepare( fpme->emit, out_prim,
diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.c
index 0c9a41aeb..19bd8463d 100644
--- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.c
+++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_sample.c
@@ -1726,7 +1726,10 @@ lp_build_cube_imapos(struct lp_build_context *coord_bld, LLVMValueRef coord)
/* ima = +0.5 / abs(coord); */
LLVMValueRef posHalf = lp_build_const_vec(coord_bld->gallivm, coord_bld->type, 0.5);
LLVMValueRef absCoord = lp_build_abs(coord_bld, coord);
- LLVMValueRef ima = lp_build_div(coord_bld, posHalf, absCoord);
+ /* avoid div by zero */
+ LLVMValueRef sel = lp_build_cmp(coord_bld, PIPE_FUNC_GREATER, absCoord, coord_bld->zero);
+ LLVMValueRef div = lp_build_div(coord_bld, posHalf, absCoord);
+ LLVMValueRef ima = lp_build_select(coord_bld, sel, div, coord_bld->zero);
return ima;
}
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_threaded_context.c b/lib/mesa/src/gallium/auxiliary/util/u_threaded_context.c
index 8eb7f86f1..6cbe2567c 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_threaded_context.c
@@ -2148,11 +2148,9 @@ tc_buffer_map(struct pipe_context *_pipe,
* only get resource_copy_region.
*/
if (usage & PIPE_MAP_DISCARD_RANGE) {
- struct threaded_transfer *ttrans = slab_alloc(&tc->pool_transfers);
+ struct threaded_transfer *ttrans = slab_zalloc(&tc->pool_transfers);
uint8_t *map;
- ttrans->staging = NULL;
-
u_upload_alloc(tc->base.stream_uploader, 0,
box->width + (box->x % tc->map_buffer_alignment),
tc->map_buffer_alignment, &ttrans->b.offset,