Commit Graph

55297 Commits

Author SHA1 Message Date
Sil Vilerino 345fd92092 va: Add support for VPP rotation, flip, alpha blend, crop, scaling
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17557>
2022-07-21 22:40:30 +00:00
Sil Vilerino d09cf4333c gallium/video: Add video post processing interface
Add process_frame to pipe_video codec
Add new structures/caps for video post-processing with rotation,
flip, alpha blending, crop, and scaling, via the video engine.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17557>
2022-07-21 22:40:30 +00:00
Sil Vilerino 721d9eea81 va: Replace usage of entrypoint UNKNOWN with PROCESSING for VP
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17557>
2022-07-21 22:40:30 +00:00
Sil Vilerino 74c5d01169 vl: Replace usage of entrypoint UNKNOWN with PROCESSING for VP
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17557>
2022-07-21 22:40:30 +00:00
Sil Vilerino f5ab2ffd4e pipe/video: Add PIPE_VIDEO_ENTRYPOINT_PROCESSING
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17557>
2022-07-21 22:40:30 +00:00
Sil Vilerino 6bf8798ecb d3d12: Video - Remove unused spCopyQueues from enc/dec objects
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17557>
2022-07-21 22:40:30 +00:00
Jason Ekstrand 9965863a13 lavapipe: Use more Vulkan NIR heleprs
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17644>
2022-07-21 21:18:48 +00:00
Jordan Justen 85099804bf iris/bufmgr: Add assert and TODO comment for future small BAR uapi
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17349>
2022-07-21 20:27:10 +00:00
Jordan Justen 7cf67e9da3 iris: Set clear_color_unknown if the bo is not mappable
Rework:
 * Ken: Check bo for IRIS_MMAP_NONE rather than the global
   intel_vram_all_mappable

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17349>
2022-07-21 20:27:10 +00:00
Jordan Justen 180aa4f3b2 iris/bufmgr: Set mmap_mode to IRIS_MMAP_NONE for lmem in small-BAR mode
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17349>
2022-07-21 20:27:10 +00:00
Jordan Justen 49b1b8b853 iris/bufmgr: Add all_vram_mappable which is currently always true
This can be false on systems where the PCI Base Address Register (BAR)
is too small for the amount of VRAM. Eventually the kernel will be
able to tell us that a system can't map all of VRAM, and
`all_vram_mappable` will then be false.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17349>
2022-07-21 20:27:10 +00:00
Jordan Justen 618c871a23 iris/resource: Avoid mapping when not needed in iris_resource_init_aux_buf()
We might not be able to map all vram buffers in the future, so only
map the buffer when actually required.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17349>
2022-07-21 20:27:10 +00:00
Jordan Justen b79da470f2 iris/resource: Assert that DG2 CCS buffers don't also try to set BO_ALLOC_SMEM
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17349>
2022-07-21 20:27:10 +00:00
Marek Olšák 2474d92071 ttn: set dest_type for TXQ
It was failing an assertion in tgsi_to_nir and NIR validation.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17691>
2022-07-21 20:05:12 +00:00
Georg Lehmann 87e3277b82 nir: Rewrite and merge 16bit tex folding pass with 16bit image folding pass.
Allow folding constants/undef sources by sharing more code with the image_store
16bit folding pass.

Allow more than one set of sources because RADV wants two, one for
G16 (ddx/ddy) and one for A16 (all other sources).

Allow folding cube sampling destination conversions on radeonsi/radv because
I think the limitation only applies to sources.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16978>
2022-07-21 19:15:03 +00:00
Mike Blumenkrantz 2ea0d735d4 zink: add env var to abort on device-lost if no reset callback is set
the alternative here is to just spin aimlessly until the process ooms,
which causes problems when trying to detect failures in cts caselists

a separate env var is used so that it can be exported without affecting
ZINK_DEBUG

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17525>
2022-07-21 14:02:27 +00:00
Konstantin Seurer fe5c7f1418 gallium/tests: Remove format desc null checks
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-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/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer 55a12036f6 virgl: Remove format desc null checks
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-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/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer 90030469dd softpipe: Remove format desc null check
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-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/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer 435cb21e11 radeonsi: Remove format desc null checks
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer 66344fae4d r600: Remove format desc null checks
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer ad6553eae9 r300: Remove format desc null check
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer b07b359428 panfrost: Remove format desc null check
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-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/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer 0dbec9c059 llvmpipe: Remove format desc null checks
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-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/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer c23c8f18ca etnaviv: Remove format desc null check
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer b52215ae56 agx: Remove format desc null check
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-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/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer 74fe2c805f util: Remove format desc null check
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-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/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer f10b9563dd tgsi: Remove format desc null check
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer 927f863364 gallivm: Remove format desc null checks
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17490>
2022-07-21 12:48:01 +00:00
Emma Anholt 74aea0b840 glsl: Remove optimize_swizzles.
It will get turned into SSA and copy-propagated in NIR, no need to walk
the IR collapsing it here.

iris shader-db results appear to be noise:

total instructions in shared programs: 8932195 -> 8932147 (<.01%)
instructions in affected programs: 537 -> 489 (-8.94%)
LOST:   12
GAINED: 11

lost/gained are simd32 switches in unigine, l4d2, portal2, asphalt9.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17613>
2022-07-20 20:45:09 +00:00
Mike Blumenkrantz 4123ee3c71 zink: invoke descriptor_program_deinit for programs on context destroy
this should make multi-context shutdown more stable

affects:
glx@glx-visuals-depth -pixmap
glx@glx-visuals-stencil

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17658>
2022-07-20 19:58:16 +00:00
Mike Blumenkrantz ea92421298 zink: scale number of shader cache-get threads
this should improve startup times for short tests

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17659>
2022-07-20 18:19:10 +00:00
Mike Blumenkrantz 153983328d zink: handle null samplerview/image rebinds more gracefully
fixes a crash in nine

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17656>
2022-07-20 17:48:03 +00:00
Mike Blumenkrantz 3c66617213 zink: move layout-setting for dynamic render attachments after no-op case
this avoids unnecessarily terminating a renderpass to insert unnecessary barriers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz edab34f68d zink: allow no-op renderpass updates in zink_batch_rp()
in some cases it becomes desirable to "maybe" stop and start the current
renderpass, such as when updates MAY result in layout changes for attachments

for such cases, avoid splitting the renderpass unless it actually needs to
be split

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 4aec761596 zink: improve granularity of renderpass switching
this should ensure that (future) renderpass recalcs will never split
a renderpass unnecessarily

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz f78919d36d zink: add a bits union for zink_render_pass_state comparisons
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 13951385b3 zink: reuse rt layout functions to refactor zink_render_pass_attachment_get_barrier_info()
maybe slightly easier to read?

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz c602e877a3 zink: break out color rt layout calc
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 903060787e zink: break out zs renderpass layout calc
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 1ff18f0879 zink: break out renderpass attachment load op calc
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 1bc9db6879 zink: split out rp_changed to be more granular for dynamic render
sometimes a state change MAY require a renderpass change, but this change
will not require splitting the current renderpass

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 9b087dcccd zink: add an assert to verify that deferred clears aren't added in renderpass
this would be very, very broken

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz d9a320b62c zink: remove redundant renderpass update check for clears
this should be handled already in the clear code

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 06b04a5c71 zink: unflag ctx->rp_changed after dynamic render update
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz b31a8dfc85 zink: do dynamic render implicit clear updates on rp_changed
this should be flagged correctly now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 5ae1c76baa zink: flag renderpass change if renderpass clears change
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:18 +00:00
Mike Blumenkrantz ca3d696f80 zink: don't flag renderpass change on depth write change as often
this is only "sometimes" required and only if dynamic render isn't being
used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:18 +00:00
Mike Blumenkrantz d079e3c9b6 zink: don't try to start a renderpass before CmdClearAttachments
it should be impossible to reach this point if a renderpass is not active

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:18 +00:00
Mike Blumenkrantz 644f059a8d llvmpipe: ignore multisample state for alpha_to_one
this is more accurate and fixes usage with lavapipe

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17627>
2022-07-20 15:41:14 +00:00
Mike Blumenkrantz a884d1eb0e vulkan/wsi: fix multiple acquires for sw without mit-shm
in this case, lying about having multiple images and then returning the
same image every time doesn't work, so use the busy flag
and return an available image when possible

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17590>
2022-07-20 15:10:15 +00:00
Mike Blumenkrantz 687a5d8690 zink: use gfx_barrier for synchronization when binding buffer descriptors
this will preserve existing shader stages in the access mask and avoid desync
later on

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
2022-07-20 09:21:30 -04:00
Mike Blumenkrantz 268011e8c6 zink: fix viewport count tracking
the number of viewports in use is based on the outputs of the last vertex
stage, not the viewports passed by the state tracker

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
2022-07-20 09:21:30 -04:00
Mike Blumenkrantz eaf11d3cd9 zink: call bind_last_vertex_stage() when binding vs
ensure all the necessary updates are flagged

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
2022-07-20 09:21:30 -04:00
Mike Blumenkrantz 011c02ce3c zink: improve oom error message
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
2022-07-20 09:21:30 -04:00
Mike Blumenkrantz 2aab0a9c16 zink: fix crashing on bo allocation failure
list init occurs after mem allocation, so check this first

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
2022-07-20 09:21:30 -04:00
Mike Blumenkrantz 19eddeb226 zink: handle null samplerview in get_imageview_for_binding()
this is legal

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
2022-07-20 09:21:30 -04:00
Mike Blumenkrantz 5b58f8df53 zink: handle max_vertices=0 in geometry shader
this is a weird corner case where glsl permits a zero value, so clamp to 1
and then don't emit any vertices to avoid driver hangs

affects:
dEQP-GL45-ES31.functional.geometry_shading.emit.points_emit_0_end_0

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
2022-07-20 09:21:30 -04:00
Alejandro Piñeiro efc827ceea v3d/v3dv: use NIR_PASS(_
Instead of NIR_PASS_V, when possible.

This was done recently on anv (see commit ce60195ec and MR#17014)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17609>
2022-07-20 11:35:25 +00:00
Mike Blumenkrantz 2e7ecc02bc zink: default to lazy/templated descriptors
cached mode was great 2 years ago when template support was less widespread,
but now that templates are everywhere, caching is less performant in
every scenario

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17636>
2022-07-20 04:24:19 +00:00
Mike Blumenkrantz 6493f6ef79 zink: add an explicit ZINK_DESCRIPTOR_MODE_CACHED
no functional changes, but now AUTO is no longer a mode that gets used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17636>
2022-07-20 04:24:19 +00:00
Mike Blumenkrantz 9172127057 zink: delete ZINK_DESCRIPTOR_MODE_NOFALLBACK
this was useful for testing but is going to be less useful soon

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17636>
2022-07-20 04:24:19 +00:00
Mike Blumenkrantz 1c2bd27d81 zink: move descriptor_mode to be a global
this can't change once it's been set, so having it per-object is pointless

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17636>
2022-07-20 04:24:19 +00:00
Dave Airlie bfebf51571 lavapipe: state latest conformance tests passed
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Cc: mesa-stable "22.1"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17643>
2022-07-20 03:36:13 +00:00
Dave Airlie e14022c052 crocus: fail query begin if upload allocation fails.
This is the only place I think I can see this crashing.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17615>
2022-07-20 01:46:32 +00:00
SoroushIMG 2159a377c0 Zink: Fix clear being missed when using emulated draws in zink_blit
zink_kopper_acquire_readback will flush any outstanding clears, this means that
the current clears need to be applied first before calling zink_kopper_acquire_readback.
This was already done for native_blit and native_resolve, also do this for the emulated draw path.
Seen as intermittent failures in cts case GTF-GL33.gtf21.GL2FixedTests.buffer_clear.buffer_clear.

Cc: mesa-stable
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17631>
2022-07-20 00:39:33 +00:00
SoroushIMG 3dfd8e4d7d zink: Fix spirv stream 0 vertex emit for multistream shaders
Spirv spec does not allow the use of OpEmitVertex or OpEndPrimitive when there are multiple streams.
Instead emit the multi-stream version of these with stream set to 0.
This issue was seen when testing cts case KHR-GL46.transform_feedback.draw_xfb_stream_test

Fixes: 35e346f428 ("zink: handle vertex streams")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17513>
2022-07-20 00:19:38 +00:00
Pavel Ondračka ae003ef78c r300: disable PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF
We can't do uniform buffer objects and from the hardware
perspective constants (uniforms) and immediates are treated in
the same way. They are uploaded together and fit together into the
(rather low) total constant limit. Therefore, there is actually no
advantage in converting immediates to uniforms, and a whole lot of
disadvantages (less possible optimizations and no inlining).

Fixes the dEQP regressions from https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770

The tests failed because when there is an indirect array access the
compiler inserts a big if ladder and converting the temp to a uniform
means more instructions because the ifs cant be lowered at least
partially to selects. It is particularly visible, because the code
NIR currently emits for the indirect access doesn't really fit the
hardware, see: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6366

No change in my shader-db, so this concerns the tests only.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17576>
2022-07-19 20:31:37 +00:00
Jason Ekstrand b510ee0d22 Use vk_foreach_struct_const where needed
We're about to make it so that the compiler warns/errors if you use the
wrong iterator macro.  Fix up a bunch of places where someone used the
wrong one before we break anything.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17630>
2022-07-19 19:55:17 +00:00
Konstantin Seurer eb19640d61 radeonsi: Set vertex_id_zero_based
Let NIR lower load_vertex_id instead of LLVM.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17539>
2022-07-19 13:26:09 +00:00
Lionel Landwerlin 2d1f021e16 intel/fs: Set NonPerspectiveBarycentricEnable when the interpolator needs it.
[anholt: changed to make all drivers do the right thing by moving the
payload barycentric check into the compiler]

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17381>
2022-07-19 01:25:47 +00:00
Mike Blumenkrantz 071d335ca2 zink: tu a630 baseline update
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17606>
2022-07-18 20:15:05 +00:00
Mike Blumenkrantz b6df410d26 zink: nv baseline update
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17606>
2022-07-18 20:15:05 +00:00
Adam Jackson c123ab2137 kopper: Implement {EGL,GLX}_EXT_buffer_age
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17527>
2022-07-18 19:31:29 +00:00
Mike Blumenkrantz 81d83e81db zink: break out tc/trace context unwrapping
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17527>
2022-07-18 19:31:28 +00:00
Dave Airlie 50e3303b3d kms/dri: add mutex lock around map/unmap
this can get called from multiple threads with the recent llvmpipe
overlapping rendering changes, so make sure to lock around the
map/unmapping so they can't race.

This should fixes some crashes seen with kwin.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tested-by: Adam Williamson (Fedora)
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17531>
2022-07-18 19:06:30 +00:00
Ruijing Dong a585d95803 frontends/va: WA for ffmpeg 10bit encoding crash
When doing 10bit encoding in ffmpeg it uses
VaDeriveImage, and that could result in missing
mapping the chroma buffer of the input frame.

This WA to disallow ffmpeg using VaDeriveImage
function, so that VaCreateImage and VaPutImage can
be used and WA the chroma buffer mapping issue.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17472>
2022-07-18 17:23:22 +00:00
Ruijing Dong cd653e5cc7 frontends/va: do texture_map when needed
When map buffer, and its target is texture,
texture_map/unmap need to be used.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17472>
2022-07-18 17:23:22 +00:00
Mike Blumenkrantz 7ea7d0687b zink: inject a 0,0,0,1 clear for RGBX formats
this ensures the alpha component is full if it must be read for fbfetch

fixes (RGBX swapchain config):
KHR-GL46.blend_equation_advanced*

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz ac38139c34 zink: simplify zink_framebuffer_clear_data union
no functional changes

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz 7754041ed6 zink: delete srgb tracking for clears
no longer used

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz b0e62adbcc zink: delete zink_fb_clear_util_unpack_clear_color
no longer used

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz d8fa4e6797 zink: remove out-of-renderpass clears
these are only ever going to hurt tiler perf, so remove the footgun

this also means there's no more srgb format conversion needed, so delete
all of that too

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz 66ceea7ed9 zink: lift clearing on fb state change up a level
in the scenario where:
* at least 1 color buffer was bound and a depth buffer was bound
* no color clear was enabled
* a zs clear was enabled
* the zs clear was never flushed
* the zs clear needs a renderpass
* the fb state changes

the color buffer(s) would be unbound, following which the depth buffer unbind
would trigger a renderpass, which would utilize the just-unbound color buffers,
which have no batch tracking, thus creating a case where the surface was destroyed
while it was still in use

cc: mesa-stable

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz e81d6cec27 zink: clamp color clear values based on format
formats like GL_RGB10_A2UI can be cleared with out of range values,
so to ensure consistent driver behavior, pre-clamp to the valid range

affects:
KHR-GL46.direct_state_access.renderbuffers_storage_multisample

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz 95f1c84739 zink: add explicit (awful) handling for fb layer mismatch clears
this is terrible and (hopefully?) rare, so just force it out early to
avoid any kind of issue

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz 631db579af zink: track a bitmask of fb attachments with mismatched layer counts
these need special handling for clears

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz 9d68684240 zink: always use storeOp=STORE for depth renderpass
it's unknown whether there may be clears to the depth attachment at the start of
a renderpass, so always assume there will be

Fixes: c132a28745 ("zink: use store op NONE when necessary for depth usage")

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz 442281447a zink: remove u_blitter usage from zink_clear_render_target
this is more operations than needed

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz d53395ad06 zink: remove non-renderpass clear path from zink_clear_texture
this should always be faster

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:37 +00:00
Mike Blumenkrantz f1f08e3529 zink: massively simplify zink_clear_depth_stencil
this now just uses renderpass clears

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:37 +00:00
Mike Blumenkrantz 3488dc7dd0 zink: improve zink_clear_depth_stencil check for current attachment
this is technically more correct since it accounts for multi-context usage

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:37 +00:00
Mike Blumenkrantz c1cc2bd48e zink: stop using u_blitter for texture clears
this was really stupid: instead of just binding a new fb and firing off
a clear, the code was calling u_blitter to bind a new fb and do actual
draws

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:37 +00:00
Mike Blumenkrantz 04a5471b5e zink: fix coverage check for texture clears
this wasn't actively harmful, but it was potentially differently-performant

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:37 +00:00
Mike Blumenkrantz b33f041810 zink: remove format check from clear texture
this is going to be a render target no matter what

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:37 +00:00
Mike Blumenkrantz 8bb5a11503 zink: fix transient attachment rp assert
cc: mesa-stable

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:37 +00:00
Mike Blumenkrantz d1db078619 zink: remove bogus range tracking from texture clear
too much copy/paste

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:37 +00:00
Dave Airlie af2e4a23c9 lavapipe: enable variablePointers
This passes the CTS with no regressions.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17587>
2022-07-17 23:16:40 +00:00
Dave Airlie dbd9caae5e lavapipe: drop unreachable pNext checks.
These are reachable, and
dEQP-VK.api.smoke.triangle_ext_structs,Crash is why.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17586>
2022-07-17 23:02:19 +00:00
Mihai Preda bc78b861ca gallium: LLVM-15 contexts use non-opaque pointers
LLVM-15 enables opaque pointers by default. We temporarilly request
non-opaque pointers while we migrate our code to support non-opaque pointers.

This workaround needs to be removed before LLVM-16.

See #6615

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17514>
2022-07-17 21:44:37 +00:00
Rob Clark 81d85be9a5 freedreno/gmem: Reverse order of alternative tile rows
Similar motivation as c426e21ff1 ("turnip: Reverse the order of walking
pipes or tiles on odd rows."), but instead we just swap the order of
alternate rows of fd_tile the the gmem stateobj.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17303>
2022-07-16 15:37:34 +00:00
Daniel Stone cdb7a3b0e2 Revert "CI: Disable Collabora lab"
This reverts commit 7a336c97ef692ed96cc93394596a7d0650983874.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17563>
2022-07-16 11:44:26 +00:00
Arvind Yadav 1fbc7337a1 radeonsi: Enable nir_lower_point_smooth lowering pass for point smoothing
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15117>
2022-07-16 07:08:33 -04:00
Arvind Yadav 25204d89a6 radeonsi: Add nir_lower_poly_line_smooth pass for polygon and line smoothing
Added a new NIR pass for handling polygon and line smoothing and
Removed previous smoothing changes.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16245>
2022-07-16 10:15:22 +00:00
Emma Anholt a43b96ab1a ci/crocus: Drop xfails for the recent image external fix.
Fixes: 8856379a03 ("mesa/st: don't guess the internal format if it's known")
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17572>
2022-07-16 04:31:56 +00:00
Emma Anholt c0930b552d ci/crocus: Disable the blender trace.
It gives inconsistent sha1s.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17572>
2022-07-16 04:31:56 +00:00
Emma Anholt f96688fec2 ci/crocus: Update portal 2 trace shas for the recent fix.
they render correctly now.

Fixes: 4e797ac530 ("st/glsl: fix broken vertex attrib mapping")
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17572>
2022-07-16 04:31:56 +00:00
Mike Blumenkrantz 56e5eaeba1 zink: fix xfb emit check in compiler
nir->info.has_transform_feedback_varyings is set for all stages in the
pipeline when xfb is present, so it can't be used for this

harmless, but this is more correct

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17404>
2022-07-15 17:32:27 +00:00
Mike Blumenkrantz bd2eaaeb7d zink: add a compiler pass to split xfb block outputs
this splits all the members of a struct into separate variables to
improve xfb inlining and reduce the number of locations consumed by
xfb outputs, reducing the chances of running out of shader outputs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17404>
2022-07-15 17:32:27 +00:00
Mike Blumenkrantz 924145c7b5 zink: bitcast extracted streamout components to uint before creating uvec
spirv can't create a uvec from float components, so pre-cast here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17404>
2022-07-15 17:32:27 +00:00
Mike Blumenkrantz c189b7f585 zink: use right glsl length getter for ntv partial stores
why does glsl_get_length exist if it returns 0 for the most common cases?

Fixes: 31ba19ff68 ("zink: fix ntv partial stores")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17404>
2022-07-15 17:32:27 +00:00
Mike Blumenkrantz 5245290565 zink: fix xfb array inlining
get_slot_components() returns the total number of output components
for arrays for initial evaluation phase, but during the packed->inlined
conversion the arrayed size must be normalized to the slot's component count
in order to effectively catch and inline the array

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17404>
2022-07-15 17:32:27 +00:00
Mike Blumenkrantz 042cc6e6e6 zink: split xfb block emission from array/matrix handling
these are not necessarily the same case even if in glsl they are the same,
and by splitting it out a bunch of redundant array[scalar] code can be deleted

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17404>
2022-07-15 17:32:27 +00:00
Mike Blumenkrantz 76cc519866 zink: handle bare matrix types in xfb emission
these have no inherent slot index since they aren't block members

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17404>
2022-07-15 17:32:27 +00:00
Mike Blumenkrantz a0771cd4ab zink: always use 32bit floats for so output types
doubles may be the output variable type, but the xfb output will always
be 32bit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17404>
2022-07-15 17:32:27 +00:00
Jesse Natalie e14beaf05b d3d12: Add helpers to build with correct ABI for MinGW
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17548>
2022-07-15 16:27:11 +00:00
Mike Blumenkrantz b1c1d099a9 zink: always update sampler descriptor layouts on fb surface unbind
this will affect the layout

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17524>
2022-07-15 14:20:24 +00:00
Mike Blumenkrantz f79d71f59e zink: break out samplerview layout reset code
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17524>
2022-07-15 14:20:24 +00:00
Mike Blumenkrantz 960a6316d4 zink: use sampler_bind_count to simplify some code
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17524>
2022-07-15 14:20:24 +00:00
Mike Blumenkrantz 3a47576687 zink: add a compiler pass to match up tex op dest types
this handles bitsize conversions and depth component splatting to
enable simplifying some of the related ntv code

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17427>
2022-07-15 14:08:56 +00:00
Mike Blumenkrantz 49d5fa12f2 zink: always use 32bit sample ops
while some (tg4) sample ops can use different bit sizes in spirv, most
cannot, and all the shader variables are always emitted as 32bit, so
ensure the 32bit type is always what's being used for sampling

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17427>
2022-07-15 14:08:56 +00:00
Mike Blumenkrantz 35a4b8989f zink: allow multiple tex components for depth tg4
this returns a vec4, so don't break the return type by clamping 1 component

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17427>
2022-07-15 14:08:56 +00:00
Daniel Stone 02d9d1557b CI: Disable Collabora lab
It's everyone's favourite day, infrastructure maintenance Friday.

This includes manual disables for a618-vk and zink-anv-tgl, because
apparently the disable-on-variable rules don't carry through to those
jobs for ... some reason.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17553>
2022-07-15 13:26:42 +00:00
Lucas Stach 612b99d721 etnaviv: fix use after free in async shader compile
When the shader state is destroyed before the async shader compile is
done, we get a use after free in the async thread, as the shader state
it is operating on is gone. Fix this by dropping any pending job from
the async queue or wait for it to finish before destroying the state
by calling util_queue_drop_job.

Also call util_queue_fence_destroy, which would have caught this issue
by asserting that the queue_fence is in signalled state when the
shader state is destroyed.

Fixes: 1141ed5859 ("etnaviv: async shader compile")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17534>
2022-07-15 11:07:12 +00:00
Jesse Natalie ddbbe96c88 Fix static glapi on Windows
On Linux, the static glapi path sees libGL.so implementing the static
glapi, and the drivers (libgallium_dri.so) updating/reading the TLS
vars.

On Windows, to allow libgallium_wgl.dll to be a full ICD, it's
responsible for implementing the actual static glapi. However, before
this change, OpenGL32.dll was also implementing the static glapi,
meaning that GL API calls from OpenGL32.dll didn't route to the driver
correctly because the TLS vars were never actually set - the driver set
its copy, and OpenGL32.dll read its own copy.

Now, always build a bridge and static version of glapi when not using
shared. The bridge version is linked into OpenGL32.dll, and the static
version is linked into the driver on Windows. GLES only builds with
shared glapi - but after this, shared glapi is not really needed on
Windows for GLES, since the driver has all of the data.

Fixes: f36921ef ("wgl: Refactor drivers to a libgallium_wgl.dll")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6560
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16713>
2022-07-14 20:01:22 +00:00
Brian Paul 29ec6372cc lavapipe: fix incorrect sv[] array size
The sampler views array needs to be dimensioned by
PIPE_MAX_SHADER_SAMPLER_VIEWS, not PIPE_MAX_SAMPLERS.

This fixes out-of-bounds array writes when using more than 32
textures in a shader.

Also add some assertions to check array indexing elsewhere.
And change loop limits to be based on ARRAY_SIZE().

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul a0ea45fb68 llvmpipe: initialize a local var to fix compiler warning in release build
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul dfb2ea3531 llvmpipe: don't allow texture/resource swizzles on linear path
This fixes another VMware test (dx9-stretch-formats-copy-a8r8g8b8-x8r8g8b8).

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 2b14a7658a lavapipe: fix logicop, independent blend enable/disable
The logicop_enable and independent_blend_enable vars need to always
be assigned, otherwise, once turned on, they could never be disabled.

This fixes a number of failures in VMware's test suite.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 98593360c4 gallivm: increase LP_MAX_TGSI_SHADER_IMAGES from 16 to 32
This allows a VMware test to pass.  The comments in lp_bld_limits.h
mention SM 3.0 requirements, but we're in the SM 5.0 era...

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul c9fd8abe50 llvmpipe: replace LP_RAST_OP_ #defines with enum type
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 90d011de8e llvmpipe: fix texcoord analysis in llvmpipe_nir_fn_is_linear_compat()
For the linear rendering fast path, we need to know whether the
texcoord argument to tex instructions comes directly from an FS input
(swizzling OK, but no arithmetic, etc).  Use the input register info
to fill in the tex_info object.

This is part of a fix for some linear rendering bugs.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul c6f9a91015 llvmpipe: fix invalid memory used in lp_fs_linear_run
We were saving the address of the constants[] and nir_constants[]
arrays in the jit structure.  But those arrays went out of scope
before use.

This patch moves the constants[] array to the function scope and
consolidates the TGSI/NIR paths.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 3743f74d30 llvmpipe: add missing tex_info->texture_unit assignment
The texture_unit field needs to be set like the sampler_unit field.

Also, add a swizzle initialization and some comments.

Signed-off-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 53cd3f331f llvmpipe: replace GET_A0() macro w/ inline function
And GET_DADX(), GET_DADY(), GET_PLANES().  This is a bit more
readable, making the expected parameter types explicit.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 26775d7ca7 gallivm: s/0/LP_BLD_TEX_MODIFIER_NONE/
A minor readability improvement.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 2d4473c2ac llvmpipe: replace if/then with switch in llvmpipe_nir_fn_is_linear_compat()
To simplify the logic a bit.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 3e50112861 nir: add const qualifiers, move some decls in nir_to_tgsi_info.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 36c22b5dfb llvmpipe: minor code re-org in lp_state_fs_analysis.c
And add comments.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 923c73290e lavapipe: rework code to compute textures_used, samplers_used
The code did not handle more than 32 textures.  We have a test that
exercises 128 textures (views) and crashed w/ memory corruption down
in the llvm code generator because of this.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 938767e835 llvmpipe: add simple assertion in generate_fragment()
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 0c80bdf758 gallivm: s/unsigned/enum pipe_swizzle/
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 3f0a6c7ac1 llvmpipe: remove lp_rast_cmd_arg::state field
Use the existing 'set_state' field.  Some code was using 'state'
and other code was using 'set_state'.  It didn't really matter
since lp_rast_cmd_arg is a union, but this removes some potential
confusion.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 4d5d7d16dc llvmpipe: add minor comments in lp_rast.h, lp_setup-rect.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Lionel Landwerlin 2cac3b3817 anv: ensure tile flush before streamout writes
Streamout is not L3 coherent so previous writes to the same address
might be pending and overwrite the SO writes later when they get
flushed from L3, even though the SO write happened later in the batch.

v2: Use the right flag (not COUNTER)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6680
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17503>
2022-07-14 18:28:52 +00:00
Connor Abbott 67c9ca2319 tu: Use incoherent CCU write for buffer accesses
Unlike image writes, buffer writes may access the same memory in
different ways, which we've seen in the past can cause problems. Use an
incoherent access to force flush/invalidate between accesses to the same
buffer, unless we know the barrier applies to images only.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17193>
2022-07-14 17:23:39 +00:00
Boyuan Zhang 3962555db8 radeonsi/vcn: use calculated max hierarchy depth for hevc enc
Certain player has hard coded max_transform_hierarchy_depth_inter and
max_transform_hierarchy_depth_intra values set through VA-API, which
doesn't work on radeon HW. Until properly fixing it on player side,
temporarily adding this workaround to use calculated values instead.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17489>
2022-07-14 14:23:02 +00:00
Jesse Natalie 4845bc7072 zink: Use p_atomic_fetch_add
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17529>
2022-07-14 12:49:51 +00:00
Yogesh Mohan Marimuthu 1c2ca3cfb7 radeonsi: no need to call si_pm4_clear_state() in si_pm4_free_state()
the si_pm4_clear_state() initializes the variable in struct si_pm4_state which
anyway gets freed in si_pm4_free_state(). Hence no need to call
si_pm4_clear_state() in si_pm4_free_state().

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17504>
2022-07-14 10:30:09 +00:00
Yogesh Mohan Marimuthu 2330c71751 radeonsi: remove tabs from code
v2: fix indentation after if (Marek Olšák)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17504>
2022-07-14 10:30:09 +00:00
Kai Wasserbäch 301bcbac0e fix(gallivm): Replace LLVMConstF* with LLVMBuild* methods.
LLVM 15 removed support for LLVMConstF in commit
4bb7b6fae3be02031878b2aa3be584c6627ad8ec.

Reference: 4bb7b6fae3
Reference: 07146a9e64/llvm/docs/ReleaseNotes.rst (changes-to-the-c-api)
Closes: mesa/mesa#6863
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Tested-by: Marcus Seyfarth <m.seyfarth@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17518>
2022-07-14 10:02:14 +00:00
Mike Blumenkrantz 05552b4688 lavapipe: support inlined shader spirv for compute
no testing, full send

Fixes: d4d5a7abba ("lavapipe: implement EXT_graphics_pipeline_library")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17365>
2022-07-14 04:34:18 +00:00
Jesse Natalie 333432310a d3d12: Fix up resource import validation
Format on buffers is irrelevant and bind flag validation needs to be disabled.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie d119e6a46f d3d12: Implement fence opening and value setting
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie ea243ef1d5 d3d12: Implement server signal/wait
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie 416f10fc3f d3d12: Support importing fences / timeline semaphores
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie e3e22ce882 d3d12: Support opening resources and memobj by name
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie d462325895 d3d12: Implement resource_from_memobj
If the memobj wraps a resource, then we only succeed the
mapping operation if the gallium desc matches the D3D12
resource desc.

If the memobj wraps a heap, then we can place whatever
gallium is describing on the heap.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie bd0407a4a6 d3d12: Support creating memory objects
They can wrap either an opened heap or resource

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie c87d7cfaad d3d12: PIPE_BIND_SHARED doesn't mean linear and is always on opened resources
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie e02b11af57 d3d12: Get adapter LUID after device creation
Otherwise it's only set if the GL frontend gave us one

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie d6fa0a20b0 d3d12: Support B4G4R4A4 format
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie 5a9cc96784 d3d12: Add pipe getters for Win32 and base external objects device matching
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie 5f6795309f d3d12: Compute UUIDs required by external objects extension
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie 1b59b542ba d3d12: Store the rest of the device IDs in the screen
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie acba2bbb0e gallium, mesa: Support setting timeline semaphore values
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie 8cd391a63e gallium: Add a new fence type with a pipe cap to indicate it can be imported
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Jesse Natalie 633a469a7a driver_noop: Remove infinite recursion from create_fence_win32
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Jesse Natalie 7c4fa79bfa gallium: Add 'name' field to Win32 semaphore import
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Jesse Natalie 91b14d4a77 gallium: Add a 'name' field to winsys_handle
Win32 memory objects can be imported by name (const void *
that will be interpreted as const wchar_t *)

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Mike Blumenkrantz 89a9220cbf zink: reject swizzled format blits
e.g., R8G8B8A8 -> B8G8R8A8 is invalid, so use u_blitter

fixes (various gl configs):
KHR-GL46.blend_equation_advanced*

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17523>
2022-07-13 22:14:39 +00:00
Alyssa Rosenzweig 3a0a8688d3 panfrost: Use early-ZS helpers
Remove the previous compile-time early-ZS implementation and replace it with the
decoupled early-ZS implementation. This uses more efficient settings in some
cases (depth/stencil tests always passes or do not write), and fixes the
settings used in another case (alpha-to-coverage enabled with an otherwise
early-ZS shader.)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Closes: #6206
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17428>
2022-07-13 21:05:35 +00:00
Alyssa Rosenzweig 2454531de4 panfrost: Add zsa->zs_always_passes flag
If we know ahead-of-time that depth/stencil testing will always pass, it's
better to use weak_early than force_early. However, if depth/stencil testing
could fail (discarding pixels), we'd rather use force_early. Determine which
case we're in at CSO create time.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17428>
2022-07-13 21:05:35 +00:00
Alyssa Rosenzweig c89a3ad857 panfrost: Fix shader_modifies_coverage on Valhall
Alpha-to-coverage should set this flag. This is a hardware change since Bifrost.

Fixes: 26d339ef8a ("panfrost: Generate Valhall Malloc IDVS jobs")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17428>
2022-07-13 21:05:35 +00:00
Alyssa Rosenzweig fd1edbc6e5 panfrost: Only key points to point coord origin
Apparently, the point coord origin within a batch can change with Gallium
(seemingly even with GLES? where that's impossible at an API level?) but that
doesn't matter if we're not drawing points. This might have to do with internal
Gallium CSOs (e.g. u_blitter). Issue noticed in SuperTuxKart, which was getting
state change flushes. Performance on one level on a Valhall GPU improved from
26fps to 29fps.

Fixes: 3641dfe436 ("panfrost: Flip point coords in hardware")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17430>
2022-07-13 17:43:50 +00:00
Alyssa Rosenzweig 44d9c41b6b panfrost: Revert provoking vertex assertion
b6a30b72ab ("panfrost: Implement provoking vertices on Valhall") added an
assertion that every draw selects a particular provoking vertex. The intent was
to ensure provoking vertex selection actually happened. Unfortunately, the
assertion is too strong, as the provoking vertex is irrelevant for some (most)
draws. For those, we don't *want* to commit to a particular provoking vertex for
those to avoid flushing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17430>
2022-07-13 17:43:50 +00:00
Adam Jackson 768238fdc0 glx: Fix drawable refcounting for naked Windows
driFetchDrawable is only ever called from the MakeCurrent path, which
means it has to handle the case of pre-GLX-1.3 Windows being named as
the drawable. When it finds the drawable in the hash, it increments its
refcount before returning it, so for a GLXWindow it would be 2 on first
return, one from glXCreateWindow and one from glXMakeCurrent. But when
it does not find the drawable and creates one for the naked Window, the
reference count on first return would only be 1. As a result, if this
context was then ever bound to a different drawable, the old Window's
DRI drawable state (like the back buffer) would be destroyed.

Fixes piglit's glx-multi-window-single-context and glx-make-current for
a variety of drivers.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6713
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17479>
2022-07-13 12:25:30 -04:00
Lucas Stach 0d13dfcf7c etnaviv: tex_desc: remove descriptor patch TODO comment
There is nothing more TODO here. With softpin, which is available on all
GPUs using texture descriptors, there is no need for the kernel to patch
the descriptor, as the proper GPU virtual address is filled in by userspace.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17448>
2022-07-13 15:00:33 +00:00
Lucas Stach 8ddaca1633 etnaviv: tex_desc: make error handling more consistent
There already is a error handling label to free the sampler view
struct and return failure. Consistently use this label to make
error handling more uniform.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17448>
2022-07-13 15:00:33 +00:00
Lucas Stach 9a48b1bdb2 etnaviv: add texture descriptor suballocator
Texture descriptors currently waste a massive ammount of memory, as every
one is allocated via a separate BO. As the allocation granularity of the
kernel is 4KB and the descriptor is only 256B, 93.75% of the allocated
memory is wasted.

Add a simple suballocator for the texture descriptors, to allocate multiple
ones out of a single kernel BO. This isn't perfect, as freed slots in the
suballocated resource are not reused, but worst-case we end up with the
same waste as we had before. This also potentially improves efficiency at
the kernel side, as this reduces the number of BOs needed for the sampler
views in each submit.

As the BO is now used by multiple descriptors, avoid syncing with the GPU
via the cpu_prep/fini calls, as to not introduce stalls between pending
rendering and new descriptors being filled. This is safe, as each
suballocation slot is only used once, so newly filled slots are certainly
not in use by the GPU.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17448>
2022-07-13 15:00:33 +00:00
Lucas Stach 2c08decc8f etnaviv: move dummy BOs to screen
The dummy texture descriptor and the dummy render target relocs are not ever
changed by a context operation, so we can save some space by moving them to
the screen and potentially share them and the BOs backing them between
multiple contexts.

Also don't hold two pointers to the same BO, one in the reloc and one raw,
but always just use the reloc one.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17448>
2022-07-13 15:00:33 +00:00
Eric Engestrom f7f74a984b zink: add missing guards around `have_{ext}`
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17466>
2022-07-13 14:41:59 +00:00
Eric Engestrom 672df4d0fe zink: drop unused VkPhysicalDevicePortabilitySubsetPropertiesKHR
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17466>
2022-07-13 14:41:59 +00:00
Eric Engestrom 282013fe86 zink: fix portability_subset usage after rename from EXTX to KHR
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17466>
2022-07-13 14:41:59 +00:00
Gert Wollny 643623e1a3 r600/sfn: emulate pmr::monotonic_buffer_resource if needed
libc++ does not yet implement the c++17 monotonic_buffer_resource,
so emulate it by doing normal allocations that are cleaned up
when the resource is destroyed.

v2: - Use C include and version without namespace aligned_alloc
    - add include for sstream needed with clang++ (maurossi)

Closes: #6836
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17452>
2022-07-13 13:32:33 +00:00
Gert Wollny 3340c7ce35 r600/sfn: lower CLIPVERTEX to clip planes
With that most piglits for compatibility contexts are
passing, so enable higher compatibility profile support.

v2: fix formatting ahd fallthrough tag (Filip)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17484>
2022-07-13 15:17:17 +02:00
Gert Wollny 19ba29d996 r600/sfn: Add support for fdph
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17484>
2022-07-13 15:10:39 +02:00
Gert Wollny 0b0a04635b r600/sfn: Never consider an op with register dest as dead
Another hot-fix: when a local register is written to, it is
actually unlikely that the value is never used, so just make
sure that this is never done.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17484>
2022-07-13 15:10:34 +02:00
Gert Wollny 8222840e3f r600: limit loops when trying to merge alu groups
On Cayman bank_swizzle[4] is never counted up, so add an
additional condition to make sure the loop is finished
at one point. This is a hot-fix, the logic below should be
improved.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17484>
2022-07-13 15:10:28 +02:00
Iago Toral Quiroga 40976356f2 v3d,v3dv: stop copying and pasting the translate_swizzle helper
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17509>
2022-07-13 10:09:34 +00:00
Iago Toral Quiroga 8d8491df5e v3d: stop using a smaller texture limit in OpenGL
The compiler has improved significantly since we found this issue
and this is no longer required.

Notice that because we are increasing the number of samplers
supported beyond what we can loop unroll (currently capped at 16),
some piglit tests that test the maximum number of samplers supported
start to fail because they use indirect indexing on a sampler array
and we don't support that (previously the indirect indexing was
removed by loop unrolling). This is a bug in tests which the
GLSL linker detects, failing to compile the shaders.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17509>
2022-07-13 10:09:34 +00:00
Iago Toral Quiroga 9b74f4218f v3d,v3dv: stop hardcoding various image limits
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17509>
2022-07-13 10:09:34 +00:00
newbluemoon 6a4fc6f6ca nine: replace ulimit with sysconf call
__UL_GETOPENMAX seems to be glibc specific and not portable.
In glibc’s sysdeps/posix/ulimit.c it is assigned the return
value of sysconf(_SC_OPEN_MAX). So use the latter in the first place.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5176
CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17471>
2022-07-13 08:34:18 +00:00
Chuansheng Liu 39f8c61f32 iris,anv: correct the max thread number for DG2+
Correct the max thread number for DG2+ platforms according
to below bspec.

Ref: Bspec: 47202

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17506>
2022-07-13 08:11:19 +00:00
Georg Lehmann 9a83ccf1fa r600: Lower uadd_sat/usub_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17468>
2022-07-13 07:34:09 +00:00
Georg Lehmann e09e04a2c0 zink: Lower uadd_sat/usub_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17468>
2022-07-13 07:34:09 +00:00
Georg Lehmann d472c45810 nir_to_tgsi: Lower uadd_sat/usub_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17468>
2022-07-13 07:34:09 +00:00
Danylo Piliaiev bfd3c43aa9 freedreno: Add FD_GPU_TRACEPOINT envvar to toggle tracepoints
All tracepoints are enabled by default.

Example:
 FD_GPU_TRACEPOINT=-flush_batch

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16781>
2022-07-12 22:24:19 +00:00
Danylo Piliaiev 7a62219d33 freedreno: Refactor tracepoints generation to reduce duplication
This way we will not need to repeat arguments for "start" and "end"
tracepoints.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16781>
2022-07-12 22:24:19 +00:00
Danylo Piliaiev 82e79f6cdf freedreno: Add the rest of tracepoints with start/end to perfetto
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16781>
2022-07-12 22:24:19 +00:00
Emma Anholt 679e9697a9 kopper: Respect the vblank_mode env var.
We were defaulting to a swap interval of 1, but we can follow dri2/dri3's
lead and respect the driconf var.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17470>
2022-07-12 21:57:23 +00:00
Emma Anholt f9ecf99ca9 kopper: Use the swap interval that was set at swapchain creation time.
We need to track what the caller has given us for swap interval, and use
that to set the present mode at startup.

Fixes incorrect vblank syncing in apitrace's glretrace, which sets the
swap interval to 0 before the swapchain is made.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17470>
2022-07-12 21:57:23 +00:00
Marek Vasut 378da2c3ff etnaviv: Implement TXD
Fill in support for TXD instruction which emits shader TEXLDD opcode.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17500>
2022-07-12 21:28:11 +00:00
Marek Vasut 221d042c31 etnaviv: Rename etna_emit_tex() args
Rename the args from low_bias/compare to src1/src2, since they
are used for different purposes depending on the texture load
type. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17500>
2022-07-12 21:28:11 +00:00
Samuel Pitoiset ed6c346155 zink/ci: update list of CTS flakes for RADV
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17492>
2022-07-12 19:23:39 +00:00
Connor Abbott cf0cfd572e freedreno/a6xx: VPC_SO_NCOMP is actually VPC_SO_BUFFER_STRIDE
This answers the question in a comment in turnip, and fixes some GL46
tests and piglit tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17494>
2022-07-12 17:57:07 +00:00
Emma Anholt 2f851f0479 vc4: Work around a HW bug with 2-vert line loops.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17449>
2022-07-12 17:15:43 +00:00
Emma Anholt 0feedec9e6 zink: Do the timestamp-to-ns math in a double to have better precision.
Fixes arb_timer_query-timestamp-get on my radv system, where the GPU has
been on for many days and the timestamp would only increment every once in
a while.

Part of fixing #6808

Fixes: 7a40b734ee ("zink: handle timestamp queries")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17477>
2022-07-12 16:58:10 +00:00
Gert Wollny cf1715e391 r600/sfn: Don't use assert to test success of operation
With that the actual call will be eliminated if the code is
compiled with NDEBUG.

Fixes: 79ca456b48
  r600/sfn: rewrite NIR backend

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6832
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17496>
2022-07-12 16:48:20 +00:00
Eric Engestrom ebb3ea5790 lavapipe: use updated tokens from vk.xml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>
2022-07-12 15:53:11 +00:00
Eric Engestrom 0ab33ec6d4 zink: use updated tokens from vk.xml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>
2022-07-12 15:53:11 +00:00
Hoe Hao Cheng c8bd10852c zink/codegen: use the updated identifiers
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>
2022-07-12 15:53:11 +00:00
Mike Blumenkrantz fb917a606c lavapipe: don't crash on null xfb buffer pointer
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17469>
2022-07-12 13:43:37 +00:00
Mike Blumenkrantz 276557b9c6 lavapipe: don't overwrite entire VkFormatProperties3 struct
this clobbers pNext and breaks tooling, as found by Panagiotis Apostolou

Fixes: f72d5a930b ("lavapipe: KHR_format_feature_flags2")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17462>
2022-07-12 13:31:00 +00:00
SoroushIMG eb6faf329c zink: Fix BO size when it's not aligned to 16 bytes
glsl_get_explicit_size can return non-16 byte aligned sizes.
Therefore, make sure the sure the size isrounded up so that OOB does not happen.

Fixes: ea8a0654f5 ("zink: further improve bo sizing")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17460>
2022-07-12 12:58:02 +00:00
Adam Jackson 4fbc237cae gallium/dri: Remove the memory of GLX_MESA_multithread_makecurrent
The only way this could happen was if GLX did it, which it doesn't.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17473>
2022-07-12 10:02:46 +00:00
Samuel Pitoiset e9b2fa6527 radv: fix wide points/lines by configuring the guardband correctly
Fixes all remaining wide points/lines failures with Zink.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6121
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/17392>
2022-07-12 09:11:40 +02:00
Emma Anholt 240a98297d freedreno: Rename the "SIZE" regs for interpolateAtOffset to "CENTERRHW"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17322>
2022-07-11 16:56:05 +00:00
Emma Anholt 0e1fb2d984 nir+ir3: Rename load_size_ir3 to load_center_rhw_ir3.
Now that we know what it does, it also explains what it's doing in
interpolateAtOffset in ir3.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17322>
2022-07-11 16:56:05 +00:00
Daniel Schürmann 676700d660 radv/shader_info: fix load_frag_coord and load_sample_pos read masks
Fixes: a8c471f962 ('radv: gather more information about PS in the shader info pass')
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17417>
2022-07-11 06:36:45 +00:00
Gert Wollny b45cec260c r600/sfn: Add missing copyright information
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17450>
2022-07-11 05:45:26 +00:00
Pavel Ondračka 42a3d22f16 r300: Keep rc_rename_regs() from overflowing RC_REGISTER_MAX_INDEX
This pass tries to move register usage closer to SSA, and for large
shaders this means we can overflow the register index, which only has
RC_REGISTER_INDEX_BITS size. This creates invalid code and leads to
crash at a later stage. Limit the pool of available registers to
RC_REGISTER_MAX_INDEX, currently is was two times the number of
shader instructions.

This means we'll fail the compile right away if we wanted more than
RC_REGISTER_MAX_INDEX temps, but when we've got that many we're
already well past how many instructions we can support anyway.

CC: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6017
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17393>
2022-07-11 03:38:59 +00:00
Mike Blumenkrantz 21b3a23404 mesa: fix SignalSemaphoreEXT behavior
the EXT_external_object spec originally was underspecified with regards
to this function, leaving room for synchronization errors where:
* app calls SignalSemaphoreEXT to signal a semaphore
* mesa defers pipe_context::fence_server_signal with threaded context
* driver defers gpu submission
* SignalSemaphoreEXT has long since returned, app submits vk cmdbuf waiting on semaphore
* spec violation / device lost

to prevent this, the spec is being changed to:
1) require an implicit flush when calling SignalSemaphoreEXT
2) require that this implicit flush also forces GPU submission before SignalSemaphoreEXT returns

all affected drivers have been updated

fixes #6568

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17376>
2022-07-10 16:15:17 +00:00
Emma Anholt 426c7b65db vc4: Disable OES_texture_3D being exposed.
The hardware doesn't support 3D textures.  We had been lying about 3D
texture level support in the past so that we got GL 2.1, but now reporting
levels==0 doesn't disable GL 2.1 (since we don't check for GL2 extensions
any more).  But, by not lying, we now fix the majority of the remaining
GLES2 deqp failures.

This regresses a few desktop GL piglits which get GL errors that they
notice instead of what would be silent rendering failures on 3D texturing
operations.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17350>
2022-07-10 02:50:09 +00:00
Marek Olšák c9ca8abe4f Change all debug_assert calls to assert
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17403>
2022-07-10 00:50:35 +00:00
Marek Olšák 2f01a22fe4 util: remove our redefinition of assert
I think we can all agree that our own assert is unnecessary.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6780

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17403>
2022-07-10 00:50:34 +00:00
Marek Vasut c73cc1785a dri: Check buffer height and avoid overflow
The dri2_allocate_buffer() can be called with arbitrary height, however
the struct pipe_resource .height0 member is uint16_t. Check height for
maximum size to avoid overflow. Note that .width0 is unsigned int, so
it does not have the same issue.

The uint16 limit comes from commit:
e6428092f5 ("gallium: decrease the size of pipe_resource - 64 -> 48 bytes")

The overflow can be triggered e.g. by requesting large BO:
```
gbm_bo_create(dev, 1, 640*480*4, GBM_FORMAT_R8, GBM_BO_USE_LINEAR);
```

Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16513>
2022-07-09 22:07:14 +00:00
Marek Olšák 3b36700162 radeonsi: fix random PS wave size
Fixes: b3b2f97f2e "radeonsi: add Wave32 heuristics and shader profiles"

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17410>
2022-07-09 21:00:51 +00:00
David Heidelberg 71b32a9f75 docs: briefly document Gallium Nine
Credits: Axel Davy, lorn10, Pavel Ondračka

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4937

Acked-by: Filip Gawin <filip@gawin.net>
Acked-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17154>
2022-07-09 10:49:12 +00:00
Jason Ekstrand 530de844ef intel,anv,iris,crocus: Drop subgroup size from the shader key
Use nir->info.subgroup_size instead.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17337>
2022-07-08 22:47:22 +00:00
Jason Ekstrand b2ab6d10e4 mesa,glsl,ttn: Set subgroup_size to UNIFORM
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17337>
2022-07-08 22:47:22 +00:00
Tiago Koji Castro Shibata e64fd5e475 d3d12: add more formats to supported conversions
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4761
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17435>
2022-07-08 22:35:17 +00:00
Rob Clark c2c2da91a8 freedreno/a6xx: Do clip-plane lowering in backend
Our GS-lowered-to-quasi-VS confuses core nir passes, so handle clip-
plane lowering ourself.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Rob Clark 5352cd02f8 freedreno/a6xx: Handle driver-params in GS/DS
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Rob Clark 100d8afbbd freedreno: rename ir3_emit_driver_params()
Driver-params are not VS specific, rename helper to reflect this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Rob Clark bbcd04922f freedreno/a6xx: Fix VS const packet size
Need to account for the PKT7 header.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Rob Clark b63cc83f6a freedreno/a6xx: Fix indentation
Another victim of automated re-indenting being unaware of the semantics.
Re-indent this to put each dword of the packet on it's own line to make
the size of the packet more clear.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Rob Clark e16c46c6a8 freedreno/a6xx: assert valid vertex_flags reg
If this somehow gets optimized out, the GS will run forever.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Corentin Noël 5b683ba19a virgl: Only progagate the uniform numbers if the numbers are actually right
When the field was first introduces, the numbers were reporting the number of
vec4 instead of the number of float. Do not propagate them if they are wrong.

Fixes: d92c1ca01b

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17415>
2022-07-08 12:58:20 +00:00
Mike Blumenkrantz 2f3a233b6f zink: flush pending clears for fb texture barriers
if a texture barrier occurs while clears are pending, these clears should
show up if the fb attachments are read in shaders, so trigger a renderpass
to flush out the clears

cc: mesa-stable

fixes #6766

fixes (radv):
dEQP-GLES3.functional.draw_buffers_indexed.overwrite_common.common_advanced_blend_eq_buffer_advanced_blend_eq
dEQP-GLES3.functional.draw_buffers_indexed.overwrite_common.common_blend_eq_buffer_advanced_blend_eq
dEQP-GLES3.functional.draw_buffers_indexed.overwrite_common.common_separate_blend_eq_buffer_advanced_blend_eq
dEQP-GLES3.functional.draw_buffers_indexed.overwrite_indexed.common_advanced_blend_eq_buffer_advanced_blend_eq
dEQP-GLES3.functional.draw_buffers_indexed.overwrite_indexed.common_advanced_blend_eq_buffer_blend_eq
dEQP-GLES3.functional.draw_buffers_indexed.overwrite_indexed.common_advanced_blend_eq_buffer_separate_blend_eq

Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17363>
2022-07-08 11:58:11 +00:00
Georg Lehmann 27526ffad1 r600/sfn: Add missing std::array include.
Fixes: 79ca456b48 ("r600/sfn: rewrite NIR backend")
Closes https://gitlab.freedesktop.org/mesa/mesa/-/issues/6824

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17412>
2022-07-08 09:34:53 +00:00
Pierre-Eric Pelloux-Prayer 01314d0880 radeonsi: use LLVMBuildLoad2 for inter-stage outputs loads
The PS case was covered by the previous commit, so we can use f32
everywhere.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17361>
2022-07-08 08:41:26 +00:00
Pierre-Eric Pelloux-Prayer 248781dea1 radeonsi: use LLVMBuildLoad2 in llvm PS
PS is the only shader type where unpacked 16-bit outputs can be used,
so use ac_shader_abi::is_16bit to pass the proper type to LLVMBuildLoad2.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17361>
2022-07-08 08:41:26 +00:00
Pierre-Eric Pelloux-Prayer 196c4ebe1a ac: add per output is_16bit flag to ac_shader_abi
Outputs are always f32 except for FS that may use unpacked f16.
Store this information here to make it available to later processing.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17361>
2022-07-08 08:41:25 +00:00
Pierre-Eric Pelloux-Prayer c275e69cee radeonsi: use LLVMBuildLoad2 where possible
This commit replaces LLVMBuildLoad usage by LLVMBuildLoad2
where possible (= where the pointee type is known).

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17361>
2022-07-08 08:41:25 +00:00
Danylo Piliaiev d9296dcbbf zink: re-enable EXT_primitives_generated_query for Turnip
https://gitlab.freedesktop.org/mesa/mesa/-/issues/6602 is resolved
so the extension could be re-enabled.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17163>
2022-07-08 11:15:20 +03:00
Danylo Piliaiev bf4c160909 tu: Fix prim gen query and pipeline stats query interaction
Fixed:
- VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT was able to stop prim counter
  when pipeline stats query is running.
  - This may have happened when prim gen query was in secondary cmdbuf.
- VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT counting geometry in each tile.
- VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT counting geometry in each tile
  when pipeline stats query is started inside prim gen query and inside
  a renderpass.

The matter of VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT and pipeline stats
interaction is solved by tracking whether pipeline stats query is
running both on CPU (for non secondary cmdbuf case) and on GPU (for
secondary cmdbuf).

Note, prim gen query is not allowed with secondary command buffers, so
only pipeline stats query is tracked on gpu.
See https://gitlab.khronos.org/vulkan/vulkan/-/issues/3142

Counting geometry per each tile is solved by:
- Conditionally executing START/STOP_PRIMITIVE_CTRS to not run in tiling
  pass. Solves the case when prim gen query is inside a renderpass.
- Stop prim counters before executing `draw_cs` and restarting them
  afterwards. Solves prim gen query being outside a renderpass.

Fixes GL CTS tests with Zink + `TU_DEBUG=gmem`:
 GTF-GL46.gtf30.GL3Tests.transform_feedback.transform_feedback_max_separate
 GTF-GL46.gtf40.GL3Tests.transform_feedback2.transform_feedback2_basic
 GTF-GL46.gtf40.GL3Tests.transform_feedback2.transform_feedback2_framebuffer
 GTF-GL46.gtf40.GL3Tests.transform_feedback3.transform_feedback3_streams_overflow
 GTF-GL46.gtf40.GL3Tests.transform_feedback3.transform_feedback3_streams_queried
 GTF-GL46.gtf40.GL3Tests.transform_feedback2.transform_feedback2_states

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6602

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17163>
2022-07-08 11:14:18 +03:00
Samuel Pitoiset cf46397aec aco: fix load_barycentric_at_sample without MSAA
It's legal to use this instruction in a fragment shader, even if the
graphics pipeline doesn't use MSAA.

Fixes
dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.non_multisample_buffer.sample_n_*.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17398>
2022-07-08 07:28:33 +00:00
Alyssa Rosenzweig 638b22354e panfrost: Clear with a quad to avoid flushing
Flushing the batch midframe (splitting a renderpass) is expensive on a tiler, as
it requires the GPU to flush the framebuffer contents to main memory and read
them back. Clearing the framebuffer should not trigger a flush. Apps expect
clears to be (almost) free, flushing for a clear is at the very least unexpected
behaviour.

The only reason we previously flushed is to ensure we could always use a "fast"
clear. But a slow clear is a heck of a lot faster than a flush ;-) Instead of
flushing, we should clear with a draw (via u_blitter) in case a fast clear isn't
possible.

This fixes pathological performance for applications that rely on partial clears
within a frame. This issue was identified with Inochi2D, which repeatedly clears
the stencil buffer midframe, in order to implement masking efficiently with the
stencil buffer. In total, the all-important workload of rendering Asahi Lina is
improved from 17fps to 29fps on a panfrost device.

Fixes: c138ca80d2 ("panfrost: Make sure a clear does not re-use a pre-existing batch")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17112>
2022-07-08 01:50:03 +00:00
Icecream95 dc37ad2a73 panfrost: Enable QUAD_STRIP and POLYGON on v6
I wrote fiction about dreaming that these were supported but after
waking finding that they were not. Somehow I came to consider that
fiction as fact and I never thought to test if they did work.

While reverse engineering the polygon list format, I found that these
were supported after all.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17371>
2022-07-08 01:30:23 +00:00