mesa/src
Kenneth Graunke 155bb74ea9 nir: Actually do load/store vectorization beyond vec2
nir_opt_load_store_vectorize has an is_strided_vector() function that
looks for types with weird explicit strides.  It does so by comparing
the explicit stride against the type-size-derived typical stride.

This had a subtle bug.  Simple vector types (vec2/3/4) have no explicit
stride, so glsl_get_explicit_stride() returns 0.  This never matches the
typical stride for a vector, so is_strided_vector() would return true
for basically any vector type, causing the vectorizer to bail.

I found this by looking at a compute shader with scalar SSBO loads at
offsets 0x220, 0x224, 0x228, 0x22c.  nir_opt_load_store_vectorize would
properly vectorize the first two into a vec2 load, but would refuse to
extend it to a vec3 and ultimately vec4 load because is_strided_vector()
saw a vec2 and freaked out.

Neither ACO nor ANV do load/store vectorization before lowering derefs,
so this shouldn't affect them.  However, I'd like to fix this bug to
avoid the trap for anyone who decides to in the future.  In a branch
where anv used this lowering, this cut an additional 38% of the send
messages in the shader by properly vectorizing more things.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4255>
2020-04-22 21:22:36 -07:00
..
amd aco: coalesce v_mad's accumulator with definition's affinities 2020-04-22 18:23:23 +00:00
broadcom v3d: support for textureQueryLOD 2020-04-22 23:43:23 +02:00
compiler nir: Actually do load/store vectorization beyond vec2 2020-04-22 21:22:36 -07:00
drm-shim drm-shim: stub libdrm's use of realpath() 2020-04-03 21:14:18 +00:00
egl egl: simplify client/platform extension handling 2020-04-21 22:20:24 +00:00
etnaviv drm-shim: return device platform as specified 2020-04-03 21:14:18 +00:00
freedreno turnip: Skip unused regs when setting up streamout buffers 2020-04-23 01:14:19 +00:00
gallium v3d: support for textureQueryLOD 2020-04-22 23:43:23 +02:00
gbm gbm/dri: Propagate queryDmaBufModifiers return value 2020-04-16 10:19:35 +00:00
getopt meson: build getopt when using msvc 2019-09-10 20:36:47 +00:00
glx glx: omit loader_loader() for macOS 2020-04-15 11:37:21 +00:00
gtest gtest: Update to 1.10.0 2020-04-20 11:57:11 +00:00
hgl scons: Prune out unnecessary targets. 2020-03-30 13:38:01 +00:00
imgui meson: drop intel_ prefix on imgui_core 2019-12-10 15:16:02 +00:00
intel intel/compiler: Don't create 64-bit src1 immediates in opt_peephole_sel 2020-04-23 00:53:14 +00:00
loader loader: fallback to kernel name, if PCI fails 2020-04-01 16:57:22 +01:00
mapi remove final imports.h and imports.c bits 2020-04-21 11:09:04 -07:00
mesa mesa: enable GL_EXT_draw_instanced for gles2 2020-04-23 03:56:03 +00:00
panfrost panfrost: Fix crashes with small BOs 2020-04-22 01:01:18 +00:00
util util/ralloc: fix ralloc alignment on Win64 2020-04-21 21:56:21 +00:00
vulkan vulkan: drop unused include directories 2020-03-28 21:36:54 +01:00
meson.build remove final imports.h and imports.c bits 2020-04-21 11:09:04 -07:00
SConscript scons: Prune out unnecessary targets. 2020-03-30 13:38:01 +00:00