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
Emma Anholt
d275184ed2
freedreno/a6xx: disable vertex fetch support flag for b8g8r8a8_srgb.
...
We don't have an srgb decode flag on vertex fetch, r8g8b8a8_srgb isn't
supported either, and GL doesn't ask for vertex fetch for this anyway.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046 >
2021-10-05 20:09:17 +00:00
Emma Anholt
1573af4138
freedreno/a6xx: Add int/scaled/snorm vertex formats to match turnip.
...
Noticed because the vertex formats didn't match up between the two. GL
doesn't actually look for these vertex formats, though.
Having these marked as supporting texture or color could theoretically
change things I think.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046 >
2021-10-05 20:09:17 +00:00
Emma Anholt
bdddcc4d3f
freedreno/a6xx: Move the format table to common code.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046 >
2021-10-05 20:09:17 +00:00
Filip Gawin
a3f553beab
r300: fix UB caused by 1 << 31 and 2 << 30
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13158 >
2021-10-05 19:07:27 +00:00
Chia-I Wu
eed0fc4caf
vulkan/wsi/wayland: fix an invalid u_vector_init call
...
u_vector_init requires size to be power-of-two.
Fixes: 151b65b211 ("vulkan/wsi/wayland: generalize modifier handling")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com >
Reviewed-by: Adam Jackson <ajax@redhat.com >
Reviewed-by: Simon Ser <contact@emersion.fr >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13186 >
2021-10-05 17:42:41 +00:00
Danylo Piliaiev
d2543658ef
turnip: clamp per-tile scissors to max viewport size in binning pass
...
Tiles on the edge may cross maximum viewport size, we have to clamp
per-tile scissor to maximum allowed viewport dimensions.
Add MAX_VIEWPORT_SIZE constant along the way.
Fixes vkd3d test "test_draw_uav_only"
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13197 >
2021-10-05 14:27:44 +00:00
Jason Ekstrand
492e182a8a
radv: Use VK_DEFINE_*HANDLE_CASTS instead of rolling our own
...
The core ones have some nifty stuff like asserts that it's a valid
vk_object_base and has the right type. We don't have real type safety
with Vulkan handles but this is as close as we can get. The core ones
also track when we've started handing out handles for logging purposes
which we want.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13100 >
2021-10-05 09:02:03 -05:00
Tapani Pälli
811bf72f9f
intel/blorp: fix a compile warning about uninitialized use
...
warning: ‘bind_offset’ may be used uninitialized in this function
Signed-off-by: Tapani Pälli <tapani.palli@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13190 >
2021-10-05 11:59:27 +00:00
Lionel Landwerlin
d0a3a11258
nir/lower_io: preserve all metadata when no progress
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13168 >
2021-10-05 11:23:23 +00:00
Samuel Pitoiset
fb2d031047
radv/llvm: fix exporting VS parameters
...
My mistake.
Fixes: 2aa705ec87 ("radv: determine the VS output parameters in the shader info pass")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13191 >
2021-10-05 12:37:57 +02:00
Lionel Landwerlin
5d7ab9ea6a
anv: remove redundant VertexURBEntryReadLength setting
...
We're setting the same field a dozen lines below to the exact same
value.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13169 >
2021-10-05 10:30:51 +00:00
Marcin Ślusarz
e26328582a
nir: preserve all metadata when nir_opt_vectorize doesn't make progress
...
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
54df09c8d4
nir: preserve all metadata when nir_propagate_invariant doesn't make progress
...
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
804c56f1a2
nir: preserve all metadata when nir_lower_int_to_float doesn't make progress
...
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
87ecdd4eff
glsl: preserve all metadata when lower_buffer_interface_derefs doesn't make progress
...
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
338955b53c
anv: preserve all metadata when anv_nir_lower_multiview doesn't make progress
...
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
6e0c38567f
anv: use nir_shader_instructions_pass in anv_nir_lower_ycbcr_textures
...
No functional changes.
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
8c592e386a
anv: use nir_shader_instructions_pass in anv_nir_add_base_work_group_id
...
No functional changes.
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
1faebd0936
intel/compiler: use nir_metadata_none instead of its value
...
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
71bec85db0
intel/compiler: use nir_shader_instructions_pass in brw_nir_opt_peephole_ffma
...
No functional changes.
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
9e6acd801d
intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_storage_image
...
No functional changes.
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
10a33b046e
intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_scoped_barriers
...
No functional changes.
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
3d0332eb12
intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_mem_access_bit_sizes
...
No functional changes.
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
183987d438
intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_conversions
...
No functional changes.
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
5b8c993d50
intel/compiler: use nir_shader_instructions_pass in brw_nir_clamp_image_1d_2d_array_sizes
...
No functional changes.
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Marcin Ślusarz
9e22e0838a
intel/compiler: use nir_shader_instructions_pass in brw_nir_demote_sample_qualifiers
...
Changes:
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
make progress
- pass returns true ONLY when it makes progress ("progress" was initialized incorrectly)
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189 >
2021-10-05 10:02:54 +00:00
Samuel Pitoiset
ae4be2d7ae
radv: fix vk_object_base_init/finish for internal device memory objects
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13172 >
2021-10-05 07:45:48 +00:00
Samuel Pitoiset
87505442de
radv: fix writing combined image/sampler descriptor
...
This will crash with the common Vulkan handles if sampler is NULL.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13172 >
2021-10-05 07:45:48 +00:00
Samuel Pitoiset
b0bd0aac6e
radv: fix vk_object_base_init/finish for push descriptors
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13172 >
2021-10-05 07:45:48 +00:00
Lionel Landwerlin
4e4560ab6f
intel/compiler: add missing line returns to logs
...
In the upcoming intel_clc tool, we're allowing to print these messages
out and some of them just don't look right.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13165 >
2021-10-05 07:31:52 +00:00