Module: Mesa Branch: main Commit: 467ee940019bdd0de79cd4666c84d20277c7c1b4 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=467ee940019bdd0de79cd4666c84d20277c7c1b4
Author: Emma Anholt <[email protected]> Date: Mon May 16 16:13:56 2022 -0700 iris: Disable GLSL lower_const_arrays_to_uniforms. We want to use nir_opt_large_constants() instead (which is already enabled), since that doesn't involve uploading the large immediate data array again on each CB0 update. The downside is a bit of addressing math, since constant_data is accessed using 64-bit global addresses. The shader-db results are a bit all over: All Iris driver platforms had similar results. (Ice Lake shown) total instructions in shared programs: 19910185 -> 19913931 (0.02%) instructions in affected programs: 225374 -> 229120 (1.66%) helped: 3 / HURT: 348 total cycles in shared programs: 856004856 -> 855016808 (-0.12%) cycles in affected programs: 22832422 -> 21844374 (-4.33%) helped: 277 / HURT: 101 total spills in shared programs: 6580 -> 6609 (0.44%) spills in affected programs: 516 -> 545 (5.62%) helped: 1 / HURT: 4 total fills in shared programs: 8235 -> 8267 (0.39%) fills in affected programs: 1022 -> 1054 (3.13%) helped: 1 / HURT: 3 total sends in shared programs: 1039347 -> 1039095 (-0.02%) sends in affected programs: 16367 -> 16115 (-1.54%) helped: 251 / HURT: 0 LOST: 5 GAINED: 2 LOST: - 3 SIMD16 fragment shaders (Superposition) - 2 SIMD16 compute shaders (Aztec Ruins) GAINED: - fake news... 2 SIMD8 compute shaders that replace the lost SIMD16 compute shaders. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16539> --- src/gallium/drivers/iris/iris_screen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index ce6a66cb710..5b66eb84f23 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -363,6 +363,11 @@ iris_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS: case PIPE_CAP_MAX_VARYINGS: return 32; + case PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF: + /* We want immediate arrays to go get uploaded as nir->constant_data by + * nir_opt_large_constants() instead. + */ + return 0; case PIPE_CAP_RESOURCE_FROM_USER_MEMORY: /* AMD_pinned_memory assumes the flexibility of using client memory * for any buffer (incl. vertex buffers) which rules out the prospect
