radeonsi: don't lower constant arrays to uniforms in GLSL IR
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 7 Apr 2020 01:28:32 +0000 (11:28 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 8 Apr 2020 01:23:40 +0000 (01:23 +0000)
This re-enables the change made in 2f5783bc2b82 which was
incorrectly disabled by 3e1dd99adca5.

For radeonsi, we will prefer the NIR pass as it'll generate better code
(some index calculation and a single load vs. a load, then index
calculation, then another load) and oftentimes NIR optimization can kick
in and make all the access indices constant.

Fixes: 3e1dd99adca5 ("radeonsi: Remove a bunch of default handling of pipe caps.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4474>

src/gallium/drivers/radeonsi/si_get.c

index 2a4a23cec1386894a961b2d8ae5d4f143215074b..4089b944559f4a37eb902000b1b4569d1611c24c 100644 (file)
@@ -218,6 +218,7 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return sscreen->info.has_sparse_vm_mappings ? RADEON_SPARSE_PAGE_SIZE : 0;
 
    case PIPE_CAP_UMA:
+   case PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF:
       return 0;
 
    case PIPE_CAP_FENCE_SIGNAL: