aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* panfrost/midgard: Implement upscaling type convertsAlyssa Rosenzweig2019-07-101-14/+59
| | | | | | | | Rather than using a dest_override, we upscale integers by using a half field with a sign-extend bit. A variant of this trick should also work for floats, but one step at a time! Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Move blend load/store into NIRAlyssa Rosenzweig2019-07-102-78/+65
| | | | | | | | | We have dedicated intrinsics to access the raw contents of the tile buffer so we can use a dedicated NIR pass to lower appropriately for blend shaders, rather than introducing a bizarre hardcoded blend epilogue that only works for RGBA8_UNORM. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Use nir_dest_num_componentsAlyssa Rosenzweig2019-07-101-1/+1
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Implement integer downsize opsAlyssa Rosenzweig2019-07-102-3/+62
| | | | | | | | | | | | | | | | | | Oh, dear. No turning back now. We begin implementing non-32-bit types, using downsizing integer type conversions as the initial instructions. We implement them naively as type-converting moves; substantially more efficient operation is possible by copypropping the type conversion modifier, but this optimization is not implemented here. Size converting modifiers on Midgard allow an instruction to write to a destination 1/2 the size, or to read from a source 1/2 the size. If we need an extreme conversion (32-bit to 8-bit, for instance), multiple type converting ops are chained together, which here is handled via an algebraic pass. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Move scale from MIR to NIRAlyssa Rosenzweig2019-07-102-10/+7
| | | | | | | This begins the process of removing blend shader specific MIR into a more general NIR lowering pass for formats. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Passthrough nir_lower_framebufferAlyssa Rosenzweig2019-07-104-0/+108
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Extend clear colour packingAlyssa Rosenzweig2019-07-104-26/+94
| | | | | | | | | | | Eventually, this will allow packing clear colours for all formats, including floating-point framebuffers, pure integer buffers, and special formats. Currently, a few of these formats are supported, and many more are handled through a generic Gallium colour packing path (which is not a perfect fit for the hardware, but works for many formats and is a sane default for the moment.) Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/mfbd: Include codes for float framebuffersAlyssa Rosenzweig2019-07-101-1/+28
| | | | | | | | | We see the hardware doesn't actually support float framebuffers in the native sense -- rather, it just allows higher bpp framebuffers and lets a blend shader / additional clear_color fields sort out the formats. This will be.. interesting. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Prepare some code for MRTAlyssa Rosenzweig2019-07-101-26/+13
| | | | | | | | Full MRT support is a while away, but in the mean time, we can remove code that explicitly assumes nr_cbufs <= 0, to minimize the obstacles we'll face later when we add the whole thing. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Use standard ALIGN_POT/INFINITY macrosAlyssa Rosenzweig2019-07-105-25/+19
| | | | | | We had vendored duplicates from pre-Mesa days; clean that up. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* egl: add glvnd symbols checkEric Engestrom2019-07-102-1/+2
| | | | | | | | | | | | | According to the spec [1], `__egl_Main` is the only symbol that needs to be exported. We don't want applications directly linking against libEGL_mesa.so (apps should always go through libEGL.so, regardless of who is providing it), so we shouldn't export any other symbols either. [1] https://github.com/NVIDIA/libglvnd/blob/master/include/glvnd/libeglabi.h (this header is the closest there is to a spec) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: rewrite entrypoints checkEric Engestrom2019-07-103-13/+38
| | | | | | | | | | Part of the effort to replace shell scripts with portable python scripts. I could've used a trivial `assert lines == sorted(lines)`, but this way the caller is shown which entrypoint is out of order. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mapi: add shared glapi symbols checkEric Engestrom2019-07-102-0/+31
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* tu: add exported symbols checkEric Engestrom2019-07-101-0/+13
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vulkan: add symbols fileEric Engestrom2019-07-102-0/+15
| | | | | | | | | | | | | | | According to the Vulkan ICD spec [1], these two symbols must be exposed: - vk_icdGetInstanceProcAddr - vk_icdNegotiateLoaderICDInterfaceVersion and this one is optional: - vk_icdGetPhysicalDeviceProcAddr [1] https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* meson: remove unused env_testEric Engestrom2019-07-101-4/+0
| | | | | | | | No longer used as of last commit :) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gles: use new symbols check scriptEric Engestrom2019-07-104-62/+14
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gbm: sort symbolsEric Engestrom2019-07-101-22/+22
| | | | Signed-off-by: Eric Engestrom <[email protected]>
* gbm: use new symbols check scriptEric Engestrom2019-07-102-22/+6
| | | | | | | | | Note: the list in gbm-symbols.txt is the same as the one that was in gbm-symbols-check, I just took the opportunity to sort it. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: use new symbols check scriptEric Engestrom2019-07-102-30/+10
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* symbols-check: introduce new python scriptEric Engestrom2019-07-102-0/+116
| | | | | | | | | | | | | | | | | | | | I've re-written this in bash a couple times over the years, and then I realised python is much more portable and already required by Mesa, so we might as well make use of it. I decided to still use the build system's NM instead of re-implementing symbols extraction, to offload the complexity of keeping it compatible with many systems (Linux, Unix, BSD, MacOS, etc.), especially when cross-building. This new script checks not only that nothing is exported when it shouldn't be, but also that everything that should be exported is. Sometimes, some symbols _can_ be exported but don't have to be, in which case they can be prefixed with `(optional)`. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* nv50/ir/nir: implement load/store_globalKarol Herbst2019-07-101-0/+36
| | | | | | | | | required by OpenCL v2: fix setting globalAccess Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* nv50/ir/nir: handle kernel inputsKarol Herbst2019-07-101-3/+18
| | | | | | | required by OpenCL Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* nv50/ir/nir: don't assert on !mainKarol Herbst2019-07-101-2/+0
| | | | | | | required for OpenCL Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* nv50/ir/nir: parse system values first and stop for compute shadersKarol Herbst2019-07-101-29/+32
| | | | | | | required by OpenCL Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* nir/lower_io: Don't use variable to get deref modeConnor Abbott2019-07-101-2/+3
| | | | | | | | | | | | | | | Drivers only use lower_io for modes where pointers don't have a meaningful value, and dereferences can always be traced back to a variable. But there can be other modes, like global mode with VK_EXT_buffer_device_address, where pointers cannot be traced back to a variable, and lower_io would segfault on loads/stores of these since nir_deref_instr_get_variable() would return NULL. Just use the mode on the deref itself to filter out these modes before we try to get the variable. Fixes: 118a66df990 ("radv: Use NIR barycentric coordinates") Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Don't optimize after lowering FS inputsConnor Abbott2019-07-101-1/+0
| | | | | | | | | | | | | | | | | Currently this is done rather late in radv, after lowering booleans, so it isn't safe to run additional optimizations that may add e.g. 1-bit booleans. We could move the lowering parts earlier, but since right now we only lower FS inputs and by this point all indirects have been lowered away, there's no reason we should need to optimize anything. One shader from Devil May Cry 5 was getting optimized, but only because the optimization loop was working on 32-bit booleans which revealed an opportunity that was hidden with 1-bit booleans, and we generated a 1-bit boolean which is invalid. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111092 Fixes: 118a66df9907772bb9e5503b736c95d7bb62d52c Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* android: amd/addrlib: add gfx10 supportMauro Rossi2019-07-101-0/+1
| | | | | | | | | | | | | Fix the following building error: external/mesa/src/amd/addrlib/src/gfx10/gfx10addrlib.cpp:35:10: fatal error: 'gfx10_gb_reg.h' file not found ^~~~~~~~~~~~~~~~ 1 error generated. Fixes: 78cdf9a ("amd/addrlib: add gfx10 support") Signed-off-by: Mauro Rossi <[email protected]> Acked-by: Marek Olšák <[email protected]>
* android: amd/common/gfx10: add register JSONMauro Rossi2019-07-101-8/+26
| | | | | | | | | | | | | | | The necessary Android makefile building rules are added and the generation rules are simplified for readability Fixes the following building errors: external/mesa/src/amd/common/ac_llvm_build.c:1496:45: error: use of undeclared identifier 'V_008F0C_IMG_FORMAT_8_UINT' case V_008F0C_BUF_DATA_FORMAT_8: format = V_008F0C_IMG_FORMAT_8_UINT; break; ^ Fixes: 74a26af ("amd/common/gfx10: add register JSON") Signed-off-by: Mauro Rossi <[email protected]> Acked-by: Marek Olšák <[email protected]>
* android: radeonsi/gfx10: generate gfx10_format_table.h (v2)Mauro Rossi2019-07-101-0/+16
| | | | | | | | | | | | | | | Fix Android building rules for gfx10_format_table.h generated header (v2) Add LOCAL_C_INCLUDES += $(intermediates)/radeonsi to fix error: external/mesa/src/gallium/drivers/radeonsi/si_state.c:46:10: fatal error: 'gfx10_format_table.h' file not found ^~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Fixes: 0ffa229 ("radeonsi/gfx10: generate gfx10_format_table.h") Signed-off-by: Mauro Rossi <[email protected]> Acked-by: Marek Olšák <[email protected]>
* android: virgl: remove unnecessary LOCAL_C_INCLUDESChih-Wei Huang2019-07-102-4/+0
| | | | | | | The path could be imported automatically. Signed-off-by: Chih-Wei Huang <[email protected]> Reviewed-by: Mauro Rossi <[email protected]>
* android: vulkan/util: fix generating vk_enum_to_str.*Chih-Wei Huang2019-07-101-2/+4
| | | | | | | | | | | | | | | | | | | | The gen_enum_to_str.py generates vk_enum_to_str.c and its header at once. However, the makefiles incorrectly list both files parallel with the same recipes. That means both two files may be generated simultaneously by two processes. The generating files may be truncated by another process, as shown below: $ cd $OUT/obj/STATIC_LIBRARIES/libmesa_vulkan_util_intermediates/util $ ls -l -rw-rw-r-- 1 lh lh 193713 Jul 5 13:31 vk_enum_to_str.c -rw-rw-r-- 1 lh lh 4609 Jul 5 13:31 vk_enum_to_str.d -rw-rw-r-- 1 lh lh 0 Jul 5 16:21 vk_enum_to_str.h Let one file depends on the other with empty recipe to avoid the issue. Signed-off-by: Chih-Wei Huang <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* android: radv: import include paths from used librariesChih-Wei Huang2019-07-101-11/+5
| | | | | | | | | It's unnecessary to manually add these include paths since they could be imported automatically. Signed-off-by: Chih-Wei Huang <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]>
* android: anv: import include path of libmesa_nirChih-Wei Huang2019-07-101-18/+18
| | | | | | | | | | | Add libmesa_nir to a common LOCAL_STATIC_LIBRARIES defined by ANV_STATIC_LIBRARIES so that its include path can be imported automatically. Then ANV_INCLUDES is unnecessary and could be eliminated. Signed-off-by: Chih-Wei Huang <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]>
* android: anv: eliminate libmesa_anv_entrypointsChih-Wei Huang2019-07-101-62/+20
| | | | | | | | | | | The dummy library libmesa_anv_entrypoints is totally unnecessary. The four VULKAN_GENERATED_FILES could be generated and built in libmesa_vulkan_common directly. The libraries using the generated headers should get it via the exported include path. Signed-off-by: Chih-Wei Huang <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]>
* android: vulkan/util: fix export pathChih-Wei Huang2019-07-103-4/+1
| | | | | | | | | Export the correct include path so that the libraries use it can get it automatically. Signed-off-by: Chih-Wei Huang <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]>
* android: radv: fix improper use of LOCAL_WHOLE_STATIC_LIBRARIESChih-Wei Huang2019-07-101-2/+3
| | | | | | | | | | | The libmesa_git_sha1 is a dummy library. There is no reason to put it into LOCAL_WHOLE_STATIC_LIBRARIES. Move libmesa_vulkan_util to the vulkan.radv which really needs it. Signed-off-by: Chih-Wei Huang <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]>
* android: anv: fix improper use of LOCAL_WHOLE_STATIC_LIBRARIESChih-Wei Huang2019-07-101-9/+9
| | | | | | | | | | | The libmesa_anv_entrypoints and libmesa_genxml are dummy libraries. There is no reason to put them into LOCAL_WHOLE_STATIC_LIBRARIES. Move libmesa_vulkan_util to the vulkan HAL which really needs it. Signed-off-by: Chih-Wei Huang <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]>
* android: radv: remove unused LOCAL_EXPORT_C_INCLUDE_DIRSChih-Wei Huang2019-07-101-4/+0
| | | | | | | | | The vulkan module is the final HAL. No need to export its headers since none will import it. Signed-off-by: Chih-Wei Huang <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]>
* android: anv: remove unused LOCAL_EXPORT_C_INCLUDE_DIRSChih-Wei Huang2019-07-101-2/+0
| | | | | | | | | The vulkan module is the final HAL. No need to export its headers since none will import it. Signed-off-by: Chih-Wei Huang <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]>
* nir/loop_analyze: Pass nir_const_values directly to helpersJason Ekstrand2019-07-101-13/+10
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* nir/loop_analyze: Properly handle swizzles in loop conditionsJason Ekstrand2019-07-101-140/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit re-plumbs all of nir_loop_analyze to use nir_ssa_scalar for all intermediate values so that we can properly handle swizzles. Even though if conditions are required to be scalars, they may still consume swizzles so you could have ((a.yzw < b.zzx).xz && c.xx).y == 0 as your loop termination condition. The old code would just bail the moment it saw its first non-zero swizzle but we can now properly chase the scalar from the if condition to all the way to a, b, and c. Shader-db results on Kaby Lake: total loops in shared programs: 4388 -> 4364 (-0.55%) loops in affected programs: 29 -> 5 (-82.76%) helped: 29 HURT: 5 Shader-db results on Haswell: total loops in shared programs: 4370 -> 4373 (0.07%) loops in affected programs: 2 -> 5 (150.00%) helped: 2 HURT: 5 Reviewed-by: Timothy Arceri <[email protected]>
* nir/loop_analyze: Refactor detection of limit varsJason Ekstrand2019-07-101-54/+51
| | | | | | | | | This commit reworks both get_induction_and_limit_vars() and try_find_trip_count_vars_in_iand to return true on success and not modify their output parameters on failure. This makes their callers significantly simpler. Reviewed-by: Timothy Arceri <[email protected]>
* nir: Add some helpers for chasing SSA values properlyJason Ekstrand2019-07-101-0/+80
| | | | | | | | | | There are various cases in which we want to chase SSA values through ALU ops ranging from hand-written optimizations to back-end translation code. In all these cases, it can be very tricky to do properly because of swizzles. This set of helpers lets you easily work with a single component of an SSA def and chase through ALU ops safely. Reviewed-by: Timothy Arceri <[email protected]>
* nir/loop_analyze: Bail if we encounter swizzlesJason Ekstrand2019-07-101-0/+22
| | | | | | | | | | | | | | | | | | | | | | | None of the current code knows what to do with swizzles. Take the safe option for now and bail if we see one. This does have a small shader-db impact but it is at least safe. Shader-db results on Kaby Lake: total loops in shared programs: 4364 -> 4388 (0.55%) loops in affected programs: 5 -> 29 (480.00%) helped: 5 HURT: 29 Shader-db results on Haswell: total loops in shared programs: 4373 -> 4370 (-0.07%) loops in affected programs: 5 -> 2 (-60.00%) helped: 5 HURT: 2 Fixes: 6772a17acc8ee "nir: Add a loop analysis pass" Reviewed-by: Timothy Arceri <[email protected]>
* nir/loop_analyze: Use new eval_const_* helpers in test_iterationsJason Ekstrand2019-07-101-6/+4
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* nir/loop_analyze: Handle bit sizes correctly in calculate_iterationsJason Ekstrand2019-07-101-27/+48
| | | | | | | | | | The current code assumes everything is 32-bit which is very likely true but not guaranteed by any means. Instead, use nir_eval_const_opcode to do the calculations in a bit-size-agnostic way. We also use the new constant constructors to build the correct size constants. Fixes: 6772a17acc8ee "nir: Add a loop analysis pass" Reviewed-by: Timothy Arceri <[email protected]>
* nir/loop_analyze: Fix phi-of-identical-alu detectionJason Ekstrand2019-07-101-26/+29
| | | | | | | | | | | | | One issue was that the original version didn't check that swizzles matched when comparing ALU instructions so it could end up matching very different instructions. Using the nir_instrs_equal function from nir_instr_set.c which we use for CSE should be much more reliable. Another was that the loop assumes it will only run two iterations which may not be true. If there's something which guarantees that this case only happens for phis after ifs, it wasn't documented. Fixes: 9e6b39e1d521 "nir: detect more induction variables" Reviewed-by: Timothy Arceri <[email protected]>
* nir/instr_set: Expose nir_instrs_equal()Jason Ekstrand2019-07-102-59/+62
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* nir/builder: Use nir_const_value_for_* for constructing immediatesJason Ekstrand2019-07-101-102/+50
| | | | Reviewed-by: Timothy Arceri <[email protected]>