aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
Commit message (Collapse)AuthorAgeFilesLines
* gallivm/gs_iface: pass stream into end primitive interface.Dave Airlie2020-07-084-4/+4
| | | | | | | This is just an API change for now Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>
* draw/gs: only allocate memory for streams needed.Dave Airlie2020-07-081-2/+2
| | | | | | | This just allocates the sizeing for streams that are needed. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>
* gallivm/draw/gs: pass vertex stream count into shader buildDave Airlie2020-07-084-2/+6
| | | | | | | The shader builder can avoid iterations using this info. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>
* draw/gs: fix up current verts in output fetching.Dave Airlie2020-07-081-1/+1
| | | | | | | | This was wrong since I added multi-stream support in draw/gs: track emitted prims + verts per stream Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>
* draw: emit so primitives before ending empty pipeline.Dave Airlie2020-07-081-3/+4
| | | | | | | | | | | There may be non-stream 0 emitted primitives that have to be processed. Fixes: KHR-GL42.transform_feedback_overflow_query_ARB.multiple-streams-one-buffer-per-stream KHR-GL42.transform_feedback_overflow_query_ARB.multiple-streams-multiple-buffers-per-stream Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>
* gallivm/nir: call end prim at end on all GS streams.Dave Airlie2020-07-081-1/+2
| | | | | | | Fixes: KHR-GL45.transform_feedback.draw_xfb_stream_test Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>
* util: Merge util_format_read_4* functions.Eric Anholt2020-07-071-16/+4
| | | | | | | | Everyone wants the same thing: unpack 4-bytes-per-channel data based on the base type of the format. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>
* util: Merge util_format_write_4* functions.Eric Anholt2020-07-071-16/+4
| | | | | | | | Everyone wants the same thing: pack 4-bytes-per-channel data based on the base type of the format. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>
* gallium/util: Move the Z/S handling to the outside of get_tile().Eric Anholt2020-07-071-51/+46
| | | | | | | | This lets us drop the special case for S8_UINT, and makes our read_4 path just like other callers. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>
* gallium/util: Clean up the Z/S tile write path.Eric Anholt2020-07-071-27/+10
| | | | | | | | The switch statement is silly, we have a helper to detect all of Z/S. And, take the time explain why all of Z/S tile writing is unimplemented. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>
* gallium/util: Fix location of the comment about S8_UINT handling.Eric Anholt2020-07-071-4/+4
| | | | | | | | I clearly wrote it in the wrong place in "softpipe: Refactor pipe_get/put_tile_rgba_* paths." Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>
* draw/clip: fix viewport index for geometry shadersDave Airlie2020-07-042-2/+8
| | | | | | | | | | | | | | | | | | | | | | The old code updated the viewport index on the first vertex in a primitive, however it was picking the first vertex wrong when used with geometry shaders. This code has access to the prim info with the primitive lengths so instead keep track of when a new primitive starts by tracking the lengths and updating the viewport index then. The prim info is only valid after a GS or prim assembly, so enable prim assembly if a vertex shader ever uses viewport index. This fixes: piglit arb_viewport_array-render-viewport-2 KHR-GLES31.core.viewport_array.draw_to_single_layer_with_multiple_viewports,Fail KHR-GLES31.core.viewport_array.draw_mulitple_viewports_with_single_invocation,Fail KHR-GLES31.core.viewport_array.draw_multiple_layers,Fail KHR-GLES31.core.viewport_array.depth_range,Fail Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5489>
* draw/clip: cleanup viewport index handling code.Dave Airlie2020-07-041-10/+12
| | | | | | | This moves code around, and adds initial clamping Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5489>
* draw/sample: add support for indirect imagesDave Airlie2020-07-021-0/+16
| | | | | | | | This uses the array functions to implement indirect image support for draw shaders Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* gallivm/nir: add support for indirect image loadingDave Airlie2020-07-022-0/+98
| | | | | | | | | This adds support for indirect image loading, image stores can cause images with different formats to be stored to, so this operates like the texture code now. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* gallivm/img: refactor out the texel return type (v2)Dave Airlie2020-07-021-9/+17
| | | | | | | | v2: refactor to just pass type as pointed out by Roland. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* gallivm/nir: refactor image operations for indirect support.Dave Airlie2020-07-023-32/+32
| | | | | | | | This just refactors the image code, so that outdata is passed explicitly, and refactors the internal handling of NONE formats. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* gallivm/nir: support passing image index into image code.Dave Airlie2020-07-023-7/+47
| | | | | | | This doesn't do anything yet, just adds parsing support for it. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* draw: pass number of images to image soa createDave Airlie2020-07-023-6/+15
| | | | | | | | This is stored for now but will be used as part of indirect image support Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* gallivm/sample: handle size unit offsetDave Airlie2020-07-021-8/+10
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* llvmpipe/draw: wire up indirect offsetDave Airlie2020-07-021-0/+10
| | | | | | | This bounds checks and adds to the llvm index. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* gallivm/sample: pass indirect offset into texture/image unitsDave Airlie2020-07-024-52/+57
| | | | | | | | | This isn't needed for the basic indirect code, but it is needed for texture size/image size unfortunately. They could be done with a super switch, but it seems simple to query them. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* gallivm/nir: handle non-uniform texture offsetsDave Airlie2020-07-022-0/+59
| | | | | | | | | | | The way we construt vertex/geom shaders means these can diverge, so we have to just hammer it out manually, there are likely optimisation opportuniities in here Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* gallivm/nir: add texture unit indexingDave Airlie2020-07-022-1/+21
| | | | | | | This hooks up the index from NIR into the sampler code. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* draw: add support for indirect texture accessDave Airlie2020-07-021-4/+21
| | | | | | | This hooks up the switch statement generator to the draw code. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* gallivm: add indirect texture switch statement builder.Dave Airlie2020-07-022-0/+119
| | | | | | | | | | | This adds the apis to add an indirect accessor for arrays of textures, using an LLVM switch statement and per-texture sampler functions. It also adds the indexer to the sampler parameters Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* gallivm/sample: change texture function generator apiDave Airlie2020-07-021-9/+10
| | | | | | | | | This passes some more paramters in directly and changes how the returns are done in order to reuse this function for indirect texture support later. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* draw: pass nr_samplers into llvm sample state creation.Dave Airlie2020-07-023-6/+11
| | | | | | | This will be used later to handle indirect texture support. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
* gallivm: add missing breakTimothy Arceri2020-07-021-0/+1
| | | | | | | Fixes: 26c5ae80f0b5 ("llvmpipe: enable ARB_shader_group_vote") Reviewed-by: Dave Airlie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5714>
* draw/llvm: fix big-endian mask adjustingDave Airlie2020-07-011-6/+6
| | | | | | | | | | | | | | This code was broken, but it worked by accident, as the pad and the edgeflag were reversed, however when Roland removed the cliptest field back in 2015, he stopped copying the pad which actually stopped copy the edgeflag. Fix the function to actually copy the edgeflag. Fixes: 1b22815af624 ("draw: don't pretend have_clipdist is per-vertex") Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5679>
* gallivm/nir: fix big-endian 64-bit splitting/merging.Dave Airlie2020-07-012-0/+20
| | | | | | | | | The shuffles need to be swapped to do this properly on big-endian Cc: <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5679>
* gallium/util: Add a helper function for point sprite handling.Eric Anholt2020-06-291-0/+19
| | | | | | | Many drivers will need to do the same thing here, so consolidate it. Reviewed-by: Jose Maria Casanova Crespo <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2952>
* gallivm/nir: fix const loading on big endian systemsDave Airlie2020-06-291-1/+1
| | | | | | | | | | | | The code was expecting the lower 32-bits of the 64-bit to be what it wanted, don't be implicit, pull the value from the union. This should fix rendering on big endian systems since NIR was introduced. Fixes: 44a6b0107b37 ("gallivm: add nir->llvm translation (v2)") Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5677>
* rbug: Fix rbug_delete_vs_state lock acquisition.Vinson Lee2020-06-271-1/+1
| | | | | | | | | | | | | | Fix warning reported by Coverity Scan. Double unlock (LOCK) double_unlock: mtx_unlock unlocks rb_pipe->call_mutex while it is unlocked. Fixes: 07838ff990a7 ("rbug: Use the call mutex") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3023 Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5196>
* glsl,driconf: add allow_glsl_120_subset_in_110 for SPECviewperf13Marek Olšák2020-06-231-0/+1
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5459>
* util: rename xmlpool.h to driconf.hEric Engestrom2020-06-223-3/+3
| | | | | | | To make it clearer what it is and does. Signed-off-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440>
* driconf: drop now unused translation facilityEric Engestrom2020-06-222-3/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440>
* gallium: Add pipe cap for primitive restart with fixed indexNeil Roberts2020-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | Adds PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX which is a subset of the primitive restart cap for when the hardware can only support the fixed indices specified in GLES. The switch statements were automatically modified with this command: find \( \( -name \*.cpp -o -name \*.c \) \! -type l \) \ -exec sed -i -r \ 's/^(\s*case\s+PIPE_CAP_PRIMITIVE_RESTART)\s*:.*$/\0\n\1_FIXED_INDEX:/' \ {} \; v2: Add a note in screen.rst Reviewed-by: Eric Anholt <[email protected]> (v1) Reviewed by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5559>
* gallium/util: add missing includeErik Faye-Lund2020-06-201-0/+1
| | | | | | | | | | | | This source-file uses PIPE_OS_WINDOWS to enable the Windows functionality. But witout including p_config.h, this pre-processor symbol won't be defined at all. Let's fix this by adding the missing include, enabling stack-traces on Windows. Acked-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5497>
* gallium/util: limit STACK_LEN on WindowsErik Faye-Lund2020-06-201-0/+5
| | | | | | | | | | | The Windows implementation of debug_backtrace_capture has a limiation of max 62 frames in total. Subtract a start-frame of 1 and the wrapping functions frame, and we land at 60. So let's lower this number on Windows to avoid triggering an assert. Acked-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5497>
* gallium/os: call "ANSI" version of GetCommandLineErik Faye-Lund2020-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The GetCommandLine API comes in two versions, GetCommandLineA (which returns "ANSI" results), and GetCommandLineW which returns UTF-16 ("WIDE") results. Then finally, windows.h provides a wrapper-macro that defines GetCommandLine to either of the two, based on the setting of the UNICODE macro. More information about this mechanism can be found here: https://docs.microsoft.com/en-us/windows/win32/intl/unicode-in-the-windows-api For some reason, the UNICODE macro is set during build, even if we're not explicitly setting it. This leads to us trying to cast a UTF-16 result to a char-pointer, which is obviously not going to do the right thing. So let's be defensive, and just call GetCommandLineA directly instead. This avoids us depending on the setting of the UNICODE-macro in the first place. Acked-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5497>
* replace all F_DUPFD_CLOEXEC with os_dupfd_cloexec()Eric Engestrom2020-06-182-2/+4
| | | | | | | | | | | All squashed into a single commit because it shouldn't have any behaviour change, except that it might work now on platforms where it was broken because F_DUPFD_CLOEXEC is not supported but FD_CLOEXEC is. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369>
* gallium/hud: don't use user vertex buffersErik Faye-Lund2020-06-161-2/+5
| | | | | | | | This gains back some performance lost in the previous commit, by bypassing u_vbuf. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5417>
* Revert "gallium/hud: don't use user vertex buffers"Erik Faye-Lund2020-06-162-22/+8
| | | | | | | | | | | | | | | | | | The approach taken in this commit only works on drivers that expose the PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT capability. For drivers that don't, the buffer has been unmapped by the time we get to hud_draw_colored_prims, leading to crashes. It's not easy to fix the code, but drivers that do support coherent mapping will most likely do the right think themseleves, so let's just go back to using user-buffers here. This reverts commit 4fe1fd4df40ac91b2783e3604fd81e6a6faf0cd2. Fixes: 4fe1fd4df40 ("gallium/hud: don't use user vertex buffers") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3106 Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5417>
* gallivm/cache: don't require a null terminator for cache data.Dave Airlie2020-06-161-1/+1
| | | | | | | | | | | | Fixes crashes seen with ./bin/egl_ext_device_base since cache support was added. Fixes: 4962d3e10733 ("gallivm: add cache interface to mcjit") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3118 Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5467>
* gallivm/sample: fix texel type for stencil 8-bitDave Airlie2020-06-111-1/+1
| | | | | | | | | | This has to be unsigned, so clamping works properly for border colors. Fixes dEQP-GLES31.functional.texture.border_clamp.range_clamp.nearest_uint_stencil Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5379>
* gallivm/conv: enable conversion min code. (v2)Dave Airlie2020-06-111-2/+4
| | | | | | | | | | | | I'm not sure why this code was if (0), but if (1) for it fixes dEQP-GLES31.functional.texture.border_clamp.range_clamp.nearest_float_color This test expects +inf to get mapped to 255 and -inf to 0, both values were ending up at 0. v2: also enable in the SSE paths Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5379>
* gallivm/format: convert unsigned values to float properly.Dave Airlie2020-06-111-1/+1
| | | | | | | | | | | | This fixes: dEQP-GLES31.functional.draw_indirect.random.2 which ends up with 3x32-bit USCALED values going down this path some of which have the top bit set, and end up converted to signed float instead of unsigned float values. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5379>
* gallivm/nir: add group barrier supportDave Airlie2020-06-111-0/+1
| | | | | | | | Fixes crash in dEQP-GLES31.functional.synchronization.inter_invocation.image_write_read Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5379>
* draw/gs: add more info to debugging.Dave Airlie2020-06-111-3/+4
| | | | | | | | adds invocations and vertex streams to default off debug, fixes compile as well due to missing , Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5379>