Commit Graph

143499 Commits

Author SHA1 Message Date
Alyssa Rosenzweig 95e306dc84 panfrost: Add basic fixed-function blending tests
Add unit tests for the fixed-function blending helpers in pan_blend.c.
Each test consists of a Porter-Duff blend mode and the associated
hardware state. In this commit, we add tests for the most common modes.

For motivation, this code has NOT been properly tested in CI. True,
functional correctness of the blend module as a whole is tested by
dEQP-GLES3.functional.fragment_ops.blend.* among other integration
tests. However, this testing is insufficient to check for regressions.
Crucially, the following broken patch would clear CI:

   bool pan_can_fixed_function(...) {
      return false;
   }

In that case, blend shaders are used 100% of the time, which will
regress performance horribly but still pass dEQP. The only clue
something went wrong would be some traces changing checksum due to the
fixed-function blender producing slightly different output than
equivalent blend shaders. By unit testing the fixed blend path, we
ensure we always use the fixed-function path when we expect it to.

Similarly, using incorrect values for the blend metadata may not affect
functional correctness but will increase power consumption. Let's check
all the data we export to drivers.

Note: due to additive commutativity, there are many pairs of equivalent
Mali blend modes. Unfortunately, the vendor is... inconsistent about how
to resolve ambiguous modes. Our algorithm for computing modes is
correct; the "preferred" values are left in comments since otherwise our
tests fail despite correct code. I want to blame Bifrost for this, but
Midgard was patient zero.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12152>
2021-08-11 18:15:52 +00:00
Alyssa Rosenzweig 95187c03f1 panfrost: Simplify blend_factor_constant_mask
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12152>
2021-08-11 18:15:52 +00:00
Alyssa Rosenzweig 01a1b253b4 panfrost: Fix is_opaque when blend_enable=false
Needed to pass the "replace" unit test.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12152>
2021-08-11 18:15:52 +00:00
Alyssa Rosenzweig b7af56f2ad panfrost: Add blend helper packing the equation
This is more convenient for the Gallium driver and easier to test.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12152>
2021-08-11 18:15:52 +00:00
Alyssa Rosenzweig 7eb2559198 panfrost: Use _PU for non-dithered formats
This is required to disable dithering on a per-draw basis when OPAQUE
output is used (bypassing the blender which normally uses the
round_to_framebuffer_precision flag to do the same).

This functionally reverts:

   ebc07f4b2f ("panfrost: Remove padded unorm blendable formats")
   fae90a7940 ("panfrost: Always pick dithered tb formats")

while adding the functionality to make them useful.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12152>
2021-08-11 18:15:52 +00:00
Alyssa Rosenzweig 07607c8443 panfrost: Remove unused #defines
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12328>
2021-08-11 18:00:45 +00:00
Alyssa Rosenzweig 3ec5e2b6a7 panfrost: Add LINEAR debug option
Useful to cross off CPU texture tiling as the source of bugs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12328>
2021-08-11 18:00:45 +00:00
Alyssa Rosenzweig 3958f00215 pan/bi: Add a noopt debug option
To rule out buggy optimization passes when debugging.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12328>
2021-08-11 18:00:45 +00:00
Alyssa Rosenzweig ff03f096bf pan/bi: Make bi_opt_push_ubo optional
It's an optimization pass -- omitting it should not cause MMU faults
(!). Make sure the UBO push mask is set regardless of whether the pass
is called, and just call the pass when required.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12328>
2021-08-11 18:00:45 +00:00
Lionel Landwerlin 01b0935d31 nir/lower_shader_calls: remove empty phis
This is confusing opt_cse.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8dfb240b1f ("nir: Add raytracing shader call lowering pass.")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11953>
2021-08-11 15:10:07 +03:00
Marcin Ślusarz a1b7a5fad6 zink: use nir_shader_instructions_pass in nir_lower_dynamic_bo_access
Changes:
- nir_metadata_preserve(..., nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
2021-08-11 11:23:30 +00:00
Marcin Ślusarz 50cb70d38a zink: use nir_shader_instructions_pass in lower_discard_if
Changes:
- nir_metadata_preserve(..., nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
2021-08-11 11:23:30 +00:00
Marcin Ślusarz 65f9234f96 microsoft/compiler: use nir_shader_instructions_pass in dxil_nir_lower_double_math
No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
2021-08-11 11:23:30 +00:00
Marcin Ślusarz b8de41902e microsoft/compiler: use nir_shader_instructions_pass in dxil_nir_split_clip_cull_distance
No functional changes.

v2: fix build

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
2021-08-11 11:23:30 +00:00
Marcin Ślusarz 9aafb91f0e microsoft/compiler: preserve all metadata when upcast_phi doesn't make progress
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
2021-08-11 11:23:30 +00:00
Marcin Ślusarz 17a61ec541 microsoft/clc: use nir_shader_instructions_pass in clc_nir_dedupe_const_samplers
Changes:
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

v2: fix build

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
2021-08-11 11:23:30 +00:00
Marcin Ślusarz 70723f278f microsoft/clc: preserve only valid metadata in clc_lower_printf_base
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
2021-08-11 11:23:30 +00:00
Marcin Ślusarz 4d81226102 d3d12: use nir_metadata_none instead of its value
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
2021-08-11 11:23:30 +00:00
Marcin Ślusarz 7810ca596c intel/compiler: use nir_shader_instructions_pass in brw_nir_apply_attribute_workarounds
Changes:
- removal of attr_wa_state (it's passed directly)
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
2021-08-11 11:23:30 +00:00
Marcin Ślusarz e1b325f587 nir/builder: invalidate metadata per function
Fixes: a62098fff2 ("nir: Add a helper for general instruction-modifying passes.")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
2021-08-11 11:23:30 +00:00
Danylo Piliaiev a57bcc4394 freedreno/decode: print estimated crash location without colored output
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12302>
2021-08-11 09:24:19 +00:00
Pierre-Eric Pelloux-Prayer 7684d57a05 nir: add a pass to optimize "gl_FragDepth = gl_FragCoord.z" away
gl_FragDepth default value is gl_FragCoord.z so if a shader does:

   gl_FragDepth = gl_FragCoord.z

we can drop this assignment.

v2: use nir_ssa_scalar_resolved and don't do this is gl_FragDepth
    is wrote multiple times (Jason)
v3: - move to its own pass (Jason)
    - handle var = NULL (Rhys)
v4: refactoring (Jason)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10697>
2021-08-11 11:00:11 +02:00
Kenneth Graunke a6176881a6 iris: Drop dead drm_ioctl prototype
We now use intel_ioctl instead.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12206>
2021-08-11 08:05:00 +00:00
Kenneth Graunke 0707a1d842 iris: Improve the memory layout of iris_bo by fixing pahole issues
We had a 4 byte hole and a 4-byte field breaking up a run of bools.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12206>
2021-08-11 08:05:00 +00:00
Kenneth Graunke 2616e15c01 iris: Rename bo->gtt_offset to bo->address
This is the virtual memory address of the buffer object.  Calling it the
BO's address is a lot more obvious than calling it an offset in one of
the now many graphics translation tables.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12206>
2021-08-11 08:05:00 +00:00
Iago Toral Quiroga c964e5f099 v3d,v3dv: add options to force 32-bit or 16-bit TMU precision
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12303>
2021-08-11 05:57:10 +00:00
Tapani Pälli ff669ea93b anv/android: fix build error due refactoring
Fixes: e08370dc37 ("anv: disable aux for exportable images without modifiers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5208
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12300>
2021-08-11 04:54:05 +00:00
Dave Airlie c16f7e2a19 docs: add llvmpipe host memory extensions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12316>
2021-08-11 10:06:22 +10:00
Dave Airlie c198adf718 lavapipe: add host ptr support.
This actually doesn't need any backend support.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12316>
2021-08-11 09:58:17 +10:00
Dave Airlie 9a57dceeb7 llvmpipe: add support for user memory pointers
This is useful for clover, but throw it at CI at least

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12316>
2021-08-11 09:58:17 +10:00
Icecream95 ee2bb57f1e pan/bi: Use the computed scale for fexp NaN propagation
This makes pow(NaN, x) return NaN rather than 1.0.

Fixes: 499397700c ("pan/bi: Don't lower fpow")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5189
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12269>
2021-08-10 22:42:08 +00:00
Ian Romanick 84d2e53789 Revert "nir/algebraic: Convert some f2u to f2i"
Per https://gitlab.freedesktop.org/mesa/mesa/-/issues/5178#note_1019666,
the assumption fundamental to this optimization is false.  Section
2.4.1 (Float to Integer) of Ivy Bridge PRMs describes the situation.
The wording of the section is somewhat confusing (because it doesn't
clearly delineate between signed and unsigned integers), but the last
two rows of the table make it clear that F->UD conversion clamps
negative float values to 0.

All other hardware mentioned in that thread seems to behave the same
way.

The real problem is that, with hardware that behaves in this ways,
converting f2u(2147483648.0) to f2i(2147483648.0) changes the bit pattern
that would be produced from 0x80000000 to 0x7fffffff.

This reverts commit ad05920258.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12297>
2021-08-10 22:16:13 +00:00
Ian Romanick 3ba66ebbc8 nir/opcodes: Use u_intN_(min|max)
uadd_sat was updated using sed, so I didn't even notice the surrounding
opcodes.  Oops.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12297>
2021-08-10 22:16:13 +00:00
Dave Airlie 7fb9e78d09 clover: only return CLC version as 1.2 (even for 3.0)
Fixes CTS compiler opencl_c_versions

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12286>
2021-08-10 21:38:39 +00:00
Dave Airlie e78d5bb8e2 clover/nir: don't convert to NIR on library link
If just creating a library, just link the spir-v and store it.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12286>
2021-08-10 21:38:39 +00:00
Dave Airlie 6cc1568ff5 clover: fix compilation with clang + llvm 12.
clang in llvm 12 no longer accepts "-cl-denorms-are-zero" as a cc1
options which is how this code uses it.

For now just pick the correct cc1 equivalent.

This fixes a crash with llvm master and CL conversions tests

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12286>
2021-08-10 21:38:39 +00:00
Eric Engestrom 4128acdee3 pick-ui: show commit date
With our ff-only merge setup, the commit date ends up being when the
commit actually landed (as opposed to when it was first written).

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12289>
2021-08-10 21:36:43 +00:00
Eric Engestrom 7ec42b5eda pick-ui: show nomination type in the UI
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12289>
2021-08-10 21:36:43 +00:00
Eric Engestrom db14f2a932 pick-ui: drop assert that optional argument is passed
Let's just make it not-optional instead.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12289>
2021-08-10 21:36:43 +00:00
Rob Clark a79ac1bee1 freedreno: Use correct key for binning pass shader
We updated the key correctly for whether we wanted to use a
safe_constlen binning pass variant, but then passed the wrong
key to ir3_shader_variant().

Fixes: 1dd24bf27b ("freedreno: Share constlen between different stages properly")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12314>
2021-08-10 21:17:17 +00:00
Alyssa Rosenzweig 9b57a81815 nir/lower_mediump: Fix metadata in all passes
Fixes: fb29cef8dd ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11732>
2021-08-10 20:55:33 +00:00
Alyssa Rosenzweig 03c18f7efc nir/lower_mediump_io: Don't remap base unless needed
Otherwise drivers that don't use 16-bit slots for varyings will get
confused and have their driver_locations scribbled over. This has caused
multiple problems for both Panfrost and Asahi this week. Given the only
other user of the pass for varyings is radeonsi, which needs both
together, I think this is the least controversial fix.

Fixes: fb29cef8dd ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11732>
2021-08-10 20:55:33 +00:00
Danylo Piliaiev 4f9ac2f737 tu: add "flushall" and "syncdraw" debug options
They will be useful to check whether some issue is due to the lack
of flushing or waiting.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12283>
2021-08-10 20:08:58 +00:00
Mike Blumenkrantz 03ddffd19f nine: init more draw info members
Reviewed-by: <Axel Davy davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12284>
2021-08-10 19:43:50 +00:00
Mike Blumenkrantz c361658670 nine: init take_index_buffer_ownership for draws
Reviewed-by: <Axel Davy davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12284>
2021-08-10 19:43:50 +00:00
Jesse Natalie 0dd0a92b24 u_driconf: Use a macro to avoid repeating option names
Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
2021-08-10 15:14:26 +00:00
Jesse Natalie b3f9b347f9 wgl: Add a driver name for driconf
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
2021-08-10 15:14:26 +00:00
Jesse Natalie 35ec7e8b8e wgl: Parse driconf options
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
2021-08-10 15:14:26 +00:00
Jesse Natalie 68ff6f8be5 xmlconfig: Use static inline for regex fallback to prevent -O0 issues
A non-static inline function body is only actually emitted by GCC during optimization passes,
so running -O0 ends up never emitting the body, producing linker errors.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
2021-08-10 15:14:26 +00:00
Jesse Natalie 7939094d65 gallium/dri: Move driConf -> st option processing to aux/util
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
2021-08-10 15:14:26 +00:00