Commit Graph

55297 Commits

Author SHA1 Message Date
Gert Wollny ca1c78e885 r600/sfn: Fix emmision of LDS instructions
Assert to catch more possible erros with LDS fecth/read
groups.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny 8a7d34e3bd r600/sfn: Fix the kcache failure handling
Instead of starting a new block when the kcache handling failed,
try to continue scheduling instructions until kcache allocation
fails for all ready instruction.
With that we avoid a CF split withing an LDS fetch/read group.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny 8db31e0fe6 r600/sfn: count LDS queue pop reads separately in assembler
Otherwise the check whether the fetches and reads are balanced
could fail.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny 233f246bdf r600/sfn: lower undef to zero
It's what the backend would do anyway, so let's do it in nir and
give the optimizer some chance to profit from possible improvements.

Fixes a bad shader with "The Raven Remastered"

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny 982effcd4e r600/sfn: fix storing shader output array locations
When lowering gl_Clipertex the driver_location may no longer correspond
to the array index, so fill the array by counting the array index up
according to outputs that need to be handled by the state setup.

Fixes: 3340c7ce35
    r600/sfn: lower CLIPVERTEX to clip planes

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Gert Wollny 2e03dd1bef r600/sfn: clean up some commented out code
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
2022-07-23 13:10:45 +00:00
Vinson Lee 6b3af02a6f r600/sfn: Initialize TestShaderFromString member m_instr_factory.
Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member m_instr_factory is not
initialized in this constructor nor in any functions that it calls.

Fixes: 79ca456b48 ("r600/sfn: rewrite NIR backend")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17584>
2022-07-23 05:36:34 +00:00
Icecream95 d6c574f423 panfrost: Allow NULL streamout targets
Fixes Piglit test
arb_enhanced_layouts-transform-feedback-layout-qualifiers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 a0851f1cc4 panfrost: Don't unbind recently bound streamout targets
When unbinding extra targets, start after the last new target.

Fixes: 5ff7973560 ("panfrost: Import streamout data structures")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 a8dbf61b46 panfrost: Add a debug option for checking overflows on pool uploads
PAN_MESA_DEBUG=overflow will place objects as close as possible to a
protected region at the end of the buffer, so that overflows segfault.

Caught the bugs in all four of the preceding commits.

v2: memset the BO to 0xbb to catch code expecting zeroed allocations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 537f67f053 panfrost: Correctly calculate prefetch suppresion varying index
The xfb_base is a base index, it makes no sense to multiply that with
the number of streamout targets. Use addition instead to fix a buffer
overflow.

Fixes: 557633b142 ("panfrost: Suppress Bifrost prefetching")
Reported-by: Luc Ma <onion0709@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 37ab45079d panfrost: Clear the GENERAL varying buffer field if unused
Otherwise the indirect draw shader can read uninitialised data for the
stride, and the position varying buffer may be outside the heap BO.

The next commit fixes a bug that masked this one.

Fixes: 2e6d94c198 ("panfrost: Add helpers to support indirect draws")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 379ae6d823 panfrost: Emit the correct number of attributes
create_vertex_elements_state is sometimes called with a too large
num_elements argument, for example with util_blitter, which causes a
buffer overflow.

There is no documentation to forbid this practice, so don't rely on
so->num_elements being correct and instead use the vertex shader
attribute count, which matches the value used to allocate the
descriptors.

Use attributes_read_count rather than attribute_count because the
latter also includes images and PAN_VERTEX_ID/PAN_INSTANCE_ID.

Fixes: 76de3e691c ("panfrost: Merge attribute packing routines")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Icecream95 fe613a8de9 panfrost: Only emit images when they are present
nr_images is the trigger for allocating double the number of buffers
for attributes. When there are no images, there is not always enough
space for ALIGN_POT(k, 2) to not move k out of bounds, so don't
execute the line in that case.

Fixes: dc85f65e05 ("panfrost: emit shader image attribute descriptors")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
2022-07-23 00:56:10 +00:00
Mike Blumenkrantz 240835cfb0 zink: remove deqp fails for lavapipe
these are all broken tests, so ignore whatever results there were for now

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17721>
2022-07-22 16:13:57 -04:00
Mike Blumenkrantz 65c1504045 lavapipe: propagate xfb info for pipeline library rasterization stages
Fixes: 202bbedc55 ("lavapipe: streamline xfb shader setup")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17716>
2022-07-22 19:27:49 +00:00
Emma Anholt 254076f3fc ci/crocus: Fix the commented YML for blender-demo-cube_diorama.
Fixes: c0930b552d ("ci/crocus: Disable the blender trace.")
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17637>
2022-07-22 17:54:28 +00:00
Emma Anholt f6c5b1d6c6 nir: Split usub_sat lowering flag from uadd_sat.
Intel vec4 would like to do uadd_sat, but use lowering for usub_sat.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17637>
2022-07-22 17:54:28 +00:00
Nanley Chery bec82bb436 iris: Use fill_surface_states for compressed resources
In iris_create_surface, use the fill_surface_states helper function instead of
an open-coded solution for compressed resources.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17598>
2022-07-22 16:33:37 +00:00
Nanley Chery 6c65e990b6 iris: Don't leak compressed resources in iris_create_surface
Before this patch, we were leaking compressed resources in iris_create_surface.
Specifically, when we failed to create an uncompressed ISL surface and view for
a compressed resource, we didn't unreference the resource pointer we referenced
into the pipe_surface.

Fix this by delaying the pipe_surface initialization code to after attempting
to create the uncompressed surface and view.

Cc: 22.1 <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17598>
2022-07-22 16:33:36 +00:00
Nanley Chery bca601ffe9 iris: Don't leak surface states for compressed resources
Before this patch, we were leaking surface states in iris_create_surface.
Specifically, when we failed to create an uncompressed ISL surface and view for
a compressed resource, we didn't free surface states we allocated for it.

Fix this by attempting to create the uncompressed surface and view before we
allocate the surface states.

Cc: 22.1 <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17598>
2022-07-22 16:33:36 +00:00
Tapani Pälli da7a7c9bbc iris: implement Wa_14015264727 for DG2
On DG2 we need to flush data cache before fast clear operation.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17218>
2022-07-22 14:59:06 +00:00
Jesse Natalie 9c5d8dcf6c d3d12: Remove state tracking implementation details from header
Now that the old state tracking code is removed, implementation details
no longer need to be leaked out of this single source file. Remove structs,
function declarations, 'd3d12_' prefixes, and add static when possible.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 74a811382f d3d12: Add a transition flag indicating that state accumulation is needed
Most call sites for transitions will only apply transitions to one or two
resources, and don't need to use the bo set, where each call is guaranteed
to insert the bo, only to walk the set immediately afterwards. Instead, they
can just append the barriers to the dynarray directly and skip the bo set.

Draws and dispatches still use the append approach, to accumulate the full
set of state needed for each subresource for the case where a single
[sub]resource is bound to the pipeline in multiple places.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie fa570bda08 d3d12: Optimize transition_subresource_states that covers a whole resource
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie a3813505ce d3d12: Extract core barrier logic
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie aa94e0b37c d3d12: Rename bind invalidate options to transition flags
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie c6f01d6c45 d3d12: Swap the remainder of state tracking to new method
Uses a set of d3d12_bo on the context to track which bos are pending
a transition instead of an intrusive linked list, since the bo may
need to be pending on multiple contexts at once.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 05d04c7a54 d3d12: Record a state fixup command list when necessary
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 70e7cb444e d3d12: Track a global resource state for non-simultaneous-access resources
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 6acab47d7f d3d12: Create/free context state entries
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie f972a57b0b d3d12: Treat depth/stencil as planar for plane count helper
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 6bc5df76d3 d3d12: Add a context state tracking structure
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 6a8070bcef d3d12: Notify contexts about deletion of bos
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 375e8b2f4b d3d12: Hold lock when removing resources from residency list
Also, remove them from the list before releasing the ID3D12Resource.

Fixes: 671deb54 ("d3d12: Add residency info to d3d12_bo")
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie b72ec453bd d3d12: Add a list of contexts alive for the current screen
When a resource is destroyed, we'll need to let the contexts know.
This is guarded by the submit mutex, because we'll already be holding
that for at least one place where we want to iterate this list, and
it's low-frequency enough that re-using it is simpler than adding more
locks and creating confusing lock ordering.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 17c3f4f3e1 d3d12: Give bos a unique identifier to be used for state tracking
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie bc9616129e d3d12: Move current resource state to new files
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie 2016dec6a4 d3d12: Move desired resource state to new files
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Jesse Natalie a277dbf1f4 d3d12: Add a blank d3d12_resource_state.h/cpp
This will host some code that's moving and ported to match style
with the rest of the driver, and other code that will be re-written.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17688>
2022-07-22 14:42:56 +00:00
Mike Blumenkrantz 6b07893b31 util/vbuf: handle multidraws
this moves the handling from cso_conext to vbuf, which reduces overhead
for draws that aren't rewritten

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17686>
2022-07-22 12:40:56 +00:00
Lucas Stach 00955a644e etnaviv: remove etna_align_up() function
It does the same thing as align() from u_math.h, no need to
have a etnaviv specific version.

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/17695>
2022-07-22 09:08:29 +00:00
Erik Faye-Lund 89f77144d7 zink: drop pointless comment
We're already handling all the meaningful types here. The other types
like samplers, images, structs etc aren't really appropriate here.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17676>
2022-07-22 08:45:34 +00:00
Erik Faye-Lund d3dca05d53 zink: remove pointless assert
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17676>
2022-07-22 08:45:34 +00:00
Erik Faye-Lund 02de4a509c zink: remove pointless test
These are already all the bitsizes there are. No need to test for them.

Besides, get_uvec_type already contains an assert for the same
condition anyway.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17676>
2022-07-22 08:45:34 +00:00
Dave Airlie 21dd305694 llvmpipe: fix aniso cube map arrays.
There was a coordinate missing when you have cube map arrays,
and aniso sampling.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fixes: ce2b711c0a ("gallivm: add support for anisotropic sampling.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17704>
2022-07-22 14:18:39 +10:00
Jason Ekstrand 2b4e34d9b0 zink: Mark depth/stencil visual tests as flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17696>
2022-07-22 02:36:17 +00:00
Jesse Natalie fccd6e275c d3d12: Support clip halfz
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17567>
2022-07-22 00:00:54 +00:00
Sil Vilerino 948c03bf58 d3d12: Enable VPP rotation, flip, alpha blend, crop, scaling via pipe_video_codec::process_frame
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17557>
2022-07-21 22:40:31 +00:00
Sil Vilerino 323cf5a68d d3d12: Add pipe_video_codec::process_frame implementation
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17557>
2022-07-21 22:40:31 +00:00
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