summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
Commit message (Collapse)AuthorAgeFilesLines
* Revert "configure: allow building with python3"Emil Velikov2018-08-241-1/+1
| | | | | | | | | | | | | | This reverts commit ae7898dfdbe5c8dab7d11c71862353f1ae43feb0. Turns out the python scripts are _not_ fully python 3 compatible. As Ilia reported using get_xmlpool.py with LANG=C produces some weird output - see the link for details. Even though the issue was spotted with the autoconf build, it exposes a genuine problem with the script (and lack of lang handling of the meson build.) https://lists.freedesktop.org/archives/mesa-dev/2018-August/203508.html
* gallivm: don't use saturated unsigned add/sub intrinsics for llvm 8.0Roland Scheidegger2018-08-241-27/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These have been removed. Unfortunately auto-upgrade doesn't work for jit. (Worse, it seems we don't get a compilation error anymore when compiling the shader, rather llvm will just do a call to a null function in the jitted shaders making it difficult to detect when intrinsics vanish.) Luckily the signed ones are still there, I helped convincing llvm removing them is a bad idea for now, since while the unsigned ones have sort of agreed-upon simplest patterns to replace them with, this is not the case for the signed ones, and they require _significantly_ more complex patterns - to the point that the recognition is IMHO probably unlikely to ever work reliably in practice (due to other optimizations interfering). (Even for the relatively trivial unsigned patterns, llvm already added test cases where recognition doesn't work, unsaturated add followed by saturated add may produce atrocious code.) Nevertheless, it seems there's a serious quest to squash all cpu-specific intrinsics going on, so I'd expect patches to nuke them as well to resurface. Adapt the existing fallback code to match the simple patterns llvm uses and hope for the best. I've verified with lp_test_blend that it does produce the expected saturated assembly instructions. Though our cmp/select build helpers don't use boolean masks, but it doesn't seem to interfere with llvm's ability to recognize the pattern. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106231 Reviewed-by: Jose Fonseca <[email protected]>
* tgsi/ureg: don't call tgsi_sanity when it's too slowMarek Olšák2018-08-231-1/+12
| | | | Tested-by: Dieter Nützel <[email protected]>
* configure: allow building with python3Emil Velikov2018-08-231-1/+1
| | | | | | | | | | | | Pretty much all of the scripts are python2+3 compatible. Check and allow using python3, while adjusting the PYTHON2 refs. Note: - python3.4 is used as it's the earliest supported version - python3 chosen prior to python2 Signed-off-by: Emil Velikov <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* mesa: remove unused dri config option disable_shader_bit_encodingTimothy Arceri2018-08-211-1/+0
| | | | | | | This was added as a workaround for Heaven 3.0 but was later removed by 5ead448719f3 to allow Heaven 4.0 to work correctly. Reviewed-by: Kenneth Graunke <[email protected]>
* xmlconfig: add kernel_driver device attributeQiang Yu2018-08-171-1/+1
| | | | | | | | | This attribute can be used by loader to apply different option to device use specific kernel driver. Signed-off-by: Qiang Yu <[email protected]> Acked-by: Michel Dänzer <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallium/u_blitter: save/restore window rectanglesMarek Olšák2018-08-142-0/+29
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* noop: implement set_window_rectanglesMarek Olšák2018-08-141-0/+8
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* ddebug: implement set_window_rectanglesMarek Olšák2018-08-141-0/+12
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* Gallium/tgsi: Correct signdness of return value of bit operationsGert Wollny2018-08-111-3/+4
| | | | | | | | | | | | | The GLSL operations findLSB, findMSB, and countBits always return a signed integer type. Let TGSI reflect this. v2: Properly set values in infer_(src|dst)_type (Thanks Roland Schneidegger for pointing out problems with my 1st approach) v2: Set values in the common infer_type code path, and only add the correct source type for UMSB (Roland Schneidegger) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* meson: Build with Python 3Mathieu Bridon2018-08-101-3/+3
| | | | | | | | | | | | Now that all the build scripts are compatible with both Python 2 and 3, we can flip the switch and tell Meson to use the latter. Since Meson already depends on Python 3 anyway, this means we don't need two different Python stacks to build Mesa. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* python: Fix inequality comparisonsMathieu Bridon2018-08-101-0/+6
| | | | | | | | | | | | | | | | | | | On Python 3, executing `foo != bar` will first try to call foo.__ne__(bar), and fallback on the opposite result of foo.__eq__(bar). Python 2 does not do that. As a result, those __eq__ methods were never called, when we were testing for inequality. Expliclty adding the __ne__ methods fixes this issue, in a way that is compatible with both Python 2 and 3. However, this means the __eq__ methods are now called when testing for `foo != None`, so they need to be guarded correctly. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* python: Better check for integer typesMathieu Bridon2018-08-091-2/+11
| | | | | | | | | | | | Python 3 lost the long type: now everything is an int, with the right size. This commit makes the script compatible with Python 2 (where we check for both int and long) and Python 3 (where we only check for int). Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* ttn: remove {varying_slot, frag_result}_to_tgsi_semantic helpersEmil Velikov2018-08-082-79/+0
| | | | | | | | The respective drivers have been updated and the helpers are no longer needed. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* python: Use explicit integer divisionsMathieu Bridon2018-08-072-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Python 2, divisions of integers return an integer: >>> 32 / 4 8 In Python 3 though, they return floats: >>> 32 / 4 8.0 However, Python 3 has an explicit integer division operator: >>> 32 // 4 8 That operator exists on Python >= 2.2, so let's use it everywhere to make the scripts compatible with both Python 2 and 3. In addition, using __future__.division tells Python 2 to behave the same way as Python 3, which helps ensure the scripts produce the same output in both versions of Python. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v2) Reviewed-by: Dylan Baker <[email protected]>
* gallium/u_vbuf: handle indirect multidraws correctly and efficiently (v3)Marek Olšák2018-08-031-24/+180
| | | | | | | | | v2: need to do MAX{start+count} instead of MAX{count} added piglit tests v3: use malloc Cc: 18.2 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* util: return 0 for NaNs in float_to_ubyteRoland Scheidegger2018-08-031-6/+5
| | | | | | | | | | | | | | | | d3d10 requires NaNs to get converted to 0 for float->unorm conversions (and float->int etc.). GL spec probably doesn't care in general, but it would make sense to have reasonable behavior in any case imho - the old code was converting negative NaNs to 0, and positive NaNs to 255. (Note that using float comparison isn't actually all that much more effort in any case, at least with sse2 it's just float comparison (ucommiss) instead of int one - I converted the second comparison to float too simply because it saves the probably somewhat expensive transfer of the float from simd to int domain (with sse2 via stack), so the generated code actually has 2 less instructions, although float comparisons are more expensive than int ones.) Reviewed-by: Brian Paul <[email protected]>
* ddebug: use util_snprintf() in dd_get_debug_filename_and_mkdirAndres Gomez2018-08-021-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Instead of plain snprintf(). To fix the MSVC 2013 build: Compiling src\gallium\auxiliary\driver_ddebug\dd_draw.c ... dd_draw.c c:\projects\mesa\src\gallium\auxiliary\driver_ddebug\dd_util.h(60) : warning C4013: 'snprintf' undefined; assuming extern returning int ... gallium.lib(dd_draw.obj) : error LNK2001: unresolved external symbol _snprintf build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll : fatal error LNK1120: 1 unresolved externals scons: *** [build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll] Error 1120 scons: building terminated because of errors. Fixes: 6ff0c6f4ebc ("gallium: move ddebug, noop, rbug, trace to auxiliary to improve build times") Cc: Marek Olšák <[email protected]> Cc: Brian Paul <[email protected]> Cc: Roland Scheidegger <[email protected]> Cc: Nicolai Hähnle <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/aux/util: use util_snprintf() in test_texture_barrierAndres Gomez2018-08-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Instead of plain snprintf(). To fix the MSVC 2013 build: Compiling src\gallium\auxiliary\util\u_tests.c ... u_tests.c src\gallium\auxiliary\util\u_tests.c(624) : warning C4013: 'snprintf' undefined; assuming extern returning int ... gallium.lib(u_tests.obj) : error LNK2019: unresolved external symbol _snprintf referenced in function _test_texture_barrier build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll : fatal error LNK1120: 1 unresolved externals scons: *** [build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll] Error 1120 scons: building terminated because of errors. Fixes: 56342c97ee7 ("gallium/u_tests: test FBFETCH and shader-based blending with MSAA") Cc: Marek Olšák <[email protected]> Cc: Brian Paul <[email protected]> Cc: Roland Scheidegger <[email protected]> Cc: Dieter Nützel <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: fix ddebug on windowsDylan Baker2018-08-011-1/+5
| | | | | | | | | By including the proper headers for getpid and for mkdir. Fixes: 6ff0c6f4ebcb87ea6c6fe5a4ba90b548f666067d ("gallium: move ddebug, noop, rbug, trace to auxiliary to improve build times") Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: move process.[ch] to u_process.[ch]Dylan Baker2018-08-011-1/+1
| | | | | | | | | | | | | On windows process.h is a system provided header, and it's required in include/c11/threads_win32.h. This header interferes with searching for that header, and results in windows build warnings with scons, but errors in meson which doesn't allow implicit function declarations. Just rename process to u_process, which follows the style of utils anyway. Fixes: 2e1e6511f76370870b5cde10caa9ca3b6d0dc65f ("util: extract get_process_name from xmlconfig.c") Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add new SAMP2HND and IMG2HND opcodesRhys Perry2018-08-013-2/+7
| | | | | | | | This commit does not add support for the opcodes in gallivm or tgsi_to_nir.c Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* gallium: add storage_sample_count parameter into is_format_supportedMarek Olšák2018-07-3116-22/+33
| | | | Tested-by: Dieter Nützel <[email protected]>
* gallium: add pipe_resource::nr_storage_samples, and set it same as nr_samplesMarek Olšák2018-07-314-1/+4
| | | | Tested-by: Dieter Nützel <[email protected]>
* tgsi: whitespace fixes in tgsi_ureg.cBrian Paul2018-07-271-23/+22
| | | | Trivial.
* gallium/util: whitespace fixes in u_inlines.hBrian Paul2018-07-271-36/+44
| | | | Trivial.
* gallium/util: whitespace fixes in u_debug_memory.cBrian Paul2018-07-271-53/+53
| | | | Trivial.
* gallium/u_vbuf: split u_vbuf_get_minmax_index function (v2)Marek Olšák2018-07-271-50/+51
| | | | | | | | This will be used by indirect multidraws. v2: clean up the function further, change return types to unsigned Reviewed-by: Eric Anholt <[email protected]> (v1)
* gallium/auxiliary: Extern "c" fixes.Alexander von Gluck IV2018-07-273-0/+24
| | | | | | Used by C++ code such as Haiku's renderer. Reviewed-by: Brian Paul <[email protected]>
* gallium/noop: implement invalidate_resourceMarek Olšák2018-07-271-0/+6
|
* gallium/auxiliary: Fix Autotools on Android (v2)Chad Versace2018-07-271-1/+5
| | | | | | | | | | | | | | | | | Problem 1: u_debug_stack_android.cpp transitively included "pipe/p_compiler.h", but src/gallium/include was missing from the C++ include path. Problem 2: Add -std=c++11 to AM_CXXFLAGS. Android's libbacktrace headers require C++11, but the Android toolchain (at least in the Chrome OS SDK) does not enable C++11 by default. v2: Add -std=c++11. Reviewed-by: Gurchetan Singh <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Tomasz Figa <[email protected]> Cc: Eric Engestrom <[email protected]>
* gallium: initialize ureg_dst::Invariant bitErik Faye-Lund2018-07-261-0/+3
| | | | | | | | | | | | | | | | | | | | | When this bit was added, it seems the some initialization code was omitted by mistake. Since stack-variables have kinda random contents, and we don't zero initialize the whole struct in these code-paths, we end up getting random-ish values for this bit. Spotted by Coverity in the following CIDs: - 1438115 - 1438123 - 1438130 Fixes: 70425bcfe63c4e9191809659d019ec4af923595d ("gallium: plumb invariant output attrib thru TGSI") Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* draw: force draw pipeline if there's more than 65535 verticesRoland Scheidegger2018-07-233-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | The pt emit path can only handle 65535 - the number of vertices is truncated to a ushort, resulting in a too small buffer allocation, which will crash. Forcing the pipeline path looks suboptimal, then again this bug is probably there ever since GS is supported, so it seems it's not happening often. (Note that the vertex_id in the vertex header is 16 bit too, however this is only used by the draw pipeline, and it denotes the emit vertex nr, and that uses vbuf code, which will only emit smaller chunks, so should be fine I think.) Other solutions would be to simply allow 32bit counts for vertex allocation, however 65535 is already larger than this was intended for (the idea being it should be more cache friendly). Or could try to teach the pt emit path to split the emit in smaller chunks (only the non-index path can be affected, since gs output is always linear), but it's a bit tricky (we don't know the primitive boundaries up-front). Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=107295 Cc: <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* u_blitter: Add an option to draw the triangles using an index buffer.Eric Anholt2018-07-122-2/+16
| | | | | | | | | | | | | | | For V3D, the HW will interpolate slightly differently along the shared edge of the trifan. The conformance tests manage to catch this in the nearest_consistency_* group. To get interpolation to match, we need the last vertex of the triangle to be shared. I first tried implementing draw_rectangle to do triangles instead, but that was quite a bit (147 lines) of code duplication from u_blitter, and this seems much simpler and less likely to break as u_blitter changes. Fixes dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_* on V3D. Reviewed-by: Marek Olšák <[email protected]>
* u_draw: Add some indices to the util_draw_elements() helpers.Eric Anholt2018-07-121-1/+8
| | | | | | | | | | | | These helpers have been unused, and were definitely not useful since 330d0607ed60 ("gallium: remove pipe_index_buffer and set_index_buffer") made it so that they never had an index buffer passed in. For an upcoming u_blitter change to use these helpers, I have just 6 bytes of index data, so pass it as user data until a more interesting caller comes along. Reviewed-by: Marek Olšák <[email protected]>
* gallium/u_transfer_helper: Initialize the stride of MSAA maps.Eric Anholt2018-07-121-0/+1
| | | | | | | | | | | We just never set the value that was returned for MSAA mappings (directly reading back an MSAA framebuffer). Since we're handing back ss_map, it should be ss_map's stride from our nested transfer. Fixes piglit /home/anholt/src/piglit/bin/fbo-depthstencil -samples=4 cases. Reviewed-by: Rob Clark <[email protected]>
* gallium/u_transfer_helper: Fix MSAA mappings with nonzero x/y.Eric Anholt2018-07-121-1/+5
| | | | | | | | | | | | We created a temporary with box->{width,height} and then tried to map width,height from a nonzero offset when we meant to just map the whole temporary. Fixes segfaults in V3D in dEQP-GLES3.functional.prerequisite.read_pixels with --deqp-egl-config-name=rgba8888d24s8ms4 and also piglit's read-front clear-front-first -samples=4 Reviewed-by: Rob Clark <[email protected]>
* gallium: Check pipe_screen::resource_changed before dereferencing itMichel Dänzer2018-07-123-3/+6
| | | | | | | | | | It's optional, only implemented by the etnaviv driver so far. Fixes: 501d0edeca32 "st/mesa: call resource_changed when binding a EGLImage to a texture" Fixes: a37cf630b4d1 "gallium: add pipe_screen::resource_changed callback wrappers" Reviewed-by: Lucas Stach <[email protected]>
* python: Use the print functionMathieu Bridon2018-07-064-366/+373
| | | | | | | | | | | | In Python 2, `print` was a statement, but it became a function in Python 3. Using print functions everywhere makes the script compatible with Python versions >= 2.6, including Python 3. Signed-off-by: Mathieu Bridon <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Dylan Baker <[email protected]>
* gallium/auxiliary: Fix string matchingMathieu Bridon2018-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | Commit f69bc797e15fe6beb9e439009fab55f7fae0b7f9 did the following: - if format.layout in ('bptc', 'astc'): + if format.layout in ('astc'): The intention was to go from matching either 'bptc' or 'astc' to matching only 'astc'. But the new code doesn't respect this intention any more, because in Python `('astc')` is not a tuple containing a string, it is just the string. (the parentheses are simply ignored) That means we now match any substring of 'astc', for example 'a'. This commit fixes the test to respect the original intention. Fixes: f69bc797e15fe6beb9e4 "gallium/auxiliary: Add helper support for bptc format compress/decompress" Reviewed-by: Eric Engestrom <[email protected]>
* Shorten u_queue namesMarek Olšák2018-07-041-1/+1
| | | | | | | | There is a 15-character limit for thread names shared by the queue name and process name. Shorten the thread name to make space for the process name. Reviewed-by: Timothy Arceri <[email protected]>
* gallium/os: use util_get_process_name when possibleMarek Olšák2018-07-041-14/+2
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* gallium/u_vbuf: drop min/max-scanning for empty indirect drawsErik Faye-Lund2018-07-021-0/+3
| | | | | | | | | | | | | | | | | | | When building with asserts enabled, we'll end up triggering an assert in pipe_buffer_map_range down this code-path, due to trying to map an empty range. Even if we avoid that, we'll trigger another assert a bit later, because u_vbuf_get_minmax_index returns a min-index of -1 here, which gets promoted to an unsigned value, and gives us an out-of-bounds buffer-mapping offset. Since we can't really have a well-defined min/max range here when the range is empty anyway, we should just drop this dance in the first place. After all, no rendering is going to be produced. This fixes a crash in dEQP-GLES31.functional.draw_indirect.random.0 on VirGL for me. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/auxiliary: Add helper support for bptc format compress/decompressDenis Pauk2018-07-016-1/+408
| | | | | | | | | | | | | | Reuse code shared with mesa/main/texcompress_bptc. v2: Use block decompress function v3: Include static bptc code from texcompress_bptc_tmp.h Suggested-by: Marek Olšák <[email protected]> Signed-off-by: Denis Pauk <[email protected]> CC: Nicolai Hähnle <[email protected]> CC: Marek Olšák <[email protected]> CC: Gert Wollny <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* gallium/util: remove dummy function util_format_is_supportedMarek Olšák2018-06-292-20/+0
| | | | Reviewed-by: Eric Engestrom <[email protected]>
* gallium: plumb invariant output attrib thru TGSIJoe M. Kniss2018-06-295-13/+39
| | | | | | | | | | | | Add support for glsl 'invariant' modifier for output data declarations. Gallium drivers that use TGSI serialization currently loose invariant modifiers in glsl shaders. v2: use boolean for invariant instead of unsigned. Tested: chromiumos on qemu with virglrenderer. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium: Fix automake for Android (v2)Chad Versace2018-06-271-0/+4
| | | | | | | | | | | | | | | Chromium OS uses Autotools and pkg-config when building Mesa for Android. The gallium drivers were failing to find the headers and libraries for zlib and Android's libbacktrace. v2: - Don't add a check for zlib.pc. configure.ac already checks for zlib.pc elsewhere. [for tfiga] - Check for backtrace.pc separately from the other Android libs. [for tfiga] Reviewed-by: Tomasz Figa <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallium/util: Fix build error due to cast to different sizeRobert Foss2018-06-251-2/+2
| | | | | | Signed-off-by: Robert Foss <[email protected]> Reviewed-by: Tomasz Figa <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* ttn: convert to deref instructionsRob Clark2018-06-221-39/+13
| | | | | | | | Signed-off-by: Rob Clark <[email protected]> Acked-by: Rob Clark <[email protected]> Acked-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Dave Airlie <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* gallium: add scalar isa shader capChristian Gmeiner2018-06-202-0/+4
| | | | | | | | | | | | | | | | v1 -> v2: - nv30 is _NOT_ scalar as suggested by Ilia Mirkin. - Change from a screen cap to a shader cap as suggested by Eric Anholt. - radeonsi is scalar as suggested by Marek Olšák. - Change missing ones to be scalar. v2 -> v3: - r600 prefers vec4 as suggested by Marek Olšák. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>