diff options
author | Dave Airlie <[email protected]> | 2020-02-26 07:03:33 +1000 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-26 22:33:18 +0000 |
commit | 954cf8e86b6e0d52c04098604d2daa4305bf6f70 (patch) | |
tree | 653142398028efd555e3036d9976b1f028cb8f7a /src | |
parent | 4449611ffbb0087a6d2407fb0d25496806df157b (diff) |
gallivm/tgsi: fix stream id regression
This broke TGSI GS shaders with llvmpipe, it wasn't looking at the
right immediates and it should be cast to an integer type.
Fixes: 163d5fde0669 (gallium/swr: Enable GL_ARB_gpu_shader5: multiple streams)
Reviewed-by: Krzysztof Raszkowski <[email protected]>
Acked-by: Jan Zielinski <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3949>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3949>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 8dad6082390..d884c2d232c 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -3944,11 +3944,14 @@ emit_vertex( LLVMBuilderRef builder = bld->bld_base.base.gallivm->builder; if (bld->gs_iface->emit_vertex) { - uint32_t imms_idx = emit_data->inst->Src[0].Register.SwizzleX; - LLVMValueRef stream_id = bld->immediates[0][imms_idx]; + uint32_t stream_reg_idx = emit_data->inst->Src[0].Register.Index; + uint32_t stream_reg_swiz = emit_data->inst->Src[0].Register.SwizzleX; + LLVMValueRef stream_id = bld->immediates[stream_reg_idx][stream_reg_swiz]; LLVMValueRef mask = mask_vec(bld_base); LLVMValueRef total_emitted_vertices_vec = LLVMBuildLoad(builder, bld->total_emitted_vertices_vec_ptr, ""); + + stream_id = LLVMBuildBitCast(builder, stream_id, bld_base->uint_bld.vec_type, ""); mask = clamp_mask_to_max_output_vertices(bld, mask, total_emitted_vertices_vec); gather_outputs(bld); |