summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* util/disk_cache: add new driver_flags param to cache keysTimothy Arceri2017-05-235-15/+23
| | | | | | | | | This will be used for things such as adding driver specific environment variables to the key. Allowing us to set environment vars that change the shader and not have the driver ignore them if it finds existing shaders in the cache. Reviewed-by: Eduardo Lima Mitev <[email protected]>
* u_format_test: Ignore S3TC errors.Jose Fonseca2017-05-221-0/+25
| | | | | | | | | | This prevents spurious failures when libtxc-dxtn-s2tc is installed. Note: lp_test_format doesn't need any change since we were already ignoring S3TC failures there. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Rhys Kidd <[email protected]>
* i965: Enable ASTC HDR for BroxtonNanley Chery2017-05-221-0/+3
| | | | | | | | This platform passes the following GLES3 tests: ES3-CTS.functional.texture.compressed.astc.endpoint_value_hdr_cem_* Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* intel/isl: Add ASTC HDR to format lists and helpersNanley Chery2017-05-223-2/+58
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* radv: Add compute HTILE fast clear.Bas Nieuwenhuizen2017-05-221-1/+93
| | | | | | | | | Not really what the fast depth clear does, no matter whether you use EXPCLEAR or not. Seems the fast clear using the DB HW always touches the main buffer. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Use correct clear words for HTILE.Bas Nieuwenhuizen2017-05-221-4/+13
| | | | | | | | | | Did some RE'ing what several HTILE words give when read from a descriptor with HTILE compression enabled. Seems to align with -pro usage for D16 too. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Add queue masks for htile usage determination.Bas Nieuwenhuizen2017-05-224-20/+41
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Specify semantics of HTILE layout helpers.Bas Nieuwenhuizen2017-05-223-3/+20
| | | | | | | And correct implementation to specify only what we support. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Don't use a separate can_expclear.Bas Nieuwenhuizen2017-05-225-40/+11
| | | | | | | We never use EXPCLEAR clears. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* mesa: GL_ARB_shader_subroutine is not optional in core profileIan Romanick2017-05-229-49/+3
| | | | | | | | | | | text data bss dec hex filename 7038459 235248 37280 7310987 6f8e8b 32-bit i965_dri.so before 7038227 235248 37280 7310755 6f8da3 32-bit i965_dri.so after 6681438 303400 50608 7035446 6b5a36 64-bit i965_dri.so before 6681254 303400 50608 7035262 6b597e 64-bit i965_dri.so after Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* drirc: Add allow_glsl_builtin_variable_redeclaration for Dead Island Riptide ↵Benedikt Schemmer2017-05-221-0/+4
| | | | | | | Definitive Edition Signed-off-by: Marek Olšák <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* gallium/radeon: add a query for monitoring Gallium thread loadMarek Olšák2017-05-222-0/+13
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* radeonsi/gfx9: compile shaders with +xnackMarek Olšák2017-05-221-6/+7
| | | | | | | so that LLVM doesn't allocate SGPRs where XNACK is. Cc: 17.1 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* vc4: Remove dead code in vc4_dump_surface_msaa()Rhys Kidd2017-05-221-6/+0
| | | | | | | | | Coverity caught the use of dead code copy-paste for found_colors[] and num_found_colors. CID: 1341850 Signed-off-by: Rhys Kidd <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl/wayland: verify event queue was allocatedLionel Landwerlin2017-05-221-1/+1
| | | | | | | | | | We're already verified that 'window' wasn't NULL, I'm guessing this allocation error is about the newly created queue. CID: 1409754 Fixes: 03dd9a88b0b ("egl/wayland: Use per-surface event queues") Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* mesa: add APPLE_vertex_array_object stubsTimothy Arceri2017-05-227-1/+53
| | | | | | | | | | | APPLE_vertex_array_object support was removed in 7927d0378fc7. However it turns out we can't remove the functions because this can cause issues when libglapi is used together with DRI drivers built prior to said commit Fixes: 7927d0378fc ("mesa: drop APPLE_vertex_array_object support") Reviewed-by: Emil Velikov <[email protected]>
* glsl: set mask via initialisation list rather than in constructor bodyTimothy Arceri2017-05-221-3/+1
| | | | | | | | | Potentially more efficient as it may avoid the struct being initialised twice. Also add var to the initialisation list while we are here. Reviewed-by: Samuel Pitoiset <[email protected]>
* ralloc: Use strnlen() inside of strncat()Vladislav Egorov2017-05-221-6/+1
| | | | | | | | | | | If the str is long or isn't null-terminated, strlen() could take a lot of time or even crash. I don't know why was it used in the first place, maybe for platforms without strnlen(), but strnlen() is already used inside of ralloc_strndup(), so this change should not additionally break anything. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glcpp: Skip unnecessary line continuations removalVladislav Egorov2017-05-221-2/+8
| | | | | | | | | | Overwhelming majority of shaders don't use line continuations. In my shader-db only shaders from the Talos Principle and Serious Sam used them, less than 1% out of all shaders. Optimize for this case, don't do any copying if no line continuation was found. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glcpp: Avoid unnecessary strcmp()Vladislav Egorov2017-05-221-5/+9
| | | | | | | | strcmp() is slow. Initiate comparison with "__LINE__" or "__FILE__" only if the identifier starts with '_', which is rare. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* main: Move hashLockMutex/hashUnlockMutex to header and inlineThomas Helland2017-05-222-45/+40
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* main: Use _mesa_HashLock/UnlockMutex consistentlyThomas Helland2017-05-221-13/+10
| | | | | | | | | This is shorter and easier on the eyes. At the same time this also ensures that we are always asserting that the table pointer is not NULL. Currently that was not done for all situations. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* util: Change the pointer hashing functionThomas Helland2017-05-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use our knowledge that pointers are at least 4 byte aligned to remove the useless digits. Then shift by 6, 10, and 14 bits and add this to the original pointer, effectively folding in the entropy of the higher bits of the pointer into a 4-bit section. Stopping at 14 means we can add the entropy from 18 bits, or at least a 600Kbyte section of memory. Assuming that ralloc allocates from a linearly allocated heap less than this we can make a very efficient pointer hashing function for our usecase. Even if we are not on an architecture that is 4 byte aligned, there is still a high big chance that the thing we are allocating is at least 8 bytes in size, so even then we will have entropy into the third bit. The 4 bit increment on the shifts is chosen rather arbitrarily; if we had chosen a 3 bit increment we would need to add another xor to cover a decently sized memorypool. Increasing it to 5 bits would spread our entropy more, possibly hurting us with more collisions on hash tables of size less than 32. With a hash table of size 16 there are a max of 11 entries, and we can assume that with such a small table collisions are not that painfull. This allows us to hash the whole 32 or 64 bit pointer at once, instead of running FNV1a, looping through each byte and doing increments, decrements, muls, and xors on every byte. This cuts _mesa_hash_data from 1.5 % on profiles, to making _mesa_hash_pointer show up with a 0.09% share. Collisions on insertion actually seems to be ever so slightly lower with this hash function, as found by printing a loop counter and sorting the data. perf stat shows a 1.5% reduction in instruction count, and a 5% reduction in stalled cycles. Shader-db runtime goes from 225 to 220 seconds. No instruction-count changes in shader-db, but there are some minor changes in cycle-count that is likely caused by nir walking a set in some of its passes, and this causing a different ordering. That might eventually lead to a difference in register allocation. However, the effect is a net positive; total cycles in shared programs: 24739550 -> 24738482 (-0.00%) cycles in affected programs: 374468 -> 373400 (-0.29%) helped: 178 HURT: 49 Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vulkan/wsi/wayland: Fix proxy wrappers for swapchain recreationPhilipp Zabel2017-05-201-3/+10
| | | | | | | | | | | | | | Before the swapchain event queue is destroyed, all proxy objects that reference it must be dropped. Otherwise we risk a use-after-free if a frame callback event or buffer release events are received afterwards. This happens when an application destroys and recreates a swapchain in FIFO mode between two frames without using the VkSwapchainCreateInfoKHR::oldSwapchain mechanism to keep the old swapchain until after the next redraw. Fixes: 5034c615582a ("vulkan/wsi/wayland: Use proxy wrappers for swapchain") Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Cc: [email protected]
* drirc: Add allow_glsl_builtin_variable_redeclaration for Dying Light and ↵John Brooks2017-05-201-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dead Island Definitive Edition This fixes the long-standing problem with Dying Light where the game would produce a black screen when running under Mesa. This happened because the game's vertex shaders redeclare gl_VertexID, which is a GLSL builtin. Mesa's GLSL compiler is a little more strict than others, and would not compile them: error: `gl_VertexID' redeclared The allow_glsl_builtin_variable_redeclaration directive allows the shaders to compile and the game to render. The game also requires OpenGL 4.4+ (GLSL 440), but does not request it explicitly. It must be forced with an override, such as MESA_GL_VERSION_OVERRIDE=4.5 and MESA_GLSL_VERSION_OVERRIDE=450. A compatibility context is *not* required and forcing one with 4.5COMPAT or allow_higher_compat_version results in graphical artifacts. Dead Island Definitive Edition is another Techland port on the same engine with the same problems, so we set the allow_glsl_builtin_variable_redeclaration option for that game as well. v2 (Samuel Pitoiset): - Rename allow_glsl_builtin_redeclaration -> allow_glsl_builtin_variable_redeclaration Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96449 Signed-off-by: John Brooks <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* glsl: Conditionally allow redeclaration of built-in variablesJohn Brooks2017-05-203-0/+19
| | | | | | | | | | | | | Conditional on allow_glsl_builtin_variable_redeclaration driconf option. v2 (Samuel Pitoiset): - Rename allow_glsl_builtin_redeclaration -> allow_glsl_builtin_variable_redeclaration - style: put spaces after 'if' Signed-off-by: John Brooks <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* driconf: Add allow_glsl_builtin_variable_redeclaration optionJohn Brooks2017-05-207-0/+20
| | | | | | | | | | | | | | | This option will allow GLSL builtins to be redeclared verbatim (e.g. redeclaring "in int gl_VertexID" in a vertex shader). This is not strictly valid and would normally fail to compile, but some applications (such as newer Techland ports) do it and need more leniency. v2 (Samuel Pitoiset): - Rename allow_glsl_builtin_redeclaration -> allow_glsl_builtin_variable_redeclaration Signed-off-by: John Brooks <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* nv50,nvc0: clear index buffer bufctx bin unconditionallyIlia Mirkin2017-05-202-5/+3
| | | | | | | | | The previous condition was to clear it out if it had previously been set, not what's in the current draw. That information is gone now, so just clear it unconditionally. Fixes: 330d0607e ("gallium: remove pipe_index_buffer and set_index_buffer") Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: fix vtxbuf cleanupIlia Mirkin2017-05-201-1/+1
| | | | | | | Use a user-buffer-aware cleanup function. Fixes: c24c3b94ed ("gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytes") Signed-off-by: Ilia Mirkin <[email protected]>
* i965: Use the upload BO for push constants on Gen7.5-Gen8.Kenneth Graunke2017-05-202-2/+2
| | | | | | | | | | | | | | | | | | | | We can easily use the upload BO for push constants on Gen7.5/Gen8 too, at the cost of a relocation when emitting 3DSTATE_CONSTANT_XS. We can simply switch to using constant buffer pointer 2 instead of pointer 0, like we do on Gen9+. Ivybridge and Baytrail can't do this trick because they require the constant buffers to be enabled in order, starting with 0. We'd have to set the INSTPM bit to make the constant buffer pointer not relative to dynamic state base address, which would need kernel command parser support. Improves performance in GLBenchmark 2.7/TRex Offscreen by: - Broadwell GT2: 0.305608% +/- 0.19877% (n = 68) - Braswell: No difference proven (n = 742) - Haswell GT3e: 0.180755% +/- 0.0237505% (n = 30) Reviewed-by: Chris Forbes <[email protected]>
* i965: Use the upload BO for push constants on Gen9+.Kenneth Graunke2017-05-202-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Shaders can use quite a bit of uniform data. Better to put it in the upload buffers, like we do for client vertex data, rather than the batch buffer state area, which is primarly used for indirect state. This should free up batch space, allowing us to emit more commands in a batch before flushing. Because BRW_NEW_BATCH also causes a lot of state to be re-emitted, it may also reduce CPU overhead a little bit. We took this approach on Gen4-5, but switched to using the batch area on Gen6+ because buffer 0 is relative to Dynamic State Base Address by default, which is set to the start of the batch. On Gen9+, we already use a relocation due to a workaround, so this is trivial to change and has basically no downside. Unfortunately we can't change compute shader push constants because MEDIA_CURBE_LOAD always uses an offset from dynamic state base address. Improves performance in GLBenchmark 2.7/TRex Offscreen by: - Skylake GT4e: 0.52821% +/- 0.113402% (n = 190) - Apollolake: 0.510225% +/- 0.273064% (n = 70) Reviewed-by: Chris Forbes <[email protected]>
* i965: Drop BRW_NEW_PUSH_CONSTANT_ALLOCATION from CS packets.Kenneth Graunke2017-05-202-3/+1
| | | | | | | | | | | I don't think CS push constant uploading uses the section of L3 controlled by 3DSTATE_PUSH_CONSTANT_ALLOC_XS. So I don't think it needs to be re-emitted when that space is reallocated. The programming note in gen7_allocate_push_constants doesn't indicate this is necessary, at least. Reviewed-by: Chris Forbes <[email protected]>
* nvc0/ir: SHLADD's middle source must be an immediateIlia Mirkin2017-05-201-0/+2
| | | | | | | | The instruction encodings only allow for immediates. Don't try to replace a zero (which is dumb to have in that op in any case) with RZ. Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected]
* android: add -Wl,--build-id=sha1 to LDFLAGS for libvulkan_intelTapani Pälli2017-05-201-0/+2
| | | | | | | Just like is done on desktop and what is expected by the build-id code. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* automake: add SWR LLVM gen_builder.hpp workaroundEmil Velikov2017-05-201-30/+11
| | | | | | | | | | | | | | | | | | | | | As gen_builder.hpp file is generated, it contains information that is specific to the LLVM version it originates from. As suggested by Tim, the file seems to be forwards compatible. So in order to produce ship a file which will work everywhere we should be using earlies supported LLVM - 3.9. With this we're back on track and can build all of mesa without python/mako/flex and friends. In the long term we might want to see if the python generators can be updated to produce LLVM version agnostic files. At least within the range supported by SWR. Cc: <[email protected]> Cc: Chuck Atkins <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tim Rowley <[email protected]>
* st/mesa: don't mark the program as in cache_fallback when there is cache missTimothy Arceri2017-05-203-2/+9
| | | | | | | | | | | | | | | | | | When we fallback currently the gl_program objects are re-allocated. This is likely to change when the i965 cache lands, but for now this fixes a crash when using MESA_GLSL=cache_fb. This env var simulates the fallback path taken when a tgsi cache item doesn't exist due to being evicted previously or some kind of error. Unlike i965 we are always falling back at link time so it's safe to just re-allocate everything. We will be unnecessarily freeing and re-allocate a bunch of things here but it's probably not a huge deal, and can be changed when the i965 code lands. Fixes: 0e9991f957e2 ("glsl: don't reference shader prog data during cache fallback") Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add an env var to force cache fallbackTimothy Arceri2017-05-203-1/+8
| | | | | | | | | | | | | | | | | For the gallium state tracker a tgsi binary may have been evicted from the cache to make space. In this case we would take the fallback path and recompile/link the shader. On i965 there are a number of reasons we can get to the program upload stage and have neither IR nor a valid cached binary. For example the binary may have been evicted from the cache or we need a variant that wasn't previously cached. This environment variable enables us to force the fallback path that would be taken in these cases and makes it easier to debug these otherwise hard to reproduce scenarios. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: improve shader cache debug infoTimothy Arceri2017-05-201-2/+4
| | | | | | | | | | | This will explicitly state that we are following the fallback path when we find invalid/corrupt cache items. It will also output the fallback message when the fallback path is forced via an environment variable, the following patches will allow this. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/xvmc: add DRI3 supportEmil Velikov2017-05-191-1/+3
| | | | | Signed-off-by: Emil Velikov <[email protected]> Tested-by: Ilia Mirkin <[email protected]>
* st/omx: add DRI3 supportEmil Velikov2017-05-191-1/+3
| | | | | | Cc: Christian König <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-and-Tested-by: Leo Liu <[email protected]>
* gallium/targets: link against XCB only as neededEmil Velikov2017-05-192-4/+12
| | | | | | | | OMX and VA can optionally use the X11 DRI2/DRI3, thus we should link only as required. Cc: <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* st/omx: fix building against X11-less setupsEmil Velikov2017-05-191-0/+6
| | | | | | | | | | The vl_*_screen_create API properly falls back to a NOP when we're building without specific platforms. So the only thing we need is to handle the lack of X11/Xlib.h and provide a dummy Display define. Cc: <[email protected]> Cc: Christian König <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* st/omx: remove unneeded X11 includeEmil Velikov2017-05-191-2/+0
| | | | | | | | | En route to a X11-less builds Cc: <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>
* st/omx: remove unused drm_driver.h includesEmil Velikov2017-05-192-2/+0
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>
* st/va: check if vl_*_screen_create has failed only onceEmil Velikov2017-05-191-4/+3
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>
* st/va: fix misplaced closing bracketEmil Velikov2017-05-191-1/+1
| | | | | | | | | | | It's been like this since the code was introduced. Fixes: 86eb4131a90 (st/va: add headless support, i.e. VA_DISPLAY_DRM) Cc: <[email protected]> Cc: Julien Isorce <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>
* st/va: move variable declaration to where its usedEmil Velikov2017-05-191-2/+1
| | | | | | | | ... and make it const, since we shouldn't tinker with it. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>
* auxiliary/vl: use vl_*_screen_create stubs when building w/o platformEmil Velikov2017-05-195-19/+35
| | | | | | | | | | | | | | | | | | | | Provide a dummy stub when the user has opted w/o said platform, thus we can build the binaries without unnecessarily requiring X11/other headers. In order to avoid build and link-time issues, we remove the HAVE_DRI3 guards in the VA and VDPAU state-trackers. With this change st/va will return VA_STATUS_ERROR_ALLOCATION_FAILED instead of VA_STATUS_ERROR_UNIMPLEMENTED. That is fine since upstream users of libva such as vlc and mpv do little error checking, let alone distinguish between the two. Cc: Leo Liu <[email protected]> Cc: Guttula, Suresh <[email protected]> Cc: [email protected] Cc: Christian König <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* loader: build libloader_dri3_helper.la only with HAVE_PLATFORM_X11Emil Velikov2017-05-191-0/+2
| | | | | | | | Pretty much every other place does the same. Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* vulkan: automake: remove unused VULKAN_LIB_DEPS variableEmil Velikov2017-05-191-6/+0
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>