mesa/src
Kenneth Graunke 5c88488a64 intel/eu: Fix XeHP register region validation for hstride == 0
Recently, we started using <1;1,0> register regions for consecutive
channels, rather than the <8;8,1> we've traditionally used, as the
<1;1,0> encoding can be compacted on XeHP.  Since then, one of the
EU validator rules has been flagging tons of instructions as errors:

   mov(16)   g114<1>F   g112<1,1,0>UD   { align1 1H I@2 compacted };
   ERROR: Register Regioning patterns where register data bit locations are changed between source and destination are not supported except for broadcast of a scalar.

Our code for this restriction checked three things:

   #1: vstride != width * hstride ||
   #2: src_stride != dst_stride ||
   #3: subreg != dst_subreg

Destination regions are always linear (no replicated values, nor
any overlapping components), as they only have hstride.  Rule #1 is
requiring that the source region be linear as well.  Rules #2-3 are
straightforward: the subregister must match (for the first channel to
line up), and the source/destination strides must match (for any
subsequent channels to line up).

Unfortunately, rules #1-2 weren't working when horizontal stride was 0.
In that case, regions are linear if width == 1, and the stride between
consecutive channels is given by vertical stride instead.

So we adjust our src_stride calculation from

   src_stride = hstride * type_size;

to:

   src_stride = (hstride ? hstride : vstride) * type_size;

and adjust rule #1 to allow hstride == 0 as long as width == 1.

While here, we also update the text of the rule to match the latest
documentation, which apparently clarifies that it's the location of
the LSB of the channel which matters.

Fixes: 3f50dde8b3 ("intel/eu: Teach EU validator about FP/DP pipeline regioning restrictions.")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17624>
2022-07-28 21:31:45 +00:00
..
amd util/list: rename LIST_ENTRY() to list_entry() 2022-07-28 10:10:44 +00:00
android_stub
asahi panfrost,asahi: Use util_sign_extend for unpacking 2022-07-06 11:23:18 +00:00
broadcom v3dv: expose Vulkan 1.2 2022-07-28 11:18:57 +00:00
c11 c11: reinstate the original license and authorship 2022-06-27 11:46:22 +00:00
compiler util/list: rename LIST_ENTRY() to list_entry() 2022-07-28 10:10:44 +00:00
drm-shim drm-shim: Cleanup on device file close 2022-05-02 19:50:33 +00:00
egl dri: add [ax]bgr16161616 to format lookup tables 2022-07-27 07:27:10 +00:00
etnaviv util/list: rename LIST_ENTRY() to list_entry() 2022-07-28 10:10:44 +00:00
freedreno util/list: rename LIST_ENTRY() to list_entry() 2022-07-28 10:10:44 +00:00
gallium virgL: lower fneg and fabs 2022-07-28 21:20:20 +00:00
gbm gbm: add GBM_FORMAT_[AX]BGR16161616 2022-07-27 07:27:10 +00:00
getopt
glx build(glx): Fix build by adding missing deps 2022-07-18 21:12:26 +00:00
gtest gtest: Fix maybe-uninitialized compiler warning 2022-06-29 21:02:18 +00:00
hgl
imagination pvr: Move BRN 44079, 48492 and 66011 code into pvrsrvkm specific directory 2022-07-27 10:13:19 +00:00
imgui
intel intel/eu: Fix XeHP register region validation for hstride == 0 2022-07-28 21:31:45 +00:00
loader dri: add [ax]bgr16161616 to format lookup tables 2022-07-27 07:27:10 +00:00
mapi Fix static glapi on Windows 2022-07-14 20:01:22 +00:00
mesa mesa/st: disable unrestricted fragment depth values for GL/GLES 2022-07-28 10:35:04 +10:00
microsoft dzn: Retrieve validator version 2022-07-23 14:48:17 +00:00
nouveau nir: Split usub_sat lowering flag from uadd_sat. 2022-07-22 17:54:28 +00:00
panfrost util/list: rename LIST_ENTRY() to list_entry() 2022-07-28 10:10:44 +00:00
tool meson/pps: Check if libdrm exists to compile pps 2022-06-22 11:52:36 +03:00
util util/reallocarray: add errno.h include. 2022-07-29 06:47:28 +10:00
virtio venus: add support for VK_KHR_dynamic_rendering 2022-07-23 01:14:22 +00:00
vulkan vulkan: Include self-dep info in rendering continues 2022-07-26 17:47:20 +00:00
meson.build meson: Use cc.get_argument_syntax instead cc.get_id when possible. 2022-06-16 19:59:58 +00:00