aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
Commit message (Collapse)AuthorAgeFilesLines
* gallivm/nir: lower implicit lod to tex.Dave Airlie2020-04-151-0/+3
| | | | | | | Fixes some sampling issues in vertex shaders Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4560>
* gallivm: fix left over shader vote debugDave Airlie2020-04-151-1/+0
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4560>
* gallivm: Add missing header for powf.Vinson Lee2020-04-071-0/+1
| | | | | | | | | | | | | | | | | | | Fix build error after llvm-11 commit 3a29393b4709 ("Remove math.h/cmath include from DataTypes.h"). src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c: In function ‘lp_build_linear_to_srgb’: src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c:194:44: error: implicit declaration of function ‘powf’ [-Werror=implicit-function-declaration] 194 | exp2f_c * powf(coeff_f, 1.0f / exp_f)); | ^~~~ src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c:194:44: warning: incompatible implicit declaration of built-in function ‘powf’ src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c:78:1: note: include ‘<math.h>’ or provide a declaration of ‘powf’ 77 | #include "lp_bld_format.h" +++ |+#include <math.h> 78 | Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4473>
* Revert "gallivm: disable rgtc/latc SNORM accellerated fetches"Dave Airlie2020-04-041-19/+13
| | | | | | | | | | This reverts commit 4897e70ccd3987d470ec8622d473ee3405f6e96f. Fixed in previous commits. Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4425> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4425>
* gallivm/rgtc: enable fast path for snorm types.Dave Airlie2020-04-041-3/+9
| | | | | | | | As per Roland's suggestions it should be easy to enable the fast path fetch for rgtc snorm as well here. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4425>
* gallivm/rgtc: fix the truncation to 8-bitDave Airlie2020-04-041-6/+10
| | | | | | | | | The 8 bit type wasn't 8-bit so when doing signed work we lost the sign bit. This fixes it to use a proper vector type, even if we just end up in here with the 1-wide path for now. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4425>
* gallivm: fix stream id fetchRoland Scheidegger2020-04-021-4/+3
| | | | | | | | | | | | | Fetching the stream id directly can crash since bld->immediates may not exist (if there's too many immediates or we use the array due to indirect accesses). So just call emit_fetch_immediate instead. v2: fix the swizzle Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4416> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4416>
* gallivm: switch the mask6/mask7 cases for signed rgtc formatsRoland Scheidegger2020-04-021-2/+2
| | | | | | | | | This fixes some regressions where -1.0/1.0 results got flipped, but it's still broken in some cases. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4416>
* gallivm: fix rgtc2 formatRoland Scheidegger2020-04-021-0/+2
| | | | | | | | | | In some cases, there can be garbage in the upper bits after the channel decode - for dxt5 this didn't matter (as the upper bits are shifted out anyway) but for rgtc2 formats it does. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4416>
* util: don't include p_defines.h and u_pointer.h from galliumMarek Olšák2020-03-271-0/+1
| | | | | | | It's a mess, but this is what I arrived at. Reviewed-by: Timothy Arceri <[email protected] Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>
* gallivm: disable rgtc/latc SNORM accellerated fetchesRoland Scheidegger2020-03-251-13/+19
| | | | | | | | | | | Unfortunately this appears to be bugged (it seems the piglit tests aren't quite exhaustive enough). I'm almost certain it's the lerp (lp_build_lerpdxta()) which doesn't handle signed numbers correctly, let's disable for now. Reviewed-by: Dave Airlie <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4311> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4311>
* gallium/gallivm: Remove workaround disabling AVX code for newer CPUsJan Zielinski2020-03-231-9/+3
| | | | | | | | | | | | The change enables using full 256-bit AVX and AVX2 instructions on newer platforms. Reviewed-by: Alok Hota <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4225> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4225>
* gallivm: add support for rgtc/latc fetches.Dave Airlie2020-03-233-3/+415
| | | | | | | | | Annoyingly heaven uses rgtc2 snorm but this at least avoids the function call overheads to the util fetch functions. Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3924> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3924>
* gallivm/s3tc: split out dxt5 alpha codeDave Airlie2020-03-231-35/+55
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3924>
* gallium/swr: fix corruptions in Unigine HeavenJan Zielinski2020-03-033-1/+17
| | | | | | | | | | | | Few changes to fix the last corruptions in Heaven: - fix indirect TCS input when vertex/attribute index is not the same for each patch - use the correct functions to build loops in shader - fix using vmask for writting TCS output Reviewed-by: Krzysztof Raszkowski <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3980> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3980>
* 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]>