Commit Graph

136803 Commits

Author SHA1 Message Date
Jesse Natalie 012bc2fc77 meson, util: Make zlib optional again
This adds a HAVE_COMPRESSION macro, which is undefined if neither zlib
nor zstd are present, and is used to no-op compress.h/c. This also has
a side effect of fixing SCons, since it won't define this macro.

Fixes: d7ecbd5bf8 ("util: create some standalone compression helpers")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9689>
2021-03-19 19:33:59 +00:00
Jesse Natalie 28bf06f350 panfrost: Add a Meson dependency on bi_opcodes.h for bifrost_compiler
Fixes: 2d4597de ("pan/bi: Use autogenerated modifiers")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9719>
2021-03-19 19:22:29 +00:00
Lepton Wu c54fb6ef3d virgl: Don't destroy resource while it's in use.
This is the race condition: thread 1 check reference count of resource
and then find out out it's zero and then it begin to destroy it. Around
the same time, thread 2 gets the lock and get the resource from the hash
table and plan to use it. Then this resource gets destroyed while it's
still in use.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9701>
2021-03-19 18:58:01 +00:00
Michel Zou bf549e4c88 lavapipe: Fix type narrowing
On win32 long size is 4 and narrows down pointer size on i686

Fixes: a986d1ed (lavapipe: add support for KHR_buffer_device_address.)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9706>
2021-03-19 18:15:50 +00:00
Rhys Perry 854b33de2f radv: lower variables to ssa before nir_propagate_invariant
Variables make the propagation more conservative than it needs to be.

fossil-db (GFX10.3, based on !8056):
Totals from 22102 (15.86% of 139391) affected shaders:
SGPRs: 1103833 -> 1104265 (+0.04%); split: -0.06%, +0.10%
VGPRs: 851316 -> 849396 (-0.23%); split: -0.58%, +0.35%
CodeSize: 34422452 -> 34206052 (-0.63%); split: -0.72%, +0.09%
MaxWaves: 291050 -> 291186 (+0.05%); split: +0.23%, -0.18%
Instrs: 6749188 -> 6662804 (-1.28%); split: -1.37%, +0.09%
Cycles: 63456312 -> 62995828 (-0.73%); split: -0.92%, +0.20%

fossil-db (GFX10.3):
Totals from 841 (0.60% of 139391) affected shaders:
VGPRs: 44444 -> 44500 (+0.13%)
CodeSize: 3985604 -> 3987188 (+0.04%); split: -0.11%, +0.15%
Instrs: 748847 -> 749174 (+0.04%); split: -0.13%, +0.18%
Cycles: 35801628 -> 35825676 (+0.07%); split: -0.23%, +0.30%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8493>
2021-03-19 18:04:00 +00:00
Danylo Piliaiev 9efec45b0c ir3: disallow .sat on SEL instructions
Saturation is unsupported on SEL instructions.

Fixes main menu rendering in Genshin Impact.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9666>
2021-03-19 17:09:07 +00:00
Mike Blumenkrantz 6cff8ec5a6 ci/lavapipe: split out lavapipe ci into lavapipe dir
there's no need to run llvmpipe jobs if only lavapipe has changed

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9695>
2021-03-19 16:21:26 +00:00
Marek Olšák e5ea9a3baa radeonsi: add a fast path for MSAA resolving with RGB -> BGR swizzling
When we encounter a situation when we need to swizzle, which the CB can't
resolve in one pass, swap the channel order on the next clear, so that we
don't have to swizzle.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9615>
2021-03-19 16:05:03 +00:00
Marek Olšák 88e0e4f70e radeonsi: select the optimal micro tile mode at clear regardless of fast clear
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9615>
2021-03-19 16:05:03 +00:00
Marek Olšák e3e66e1fab util: add new helper util_format_rgb_to_bgr
We have BGR formats for all RGB formats where it matters except
USCALED/SSCALED. radeonsi will use it.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9615>
2021-03-19 16:05:02 +00:00
Marek Olšák 5a29a55aa3 util: fail assertion in util_format_linear if it can't translate SRGB format
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9615>
2021-03-19 16:05:02 +00:00
Marek Olšák aff4c790ea util: add most missing formats with reversed RGB channel order
This will be used for RGB->BGR enum translation.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9615>
2021-03-19 16:05:02 +00:00
Adam Jackson 9064d801a9 glx/drisw: Implement WaitX and WaitGL
My goodness.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9696>
2021-03-19 15:43:49 +00:00
Mike Blumenkrantz 63bed3d55b zink: correctly clamp samplerview surface types
this fixes a bunch of cube stuff, e.g., spec@oes_texture_view@sampling-2d-array-as-cubemap-array

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9685>
2021-03-19 15:31:45 +00:00
Mike Blumenkrantz 3ab99ad14b zink: improve surface viewtype clamping
a cube array can still work with a nonzero first layer

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9685>
2021-03-19 15:31:45 +00:00
Mike Blumenkrantz 813a7e64bd zink: break out surface viewtype clamping into util function
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9685>
2021-03-19 15:31:45 +00:00
Adam Jackson 70d87dd41d glx: Remove windows' stub {bind,release}_text_image context hooks
All this could have done is make GLX_EXT_texture_from_pixmap appear to
be supported when it won't work.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9690>
2021-03-19 11:13:07 -04:00
Adam Jackson 621b3a4041 glx: Pull get_proc_address out of the context vtable
One, only applegl needs this. Two, this isn't a function of the context
in any way so it doesn't belong in the context vtable. Just special-case
applegl for now, we can revisit applegl's dispatch later.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9690>
2021-03-19 11:13:07 -04:00
Adam Jackson cba1d6de22 glx: Pull use_x_font out of the context vtable
The client-side implementation of this operates entirely in terms of the
GL and X client APIs. There's nothing DRI-specific about it, evidenced
by apple and windows using it unchanged. Save a little code size by
handling the direct/indirect difference directly.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9690>
2021-03-19 11:13:07 -04:00
Simon Ser a6cd30333c egl/wayland: avoid unnecessary roundtrip when authenticated
When the compositor advertises a render node, we don't need to
perform DRM authentication. Skip the unnecessary roundtrip in this
case.

Signed-off-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9704>
2021-03-19 14:45:33 +00:00
Erik Faye-Lund b416ae2023 docs: simplify format requirements
When I initially started writing these lists, I expected the lists to be
much less uniform in what bits were required. Turns out I was wrong, and
this ended up really neat and orderly.

I'm sure we're missing some defacto requirements here and there,
especially for the early versions. This list is based on what we check
for in version.c, and it's better than nothing.

Suggested by Mike Blumenkrantz.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9602>
2021-03-19 14:07:42 +00:00
Erik Faye-Lund 5deac5c156 docs: document zink GL 4.6 requirements
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9602>
2021-03-19 14:07:42 +00:00
Erik Faye-Lund 62a27bb091 docs: document zink GL 4.5 requirements
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9602>
2021-03-19 14:07:42 +00:00
Erik Faye-Lund 529d5f38c3 docs: document zink GL 4.4 requirements
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9602>
2021-03-19 14:07:42 +00:00
Erik Faye-Lund 29f8f21bff docs: document zink GL 4.3 requirements
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9602>
2021-03-19 14:07:42 +00:00
Erik Faye-Lund 73ebfcccca docs: remove excessive quoting
Triple backticks doesn't mean anything in RST, so this becomes quoted
strings containing backticks. That's not what I meant here...

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9602>
2021-03-19 14:07:42 +00:00
Erik Faye-Lund 5d0509e367 docs: remove excessive wrapping
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9602>
2021-03-19 14:07:42 +00:00
Erik Faye-Lund 025d707903 docs: remove stray newline
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9602>
2021-03-19 14:07:42 +00:00
Rhys Perry e2cdbb25c7 aco: add ACO_DEBUG=liveinfo
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9599>
2021-03-19 11:27:05 +00:00
Rhys Perry 8e409abf96 docs: document ACO_DEBUG=perfinfo
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9599>
2021-03-19 11:27:05 +00:00
Rhys Perry 22af492b01 aco: add aco_print_program() flags to print live_out and register demand
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9599>
2021-03-19 11:27:05 +00:00
Rhys Perry 8748b1c24f aco: add aco_print_program() flag to print kill flags
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9599>
2021-03-19 11:27:05 +00:00
Rhys Perry 27e2f82f17 aco: implement image_deref_samples
It used to be that this intrinsic was never created and texture
instructions were always used.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 50881d59e6 ("compiler/spirv: fix image sample queries")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9686>
2021-03-19 10:31:46 +00:00
Jordan Justen 16d453da7f genxml/gen12: 3D_MODE bits 31:16 are no longer must-be-one
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9505>
2021-03-19 09:07:37 +00:00
Jordan Justen b9a7f9314b i965/gen11: Fix must-be-ones bit positions in 3D_MODE
Fixes: f0d29238df ("i965/gen11: Emit SLICE_HASH_TABLE when pipes are unbalanced.")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9505>
2021-03-19 09:07:37 +00:00
Michel Dänzer 5057f14cba Revert "glsl/test: Don't run whitespace tests in parallel"
This reverts commit c60cea0daa.

Didn't have the intended effect, and slowed down the meson test run.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
2021-03-19 08:50:38 +00:00
Michel Dänzer d8911a0ae8 Revert "meson: add enable-glcpp-tests option"
This reverts commit f9ae947e72.

Not needed anymore.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
2021-03-19 08:50:38 +00:00
Michel Dänzer fc0d1aab50 Revert "ci: disable glcpp tests for now"
This reverts commit e25a3e21f8.

The test timeouts should be fixed now.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
2021-03-19 08:50:38 +00:00
Michel Dänzer 7fedf51b95 glsl/tests: Use exit code 126 to detect valgrind errors
valgrind returns exit code 126 if it can't write to the file passed to
--log-file. Hopefully it'll be the same for any other invalid valgrind
command line parameters or internal errors as well.

Using a different exit code (31) for this was hiding the fact that the
valgrind test wasn't actually working.

v2:
* Use exit code 126; can't treat any non-0 exit code as failure because
  glcpp is expected to exit with non-0 for some of the input we feed it

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com> # v1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
2021-03-19 08:50:38 +00:00
Michel Dänzer 4cc8c25d56 glsl/tests: Don't use tempfiles
Use pipes for direct communication between child & parent process.

Using tempfiles sometimes resulted in hitting the meson timeout if there
was high filesystem pressure (I saw a single unlink system call take as
long as 4 seconds; attempts to re-use a single tempfile just shifted the
delays to truncate/close systems calls).

As a bonus, this gets the valgrind test actually working as intended.
It wasn't working because the tempfile passed to --log-file didn't exist
(due to the earlier os.close(fd)?).

v2:
* Wrap .read() in "with open()" (Dylan Baker)

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
2021-03-19 08:50:37 +00:00
Michel Dänzer deb654cdd0 glsl/tests: Bump glcpp valgrind test timeout to 240 seconds
Once it's actually working as intended again, it may need that much
time.

v2:
* Bump to 240 seconds, still hit timeouts with 180.
* Don't change test priority.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com> # v1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
2021-03-19 08:50:37 +00:00
Michel Dänzer 26e139c776 ci: Disable valgrind in some build jobs
Once the glcpp valgrind test works as intended again, it would delay
the dependent test jobs by ~1-4 minutes.

The meson-clover job would run the glcpp valgrind test multiple times
and take more than 10 minutes to finish.

valgrind can't work in the meson-android job, would need an ARM backend.

v2:
* Disable in meson-clover as well.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com> # v1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
2021-03-19 08:50:37 +00:00
Michel Dänzer 37855fd59d glcpp: Fully initialize struct gl_context
valgrind flagged members of gl_ctx->Extensions being used uninitialized:

==23417== Conditional jump or move depends on uninitialised value(s)
==23417==    at 0x112642: _glcpp_parser_handle_version_declaration.part.0 (glcpp-parse.y:2493)
==23417==    by 0x11A515: glcpp_lex_update_state_per_token (glcpp-lex.l:132)
==23417==    by 0x11A515: glcpp_lex (glcpp-lex.l:547)
==23417==    by 0x114D46: glcpp_parser_lex (glcpp-parse.y:2302)
==23417==    by 0x114D46: glcpp_parser_parse (glcpp-parse.c:1871)
==23417==    by 0x11ADC6: glcpp_preprocess (pp.c:238)
==23417==    by 0x111384: main (glcpp.c:174)
==23417==  Uninitialised value was created by a stack allocation
==23417==    at 0x111295: main (glcpp.c:136)

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
2021-03-19 08:50:37 +00:00
Michel Dänzer 1eb3a2d8da Revert "ci: Restrict meson-gallium job to gstreamer runners"
This reverts commit 4b4bddcd99.

Not needed anymore with the previous fix.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
2021-03-19 08:50:37 +00:00
Michel Dänzer 05bf12ccb6 intel/tools: Use subprocess.Popen to read output directly from a pipe
Instead of using tempfiles to communicate between child & parent
process. The latter sometimes resulted in hitting the meson timeout if
there was high filesystem pressure.

Fixes: ccaa5b034f "intel/tools: rewrite run-test.sh in python"
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
2021-03-19 08:50:37 +00:00
Mike Blumenkrantz f0c8c6581c llvmpipe/setup: force fs constant updating upon beginning queries
this flushes any pending updates and avoids trying to access constant buffers
which have been unset (and are also potentially deleted)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9692>
2021-03-18 23:15:53 -04:00
Mike Blumenkrantz 6d995d3fe2 lavapipe: force state updates when beginning queries
the full state update is maybe not entirely necessary since this is just
to address descriptor use, but probably it won't hurt

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9692>
2021-03-18 23:15:53 -04:00
Mike Blumenkrantz 007bf1d1dc lavapipe: rewrite cmdbufs to always do descriptor binds/pushes first
llvmpipe has some crazy dependency ordering with constant buffers that
I don't want to mess with, so instead this ensures that descriptors are
always updated as early in the command stream as possible, avoiding any
use-after-free scenarios which might result from lavapipe freeing memory
in a still-bound descriptor that's pending an update

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9692>
2021-03-18 23:15:53 -04:00
Timothy Arceri 4feb26f647 glsl: add compilation errors for attribute and varying qualifiers
These qualifiers were removed in GLSL 4.20 and GLSL ES 3.00. For
desktop GL they are now only allowed if the shader is declared as
a compatibility shader.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9552>
2021-03-19 01:13:17 +00:00
Mike Blumenkrantz 1ab309377e lavapipe: support VK_KHR_copy_commands2
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9693>
2021-03-18 17:14:58 -04:00