aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* intel/fs/gen12: Fix interaction of SWSB dependency combination with EU ↵Francisco Jerez2020-03-261-10/+11
| | | | | | | | | | | | | | | | | fusion workaround. This has been reported to fix a hang in Shadow of Mordor on Gen12. One of its compute shaders seems to cause an in-order exec_all dependency to be merged into an out-of-order SET dependency slot, which would prevent us from baking the SET dependency into the parent instruction, leading to an assert failure in emit_inst_dependencies() (Thanks to Rafael for noticing that). Prevent that by avoiding combination of in-order dependencies whenever that would cause a SET dependency to be demoted to a SYNC.NOP instruction. Fixes: e14529ff3262a527 "intel/fs/gen12: Workaround data coherency issues due to broken NoMask control flow." Tested-by: Rafael Antognolli <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* x86_init_func_common: Add ENDBR at function entryH.J. Lu2020-03-261-0/+5
| | | | | | | | | | | | | | | | Intel Control-flow Enforcement Technology (CET): https://software.intel.com/en-us/articles/intel-sdm when IBT is enabled, all indirect branch targets must start with ENDBR instruction which is a NOP on non-CET processors. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2575 Acked-by: Matt Turner <[email protected]> Reviewed-by: Ben Widawsky <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3985> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3985>
* intel/aub_viewer: Fix format specifier for uint64_tDanylo Piliaiev2020-03-261-7/+7
| | | | | | | | | | Use PRIx64 instead of lx for uint64_t Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2692 Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Sagar Ghuge <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4331> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4331>
* panfrost: Extend the tiled store fast-path to loadsIcecream952020-03-261-28/+47
| | | | | | | | | | | | The access functions are forced to be inline, so performance shouldn't be impacted for stores. WebGL performance in Firefox is more than doubled, and track loading in STK is noticeably faster. Reviewed-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4317> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4317>
* mesa/format_utils: Add a fast-path for RGBA to BGRAIcecream952020-03-261-0/+9
| | | | | | | | | | | | | | This is similar to an existing fast-path, but this is for an array source while the existing one is for an array destination. Firefox can hit this case for WebGL when GL compositing is not used. For a WebGL sample on the Panfrost driver, the frame-rate increased from 19.4 fps to 20.6 fps, which is a 6% gain. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4315> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4315>
* glsl: set error_emitted true if type not ok for assignmentTapani Pälli2020-03-261-2/+5
| | | | | | | | | | | | | | Patch changes also existing assert to not trigger when we have error types in assignment. v2: simplify, cleanup (Ian) Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2629 Fixes: d1fa69ed61d ("glsl: do not attempt assignment if operand type not parsed correctly") Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4178> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4178>
* gitlab-ci: Fix traces caching in tracieAlexandros Frantzis2020-03-261-1/+1
| | | | | | | | | | | | We are currently comparing a hex string representation of the git lfs OID with a byte array representation of the locally calculated OID, causing detection of valid cached traces to fail. Ensure we are comparing compatible representations (in this case hex strings). Signed-off-by: Alexandros Frantzis <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4300> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4300>
* vtn/opencl: add rint-supportBoris Brezillon2020-03-261-0/+2
| | | | | | | Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4318> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4318>
* vtn/opencl: add native exp2/log2-supportErik Faye-Lund2020-03-261-0/+4
| | | | | Reviewed-by: Karol Herbst <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4318>
* vtn/opencl: add native exp10/log10-supportErik Faye-Lund2020-03-261-0/+6
| | | | | | Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4318>
* vtn/opencl: add native exp/log-supportErik Faye-Lund2020-03-261-0/+6
| | | | | | Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4318>
* compiler/nir: move build_log helper into builtin-builderErik Faye-Lund2020-03-262-16/+13
| | | | | | Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4318>
* compiler/nir: move build_exp helper into builtin-builderErik Faye-Lund2020-03-262-18/+15
| | | | | | Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4318>
* vtn/opencl: fully enable OpenCLstd_ClzErik Faye-Lund2020-03-261-0/+1
| | | | | | | Fixes: 7325f6ac987 ("vtn/opencl: add clz support") Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4318>
* gitlab-ci: re-enable mali400/450 and t820 jobsNeil Armstrong2020-03-261-6/+6
| | | | | | | | | | | | | The FILES_HOST_NAME and FILES_HOST_URL are in the baylibre's runner environment to make it more flexible. Also use the new aarch64 mesa-ci-aarch64-lava-baylibre runner with embedded nginx server to serve the LAVA artifacts. Signed-off-by: Neil Armstrong <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4295> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4295>
* gitlab-ci: add FILES_HOST_URL and move FILES_HOST_NAME into jobsNeil Armstrong2020-03-261-5/+9
| | | | | | | | | | The FILES_HOST_URL & FILES_HOST_NAME will be in the Baylibre's runner environment, move them into the t860/t720/t760 jobs using Collabora's runner. Signed-off-by: Neil Armstrong <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4295>
* gitlab-ci: Serve files for LAVA via separate serviceTomeu Vizoso2020-03-263-25/+22
| | | | | | | | | | | | | | | | | Currently, we store the kernel and ramdisk for each LAVA job in the artifacts of the job that built them. Because artifacts are stored in GCE and LAVA labs aren't, this causes a lot of egress with is expensive. To avoid this, have runners download most of the data via the (cached) container images once, and for each job upload the kernel and ramdisk to a server outside GCE. Right now we only have Collabora's runner with a local web server, so jobs that go to Baylibre's lab have been disabled. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4295>
* gitlab-ci: Place files from the Mesa repo into the build tarballTomeu Vizoso2020-03-2610-57/+49
| | | | | | | | | | | | | | | | | | There's some files from the .gitlab-ci directory that are needed in the test stage and that, because the Mesa repository isn't checked out in that stage, need to be made available through other means. Because those files are going to be needed in LAVA devices, place them ino the tarball containing the built files so it's available to both gitlab-ci runners and LAVA devices. Before those files were passed in the artifacts of the Gitlab CI job, but this commit places them into the built tarball so scripts later in the pipeline don't need to account for this discrepancy. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4295>
* radeonsi: enable full out-of-order drawing when allow_draw_out_of_order is setMarek Olšák2020-03-261-2/+4
| | | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4152> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4152>
* mesa: allow out-of-order drawing to optimize immediate mode if it's safeMarek Olšák2020-03-2617-2/+134
| | | | | | | | | This increases performance by 11-13% in Viewperf11/Catia - first scene. Set allow_draw_out_of_order=true to enable this. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4152>
* glsl_to_tgsi: set shader_info::writes_memoryMarek Olšák2020-03-261-0/+8
| | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4152>
* nir: add and gather shader_info::writes_memoryMarek Olšák2020-03-262-0/+97
| | | | | | | for out-of-order drawing. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4152>
* radeonsi: Stop exposing PIPE_SHADER_CAP_FP16Kristian H. Kristensen2020-03-251-1/+1
| | | | | | | Not fully supported. Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4321> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4321>
* util/u_process: Add util_get_process_exec_path for macOS.Vinson Lee2020-03-251-0/+9
| | | | | | | | | Fixes: f8f1413070ae ("util/u_process: add util_get_process_exec_path") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2682 Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4313> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4313>
* freedreno: ssbo: mark resource read or written depending on usageChristian Gmeiner2020-03-251-10/+15
| | | | | | | Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Rob Clark <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1963> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1963>
* freedreno: ssbo: keep track if a buffer gets writtenChristian Gmeiner2020-03-252-0/+3
| | | | | | Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1963>
* freedreno: simplify fd_set_shader_buffers(..)Christian Gmeiner2020-03-251-16/+8
| | | | | | | | | Clear the modified bits for enabled_mask and then iterate over the whole range and set the specific bit where there is a buffer. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1963>
* freedreno: calculate modified bit mask only onceChristian Gmeiner2020-03-251-6/+2
| | | | | | Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1963>
* gallium/util: Add back (and rename) util_float_to_half implementationRoland Scheidegger2020-03-252-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | | This implementation was removed by 8b8af6d3 ("gallium/util: Switch util_float_to_half to _mesa_float_to_half()'s impl.") It was not actually broken, but _mesa_float_to_half() implements round-to-nearest-even, whereas util_float_to_half() implemented round-to-zero. So rename it appropriately. GL actually never cares about rounding (except a broken piglit test), however d3d10 very much does and requires RTZ for float to half conversion. Moreover, apparently at least radeon gpus actually always do RTZ when doing RT writes (and I'd suspect for shader image writes as well). Hence it seems appropriate to hook up this rtz function to the format instead. This will cause llvmpipe and softpipe to use rtz rounding for clears with half float formats, and softpipe would use rtz behavior for rt writes as well (llvmpipe has that hardcoded), not sure if "real" hw drivers hit this function for much. (For shader opcodes would still need to figure out what rounding to use appropriately, but this is a question for another day.) Note should probably unify with _mesa_float_to_float16_rtz. Unclear at this point which one is better, so just restore previous function here. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4312> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4312>
* etnaviv: Emit PE.ALPHA_COLOR_EXT* on GPUs with half-float supportMarek Vasut2020-03-251-1/+2
| | | | | | | | | | | | | | | | | | | | At least GC880 (iMX6S), GC2000 (iMX6Q) blobs do not emit the PE.ALPHA_COLOR_EXT0 and PE.ALPHA_COLOR_EXT1 into the command stream. The GCnano (STM32MP1) is not affected by this change either. This is because neither of these GPUs support the half-float feature. Emit PE.ALPHA_COLOR_EXT* in etnaviv only if half-float support is present in the GPU. This fixes all of the currently failing dEQPs in this group: dEQP-GLES2.functional.fragment_ops.blend.* Fixes: 76adf041f25 ("etnaviv: fix blend color on newer GPUs") Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Jonathan Marek <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4277> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4277>
* 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>
* rbug: do not return void-valueErik Faye-Lund2020-03-251-1/+1
| | | | | | | | | | | | Returning a void-value is nonsensical, and in this case it seems like a mistake. This eliminates a warning when building on MSVC. Fixes: fb04e5da97d ("gallium: add pipe_screen::finalize_nir") Reviewed-by: Brian Paul <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4297> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4297>
* rbug: clean up cast-warningsErik Faye-Lund2020-03-251-2/+2
| | | | | | | | | Similarly to the previous cast; on 64-bit Windows, unsigned long is 32-bit, and casting a pointer to a non-matchin bit-width integer produce warnings. So let's use uintpre_t for this purpose instead. Reviewed-by: Brian Paul <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4297>
* pipebuffer: clean up cast-warningsErik Faye-Lund2020-03-251-2/+2
| | | | | | | | | | | | | | | | | This code produces warnings, so let's fix that. The problem is that casting a pointer to an integer of non-pointer-size triggers warnings on MSVC, and on 64-bit Windows unsigned long is 32-bit large. So let's instead use uintptr_t, which is exactly for these kinds of things. While we're at it, let's make the resulting index a plain "unsigned", which is the type this originated from before we started with this cast-dance. Fixes: 1a66ead1c75 ("pipebuffer, winsys/svga: Add functionality to update pb_validate_entry flags") Reviewed-by: Brian Paul <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4297>
* vulkan/overlay: Add a workaround semaphore for application presenting ↵Lionel Landwerlin2020-03-251-19/+53
| | | | | | | | | | | | | | without one When an application calls vkQueuePresent() on a different queue than the one we run our drawing on and it doesn't give a semaphore to wait on, let's insert our own semaphore so that we don't race the application's drawing. Signed-off-by: Lionel Landwerlin <[email protected]> Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2540 Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3893> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3893>
* ac: fix ac_build_is_helper_invocation when postponed_kill is nullPierre-Eric Pelloux-Prayer2020-03-251-0/+3
| | | | | | | | | | | If there was no demote() in the shader, ac_build_is_helper_invocation behaves exactly the same as ac_build_load_helper_invocation, i.e. the helper lanes are the same as they were at the beginning of the shader. Fixes: de57ea2a3da ("amd/llvm: implement nir_intrinsic_demote(_if) and nir_intrinsic_is_helper_invocation") Reviewed-by: Daniel Schürmann <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4301> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4301>
* nir: update uses_demote flag in discard_to_demote passPierre-Eric Pelloux-Prayer2020-03-251-0/+2
| | | | | | | | | Otherwise the ctx.ac.postponed_kill will not be allocated. Fixes: ce87da71e93 ("nir: add pass to lower discard() to demote()") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2662 Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4301>
* glsl/lower_precision: Lower builtins depending on argumentsNeil Roberts2020-03-241-2/+105
| | | | | | | | | | | | | | | | | | | | | | When an ir_call is encountered that invokes a builtin, it will now try to generate a lowered version of the builtin. This only happens if all of the arguments to the function are lowerable. Previously the builtin would be inlined before the lowering pass is invoked and then the implementation would be lowered as a consequence of the pass. However this causes problems if the builtin has multiple arguments and the implementation has operations on only a few of the arguments before combining it with the others. In that case the entire builtin should only be lowered if all of the arguments are lower precision. The previous approach would end up lowering only parts of the implementation. The lowered implementations are cached in a hash table in case they can be reused. Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* glsl: Inline builtins in a separate passNeil Roberts2020-03-246-5/+68
| | | | | | | | | | | | | | | Previously, the ir_call functions for builtin functions were replaced with the inline implementation immediately after being added to the instruction list. This patch replaces that with a separate pass that lowers them after the conversion from AST to IR is complete. This will be useful to be able to insert some handling for the precision lowering pass before the inlining. This needs to happen because the precision of the operations in the inlined implementation depends on the highest precision of all of the arguments to the call. Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* freedreno/ir3: enable nir_opt_loop_unroll on a6xxHyunjun Ko2020-03-241-1/+1
| | | | | | | | | | | | | If precision lowering happens at GLSL IR, loop_analysis at IR doesn't work as expected since it can't handle things like: "(expression bool < (expression float16_t f2fmp (var_ref ndx) ) (constant float16_t (1.000000)) )" So we'd rather do this optimization at the NIR stage. Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* freedreno/ir3: Lower bools to bitsizeNeil Roberts2020-03-241-1/+1
| | | | | | Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* nir: add a bool bitsize lowering passIago Toral Quiroga2020-03-244-0/+434
| | | | | | | | | | | | | The pass lowers 1-bit booleans produced by NIR to the native bitsize of the operations that produce them. v2: change on lower_load_const_instr after upstream changes. Added TODO2 to explain it, as it was not properly tested yet (see already existing TODO) (Neil) Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* freedreno: Enable mediump loweringHyunjun Ko2020-03-242-2/+4
| | | | | | Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* glsl: Add unit tests for the lower_precision passNeil Roberts2020-03-242-0/+400
| | | | | | | | | Adds a unit tests script that invokes the standalone compiler with --lower-precision and verifies that lowered operations are being used. Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* glsl/standalone: Add an option to lower the precisionNeil Roberts2020-03-243-0/+10
| | | | | | | | | | Adds a --lower-precision option that just sets the LowerPrecision compiler option. That way it can be used in unit tests to test the precision lowering pass. Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* glsl: Add an IR lowering pass to convert mediump operations to 16-bitNeil Roberts2020-03-248-0/+642
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This works by finding the first rvalue that it can lower using an ir_rvalue_visitor. In that case it adds a conversion to float16 after each rvalue and a conversion back to float before storing the assignment. Also it uses a set to keep track of rvalues that have been lowred already. The handle_rvalue method of the rvalue visitor doesn’t provide any way to stop iteration. If we handle a value in find_precision_visitor we want to be able to stop it from descending into the lowered rvalue again. Additionally this pass disallows converting nodes containing non-float. The can_lower_rvalue function explicitly excludes any branches that have non-float types except bools. This avoids the need to have special handling for functions that convert to int or double. Co-authored-by: Hyunjun Ko <[email protected]> v2. Adds lowering for texture samples v3. Instead of checking whether each node can be lowered while walking the tree, a separate tree walk is now done to check all of the nodes in a single pass. The lowerable nodes are added to a set which is checked during find_precision_visitor instead of calling can_lower_rvalue. v4. Move the special case for temporaries to find_lowerable_rvalues. This needs to be handled while checking for lowerable rvalues so that any later dereferences of the variable will see the right precision. v5. Add an override to visit ir_call instructions and apply the same technique to override the precision of the temporary variable in the same way as done for builtin temporaries and ir_assignment calls. v6. Changes the pass so that it doesn’t need to lower an entire subtree in order do perform a lowering. Instead, certain instructions can be marked as being indepedent of their child instructions. For example, this is the case with array dereferences. The precision of the array index doesn’t have any bearing on whether things using the result of the array deref can be lowered. Now, only toplevel lowerable nodes are added to the lowerable_rvalues instead instead of additionally adding all of the subnodes. It now also only needs one hash table instead of two. v7. Don’t try to lower sampler types. Instead, the sample instruction is now treated as an independent point where the result of the sample can be used in a lowered section. The precision of the sampler type determines the precision of the sample instruction. This also means the coordinates to the sampler can be lowered. v8. Use f2fmp instead of f2f16. v9. Disable lowering derivatives calcualtions, which might not work properly on some hw backends. Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* glsl/hierarchical_visitor: Call leave_callback on leaf nodesNeil Roberts2020-03-242-12/+20
| | | | | | | | | | | Previously for leaf ir_instructions only the enter callback was called. This makes it a bit difficult to make a pass that wants to visit every instruction using a stack. Making it call the leave callback as well makes it behave less surprisingly. Reviewed-by: Kristian H. Kristensen <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* glsl: Add a method to get precision from a deref instructionNeil Roberts2020-03-241-0/+28
| | | | | | | | | | | | Adds ir_dereference::precision(). For a normal variable dereference, the precision comes from the variable. For a record member it comes from the field within the record. For an array it can come from either, depending on where the underlying array is stored. The method recursively walks the derefs until it finds one of the first two. Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
* i965/iris: fix crash when calling GetPerfQueryDataINTELLionel Landwerlin2020-03-241-0/+9
| | | | | | | | | On a query that was never begun. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4302> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4302>
* glthread: compile marshal_generated.c faster by breaking it up into 8 filesMarek Olšák2020-03-246-25/+93
| | | | | | Reviewed-by: Alyssa Rosenzweig <[email protected] Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4270> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4270>