Commit Graph

145855 Commits

Author SHA1 Message Date
Jason Ekstrand 231653ea35 intel/isl: Add a max_buffer_size limit to isl_device
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Lionel Landwerlin 9edbd13f81 anv: implement vkGetDeviceImageSparseMemoryRequirementsKHR
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Lionel Landwerlin 4075dd16ab anv: implement vkGetDeviceImageMemoryRequirementsKHR
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Lionel Landwerlin 9058fd8979 anv: move VkImage object allocation to anv_CreateImage
v2 (Jason Ekstrand):
 - Switch the order of arguments to be device, image, other stuff

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Jason Ekstrand 8c2a1ed3da anv: Add an anv_image_get_memory_requirements helper
This is similar to a patch from Lionel except works in terms of aspects
rather than bindings.  This makes it easy to use from the Android code.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Lionel Landwerlin 76b1d04e72 anv: remove unused function
Fixes: 49908c602f ("anv/android: Rework our handling of AHardwareBuffer imports")
Signed-off-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/13199>
2021-10-06 02:18:39 +00:00
Lionel Landwerlin f2397badc4 anv: implement vkGetDeviceBufferMemoryRequirementsKHR
Signed-off-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/13199>
2021-10-06 02:18:39 +00:00
Lionel Landwerlin 8072cc8f20 anv: move GetBufferMemoryRequirement with other buffer functions
Signed-off-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/13199>
2021-10-06 02:18:39 +00:00
Jason Ekstrand 7677f1d09e vulkan: Update the XML and headers to 1.2.195
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Ian Romanick cb28361642 nir/algebraic: Small optimizations for SpvOpFOrdNotEqual and SpvOpFUnordEqual
No shader-db changes on any Intel platform.

Fossil-db results:

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 144380118 -> 143692823 (-0.5%)
SENDs in all programs: 6920822 -> 6920822 (+0.0%)
Loops in all programs: 38299 -> 38299 (+0.0%)
Cycles in all programs: 8434782176 -> 8423078994 (-0.1%)
Spills in all programs: 206830 -> 204469 (-1.1%)
Fills in all programs: 318737 -> 313660 (-1.6%)

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>
2021-10-06 01:53:47 +00:00
Ian Romanick 0cf25f559f spirv: Generate shorter code for SpvOpFUnord comparisons
No shader-db or fossil-db changes on any Intel platform.

v2: Keep the flt <-> fge switcharoo local to the SpvOpFUnordLessThan,
etc. handling.  Add a comment explaining why the suboptimal
SpvOpFUnordEqual implementation is used here.  Suggested by Caio.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>
2021-10-06 01:53:47 +00:00
Ian Romanick 1ce48ce91d spirv: SpvOpFUnordNotEqual doesn't need special treatment
The NIR fneu opcode already matches the "unordered not equal" semantics
of the SPIR-V opcode.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>
2021-10-06 01:53:47 +00:00
Ian Romanick f8148b861f spirv: Minor cleanup in SpvOpFOrdNotEqual
v2: Add a comment explaining why the suboptimal SpvOpFOrdNotEqual
implementation is still used here.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>
2021-10-06 01:53:47 +00:00
Ian Romanick 803b754b81 spirv: Silence unused parameter warnings in vtn_alu.c
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>
2021-10-06 01:53:47 +00:00
Mike Blumenkrantz c074b2d812 ci: updates
fails are from #4571

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12831>
2021-10-06 01:12:29 +00:00
Mike Blumenkrantz a2fb67209e zink: support 16bit rgbx formats
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12831>
2021-10-06 01:12:29 +00:00
Alyssa Rosenzweig c00e7b729f pan/bi: Optimize abs(derivative)
We implement fine derivatives as:

	broadcast(x, (lane & ~1) + 1) - broadcast(x, lane & ~1)

Most of the complexity is to get the right sign. If we can ignore the
sign, we can generate the simpler code:

	broadcast(x, lane ^ 1) - lane

This is a particular win on v7+ where the broadcast instruction (CLPER)
can do `lane ^ value` for free. However, even on v6 where we lower to an
explicit XOR instruction, it's still a win.

The limiting case is fwidth. The fragment shader

   gl_FragColor = fwidth(vec4_varying);

has the following results on v6, v7, and v9:

G72 (-26% instructions, -43% cycles):
38 inst, 30 tuples, 5 clauses, 1.166667 cycles, 1.166667 arith, 28 quadwords
28 inst, 19 tuples, 4 clauses, 0.666667 cycles, 0.666667 arith, 19 quadwords

G76 (-37% instructions, -54% cycles):
38 inst, 30 tuples, 5 clauses, 1.166667 cycles, 1.166667 arith, 28 quadwords
24 inst, 16 tuples, 4 clauses, 0.541667 cycles, 0.541667 arith, 18 quadwords

G78 (-40% instructions, -56% cycles):
40 inst, 1.125000 cycles, 0.250000 fma, 0.109375 cvt, 1.125000 sfu, 20 quadwords
24 inst, 0.500000 cycles, 0.250000 fma, 0.015625 cvt, 0.500000 sfu, 12 quadwords

shader-db tells a similar story -- most shaders are unaffected, but a
shader that uses fwidth has a 20% reduction in cycle count:

instructions helped:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 264 -> 262 (-0.76%)
instructions helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 36 -> 28 (-22.22%)
tuples helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 27 -> 22 (-18.52%)
tuples HURT:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 211 -> 212 (0.47%)
clauses HURT:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 32 -> 33 (3.12%)
cycles helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 1 -> 0.79 (-20.83%)
arith helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 1 -> 0.79 (-20.83%)
quadwords helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 31 -> 28 (-9.68%)
quadwords HURT:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 176 -> 178 (1.14%)

total instructions in shared programs: 148370 -> 148360 (<.01%)
instructions in affected programs: 300 -> 290 (-3.33%)
helped: 2
HURT: 0

total tuples in shared programs: 124188 -> 124184 (<.01%)
tuples in affected programs: 238 -> 234 (-1.68%)
helped: 1
HURT: 1
helped stats (abs) min: 5.0 max: 5.0 x̄: 5.00 x̃: 5
helped stats (rel) min: 18.52% max: 18.52% x̄: 18.52% x̃: 18.52%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.47% max: 0.47% x̄: 0.47% x̃: 0.47%

total clauses in shared programs: 25692 -> 25693 (<.01%)
clauses in affected programs: 32 -> 33 (3.12%)
helped: 0
HURT: 1

total cycles in shared programs: 12132.04 -> 12131.83 (<.01%)
cycles in affected programs: 1 -> 0.79 (-20.83%)
helped: 1
HURT: 0

total arith in shared programs: 4623.75 -> 4623.54 (<.01%)
arith in affected programs: 1 -> 0.79 (-20.83%)
helped: 1
HURT: 0

total quadwords in shared programs: 110386 -> 110385 (<.01%)
quadwords in affected programs: 207 -> 206 (-0.48%)
helped: 1
HURT: 1
helped stats (abs) min: 3.0 max: 3.0 x̄: 3.00 x̃: 3
helped stats (rel) min: 9.68% max: 9.68% x̄: 9.68% x̃: 9.68%
HURT stats (abs)   min: 2.0 max: 2.0 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 1.14% max: 1.14% x̄: 1.14% x̃: 1.14%

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12332>
2021-10-06 00:40:57 +00:00
Alyssa Rosenzweig 3e8f540753 nir: Add Mali-specific derivative opcodes
Add derivative opcodes fddx_must_abs_mali/fddy_must_abs_mali satisfying:

   fabs(fdd*_must_abs_mali(v)) = fabs(fdd*(v))

The sign of their result is undefined.

On Bifrost and Valhall, these unsigned derivatives can be implemented
more efficiently than the correctly-signed counterparts, since the sign
fixup requires extra ALU instructions. On backends where this is the
case, it is useful to optimize fabs(fdd*(v)) to
fabs(fdd*_must_abs_mali(v)). This pattern comes up with the GLSL builtin
`fwidth`.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12332>
2021-10-06 00:40:57 +00:00
Joshua Ashton 72c0e57e7e ac/surface: Use 64 && 128 for GFX10_3 on non-modifier path
DCC_IND_BLK is not hooked up for this to work in the kernel in any released version, and it's unsafe to do so even if it was because it doesn't check the modifiers.

There's no reason to change the legacy non-modifier path to be more performant at the expense of breaking backwards compatibility with older versions of Mesa.

Fixes: 0f6251b3 ("ac/surface: use DCC compatible with image stores for < 4K resolutions")
Closes: #5422

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13122>
2021-10-06 00:13:46 +00:00
Marek Olšák 82b420df32 mesa: use simple_mtx_t for ShaderIncludeMutex
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák f6abb3445b mesa: use simple_mtx_t for TexMutex
change mtx_recursive -> mtx_plain, there's no recursive locking

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák 826e03e6e5 gallium/pb_slab: use simple_mtx_t
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák 5a5637d6ae gallium/pb_cache: use simple_mtx_t
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák b4afe25ebf util/queue: use simple_mtx_t for finish_lock
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák 28bde89556 util/slab: use simple_mtx_t
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák 8f68978caa mesa: add missing unlock_texture into generate_texture_mipmap
Fixes: 5a39938b00 "mesa: Throw an error for compressed glGenerateMipmap on GLES2 contexts."

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Enrico Galli c79ec5ea3c nir_to_dxil: Add tagging raw SRVs in shader flags
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13157>
2021-10-05 23:32:18 +00:00
Dave Airlie 1d48022dab gallivm/format: clamp SINT conversion rather than truncate.
KHR-GL32.packed_pixels.pbo_rectangle.r16i on zink on lavapipe
ends up using a pbo that does an SINT image write. This was producing
truncated rather than clamped values.

Fix the calculations for 8/16-bit signed ints to clamp not truncate.

Fixes: 13e5f331db ("gallivm/nir: fix image store conversions")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13187>
2021-10-05 23:11:57 +00:00
Emma Anholt 60f464bbce i915g: Check for the scanout-layout conditions before setting level info.
Fixes leaks (release) or assertion failures (debug) on allocating small
scanout resources, when falling through to the non-scanout-specific layout
code, which became more common as of ad50b47a14 ("gbm: assume
USE_SCANOUT in create_with_modifiers").

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13202>
2021-10-05 22:36:36 +00:00
Alyssa Rosenzweig f0325ca3da panfrost: Fix PAN_MESA_DEBUG=sync with INTEL_blackhole_render
We need to ignore the "sync" in this case, or we'll crash with
"incomplete job" since we never submitted the work. Fixes the Piglit
intel_blackhole-draw_gles2 when run in CI.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>
2021-10-05 21:13:52 +00:00
Alyssa Rosenzweig 12facf23b1 panfrost: Don't set CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER
We already set HALF_INTEGER, which is what the compiler actually does.
If we also set PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER, we get
incorrect lowering. Only set the CAP we respect.

On Bifrost, this convention is arbitrary. We should consider moving the
Bifrost lowering into NIR to optimize this better...

Fixes Piglit glsl-arb-fragment-coord-conventions.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>
2021-10-05 21:13:52 +00:00
Alyssa Rosenzweig b88225378d panfrost: Introduce PAN_MAX_VARYINGS define
The number of varying records we need to reserve in the worst case is
greater than the number of source-level varyings we advertise
(gl_Position, gl_PointSize...)

We advertise MAX_VARYINGS source level varyings, which means anywhere we
manipulate varyings we need up to (MAX_VARYINGS + max non-source level
varyings) records. Add a PAN_MAX_VARYINGS define for this and use it
throughout.

Fixes a buffer overflow in Piglit glsl-max-varyings, which now passes
instead of crashes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>
2021-10-05 21:13:52 +00:00
Alyssa Rosenzweig 9c8311b737 panfrost: Fix off-by-one in varying count assert
We want to assert that the number of varyings (the count) is at most the
the maximum count. This is <=, not <, with the assertion previously
failing for exactly the maximum.

Fixes: 2c2cf0ecfe ("panfrost: Streamline varying linking code")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>
2021-10-05 21:13:52 +00:00
Alyssa Rosenzweig 00b0529061 panfrost: Move special_varying to compiler definitions
The number of special varyings on midgard can influence how much space
we need to allocate for varyings in the compiler ABI. Move the enum so
we can get access it.

No functional change. This is cc stable purely so the following patches
can be backported.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>
2021-10-05 21:13:52 +00:00
Pavel Asyutchenko 7ffb152276 llvmpipe: fix crash when doing FB fetch + gl_FragDepth write in one shader
Reproducible by piglit test from this MR:
https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/576

Signed-off-by: Pavel Asyutchenko <sventeam@yandex.ru>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12705>
2021-10-05 20:45:38 +00:00
Emma Anholt 48499a8d44 turnip: Replace our format table with fd6_format_table.
Now we have a common format table with just a little bit of overriding in
turnip, which I hope we can decrease over time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:18 +00:00
Emma Anholt 3bc681d87f turnip: Do format lookups from the fd6 format table and cross-check.
Intermediate step to make sure things stay the same as I transition us to
sharing the format table.

The YUV special casing is pretty not the prettiest, but I'm hoping to
continue working on planar RGB formats as pipe formats separately.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:18 +00:00
Emma Anholt 3d53b43dab turnip: Switch tu_format internals to using pipe_format more.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:18 +00:00
Emma Anholt bfe36ad3f1 turnip: Give D32_SFLOAT_S8_UINT a native format.
We won't actually use the native format here, as when sampling our image
we we just see the format for either the D or S aspect.  This syncs us up
with freedreno's table, though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:18 +00:00
Emma Anholt 70ecd3a119 freedreno/a6xx: Enable UBWC for RGBA5551 (and 1555) textures.
Turnip has it enabled, and it seems to be happy in the CTS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 38f23b1108 freedreno/a6xx: Add support for A/XRGB1555 formats.
This switches the format we use by default for GLES's rgb5_a1, and means
that our formats supported more closely matches turnip.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt ebaeddcbb3 freedreno/a6xx: Rewrite the format table format/swap helpers.
We need to take a tiling mode to in order to support 1555 like turnip
does, and I like this naming better.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 1ce837d6f4 freedreno/a6xx: Make the format table const.
This data never changes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 4d6f5cd572 freedreno/a6xx: Use fd6_pipe2tex() for the 2D src format.
The differences between the two are:

- tex supports more formats (fine, we've already decided on which formats
  we can blit)
- FMT6_10_10_10_2_UNORM instead of FMT6_10_10_10_2_UNORM_DEST.
- FMT6_A8_UNORM for PIPE_FORMAT_A8_UNORM.

For 1555 support we get another difference between tex and color, and we
need 2/3 of the tex differences for blit srcs, so switch it over.  This
also matches what turnip does (except it doesn't have A8 as a format).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 7952a17f7f freedreno/a6xx: Put R8_G8_B8_420_UNORM in the format table.
turnip will use this format, even if we don't have the freedreno side
rigged up yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt e47b4ba629 util/format: Add an RGB planar format for YV12, like we have for NV12.
Turnip will use this for mapping the to the corresponding hardware format,
and we could also extend mesa/st to avoid adding extra samplers for
external image sampling of YV12 on freedreno.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt ab0462e05d freedreno/a6xx+: Add support for the R8G8_R8B8 and G8R8_B8R8 formats.
This means that EGLimage imports of YUYV and UYVY can use a single sampler
instead of having to create RGBA8 and RG8 samplers mapping the same
texture.  The swizzles are the same as turnip uses, and it makes the
piglit tests for these formats happy.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt a7459b5409 freedreno/a6xx: Add some more 16-bit rgb/rgba swaps to our format tables.
BGR565 is chosen for GL_RGB565 and BGRA4 for GL_RGBA4, so it doesn't
change GLES's behavior.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 4b36e7b1b5 freedreno/a6xx: Drop texturing support from other scaled formats.
GLES doesn't expose these texture formats, and we don't want to start
exposing them when turnip starts using our tables.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 20d02f347d freedreno/a6xx: Add support for EXT_texture_sRGB_R8/RG8.
Noticed to be missing when comparing format tables between turnip and
freedreno.  Passes dEQP-GLES31 fine.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00