aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
Commit message (Collapse)AuthorAgeFilesLines
* gallivm/nir: add tessellation i/o support.Dave Airlie2020-02-283-11/+174
| | | | | | | | | | This add support for the tessellation i/o callbacks. Tessellation requires another level of indirect indexing, and allows fetches from shader outputs. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3841>
* gallivm/tgsi/swr: add mask vec to the tcs storeDave Airlie2020-02-282-2/+3
| | | | | | | | For the nir paths we want to access the mask vector to only store when the mask allows it. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3841>
* gallivm/nir: align store_var param order with load_varDave Airlie2020-02-283-5/+7
| | | | | | | | This was ugly so align load/store to have mostly the same parameter ordering Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3841>
* gallivm/nir: add support for tess system valuesDave Airlie2020-02-282-1/+24
| | | | | | | hooks up the tessellation specific system values in the NIR paths Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3841>
* gallivm/nir: split out 64-bit splitting codeDave Airlie2020-02-281-11/+20
| | | | | | | This just lets it be reused for tess later. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3841>
* gallivm: fix 5 warningsMarek Olšák2020-02-273-4/+5
| | | | | Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3970>
* gallivm/nir: handle mod 0 better.Dave Airlie2020-02-261-3/+19
| | | | | | | | | | I haven't seen this crash but TGSI does it so best align with it to avoid future issues. Fixes: 44a6b0107b3J (gallivm: add nir->llvm translation (v2)) Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3956> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3956>
* gallivm/nir: fix integer divide SIGFPEDave Airlie2020-02-261-5/+16
| | | | | | | | | | | | | | | Blender was crashing with a SIGFPE even though the divide by 0 logic was kicking in. I'm not sure why TGSI doesn't get into this state. The problem was is the numerator was INT_MIN we'd replace the div by 0 with a divide by -1, which is an exception for INT_MIN as INT_MIN/-1 == INT_MAX + 1 (too large for 32-bits). Instead for integer divides just replace the mask values with 0x7fffffff. Also fix up the result handling so it aligns with TGSI usage. (gives 0) Fixes: c717ac1247c3 ("gallivm/nir: wrap idiv to avoid divide by 0 (v2)") Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3956>
* gallivm/tgsi: fix stream id regressionDave Airlie2020-02-261-2/+5
| | | | | | | | | | | | 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>
* gallivm: fix crash in emit_get_buffer_sizeRoland Scheidegger2020-02-201-1/+3
| | | | | | | | | | | Seems a bit odd we extract a value from a vector in the first place (as we always extract the first element), but llvm asserts if using a zero-vector instead of zero as the index element. Fixes piglit crashes for example in arb_shader_storage_buffer_object-layout-std140-write-shader. Reviewed-by: Brian Paul <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3886> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3886>
* gallivm: fix crash with bptc border color samplingRoland Scheidegger2020-02-201-1/+10
| | | | | | | | | | bptc uses fallback for decoding, but still need to handle border color properly. v2: adjust piglit gitlab-ci expectations Reviewed-by: Brian Paul <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3886>
* llvmpipe: Fix another uninitialized value warning, on init_val.Eric Anholt2020-02-181-1/+1
| | | | | | | It's only used in the vote_ieq paths, but gcc doesn't see that. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3867>
* llvmpipe: Silence uninitialized variable warning about "vals"Eric Anholt2020-02-181-1/+1
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3867>
* llvmpipe: Fix warning about uninitialized "op" in the NIR path.Eric Anholt2020-02-181-74/+75
| | | | | | | Similar to TGSI, move the switch statement and use more unreachable(). Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3867>
* llvmpipe: Silence uninitialized variable warning about "chan"Eric Anholt2020-02-181-1/+1
| | | | | | | Both arms of an if define it, but gcc doesn't notice. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3867>
* llvmpipe: Silence "possibly uninitialized value" warning for ssbo_limit.Eric Anholt2020-02-181-2/+2
| | | | | | | | The condition for the use matches the def, but you can't trust a compiler to notice. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3867>
* llvmpipe: Fix real uninitialized use of "atype" for SEMANTIC_FACEEric Anholt2020-02-181-0/+1
| | | | | | Fixes: 502548a09c5a ("gallivm/llvmpipe: add support for front facing in sysval.") Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3867>
* gallivm/s390: fix pass init order on s390 with llvm 8 (v2)Dave Airlie2020-02-151-2/+3
| | | | | | | | | | | llvm 8 has some missing pass dependencies, fix the s390 case as well. v2: add ARM also (Michel) Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3805>
* gallivm/nir: add support for multiple vertex streamsDave Airlie2020-02-072-31/+37
| | | | | | | | This adds support to the nir shader build for multiple vertex streams we store separate stats for each stream, then write them out in the epilogue. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3530>
* gallivm/swr: add stream_id to geom epilogue emitDave Airlie2020-02-073-3/+3
| | | | | | | | | | We want to pass a stream in here so we can write out separate prim/vertex counts for each stream at the end. This also adds an ignore any stream option so we can stage more code Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3530>
* gallium/swr: Fix various asserts and security issuesJan Zielinski2020-02-051-1/+2
| | | | | | | | | | To improve the robustness of the code, we want to better detect issues in testing (using asserts) and use more secure techniques. Reviewed-by: Krzysztof Raszkowski <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3710> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3710>
* gallivm/nir: add missing break for isub.Dave Airlie2020-01-271-1/+1
| | | | | | | | | Pointed out by coverity scan. Fixes: 3adf74f2ef55 ("gallivm: pick integer builders for alu instructions.") Reviewed-by: Bas Nieuwenhuizen <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3571> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3571>
* gallivm: fix find lsbDave Airlie2020-01-231-1/+2
| | | | | | | | | | the GLSL return value is different than the llvm intrinsic. Fixes arb gpu shader5 tests Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3528> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3528>
* galllivm: fix gather offset castingDave Airlie2020-01-231-2/+4
| | | | | | | cast texture offsets to 32-bit integers Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3528>
* gallivm: fix gather component handling.Dave Airlie2020-01-231-2/+3
| | | | | | | Fixes the extended gather test for gpu shader5 Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3528>
* gallium/gallivm: enable linking lp_bld_printf function with C++ codeJan Zielinski2020-01-211-0/+7
| | | | | | | | | To enable linking functions declared in lp_bld_printf.h file with C++, we need to add appropriate macros to the header. Reviewed-by: Krzysztof Raszkowski <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3470> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3470>
* nir: Rename nir_intrinsic_barrier to control_barrierJason Ekstrand2020-01-131-1/+1
| | | | | | | | This is a more explicit name now that we don't want it to be doing any memory barrier stuff for us. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307>
* nir: Add a new memory_barrier_tcs_patch intrinsicJason Ekstrand2020-01-131-0/+1
| | | | | | | | | | | Right now, it's implemented as a no-op for everyone. For most drivers, it's a switch case in the NIR -> whatever which just breaks. For ir3, they already have code to delete tessellation barriers so we just add a case to also delete memory_barrier_tcs_patch. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307>
* llmvpipe: No-op implement more barriersJason Ekstrand2020-01-131-0/+3
| | | | | Acked-by: Dave Airlie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307>
* llvmpipe: add ARB_derivative_control supportDave Airlie2020-01-101-0/+4
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/gallivm/tgsi: enable tessellation shadersJan Zielinski2019-12-303-97/+552
| | | | | | | | | | | | | | | | | | | | Tessellation Control and Evaluation shaders are implementing tessellation and require special handling of their inputs and outputs. TCS can write out not only per-vertex, but also per-patch (per-primitive) attributes and tessellation factor values that control the tessellator. TES can read TCS outputs, plus must be feeded with new system values (tessellation coordinates) that are outputs of the tessellator fixed function. TCS can also contain calls to barrier() function (similar to compute shaders). Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Alok Hota <[email protected]>
* llvmpipe: enable ARB_shader_group_vote.Dave Airlie2019-12-303-0/+64
| | | | | | | | | | This just adds the NIR paths for shader group vote. v2: drop feq for now. (Roland) Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3213> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3213>
* gallivm: fixup const int64 builder.Dave Airlie2019-12-281-1/+1
| | | | | | | | Pointed out by Ilia. Fixes: 84ba00877496 (gallivm: add 64-bit const int creator.) Reviewed-by: Ilia Mirkin <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]>
* gallivm/nir: add vec8/16 supportDave Airlie2019-12-271-2/+4
| | | | Acked-by: Roland Scheidegger <[email protected]>
* gallivm/nir: lower packingDave Airlie2019-12-271-0/+1
| | | | | | | This fixes some CL upsample tests, which lower into packing that needs lowering. Acked-by: Roland Scheidegger <[email protected]>
* gallivm: handle non-32 bit undefinedDave Airlie2019-12-271-1/+2
| | | | | | other sized undefs caused llvm asserts Acked-by: Roland Scheidegger <[email protected]>
* llvmpipe/nir: use nir_max_vec_components in more placesDave Airlie2019-12-273-46/+46
| | | | | | This is prep work for when vec8/16 have landed. Acked-by: Roland Scheidegger <[email protected]>
* gallivm/llvmpipe: add support for global operations.Dave Airlie2019-12-273-0/+269
| | | | Acked-by: Roland Scheidegger <[email protected]>
* gallivm/llvmpipe: add support for block size intrinsicDave Airlie2019-12-273-0/+6
| | | | | | | We have to pass the main block size into the coroutine and into the shader. Acked-by: Roland Scheidegger <[email protected]>
* gallivm/llvmpipe: add support for work dimension intrinsic.Dave Airlie2019-12-273-0/+5
| | | | | | We have to pass the work_dim given by the user into the shader. Acked-by: Roland Scheidegger <[email protected]>
* gallivm/nir: allow 8/16-bit conversion and comparison.Dave Airlie2019-12-271-3/+29
| | | | | | This adds the convert to 8/16 and support for 8/16 comparsions Acked-by: Roland Scheidegger <[email protected]>
* gallivm: pick integer builders for alu instructions.Dave Airlie2019-12-271-17/+46
| | | | | | This allows these to be used with non 32-bit types. Acked-by: Roland Scheidegger <[email protected]>
* gallivm: add support for 8-bit/16-bit integer buildersDave Airlie2019-12-273-14/+68
| | | | Acked-by: Roland Scheidegger <[email protected]>
* llvmpipe/gallivm: add kernel inputsDave Airlie2019-12-274-1/+65
| | | | | | compute shaders need kernel input support Acked-by: Roland Scheidegger <[email protected]>
* gallivm: add 64-bit const int creator.Dave Airlie2019-12-271-0/+5
| | | | Acked-by: Roland Scheidegger <[email protected]>
* gallivm/nir: wrap idiv to avoid divide by 0 (v2)Dave Airlie2019-12-211-4/+21
| | | | | | | | | | This code is taken from the TGSI paths, and should fix the regression seens with GLES2 v2: use the udiv path which has d3d10 defined return. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2303>
* gallivm: fixup base_vertex supportDave Airlie2019-12-122-0/+4
| | | | | | | base vertex should be 0 for non-indexed draws according to the piglit tests. Reviewed-by: Roland Scheidegger <[email protected]>
* gallivm/draw: add support for draw_id system value.Dave Airlie2019-12-124-0/+10
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* gallivm: add base instance sysval supportDave Airlie2019-12-124-0/+10
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* gallivm/nir: copy compare ordering code from tgsiDave Airlie2019-12-121-1/+6
| | | | | | | This fixes some isinf/isnan tests copying what the tgsi code paths do for float compares Reviewed-by: Roland Scheidegger <[email protected]>