nvc0: set local mem size for compute on gv100
authorKarol Herbst <kherbst@redhat.com>
Thu, 9 Jul 2020 21:52:56 +0000 (23:52 +0200)
committerMarge Bot <eric+marge@anholt.net>
Sat, 11 Jul 2020 19:57:18 +0000 (19:57 +0000)
This is required when the shader uses local memory for arrays or spills.
I really dislike how it's done right now, but oh well, it's the same for
other gens.

Fixes CTS tests:
KHR-GL46.shading_language_420pack.binding_image_array
KHR-GL46.shading_language_420pack.length_of_compute_result

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5840>

src/gallium/drivers/nouveau/nvc0/nve4_compute.c

index d4687b652ba41e868295033d7777b3f701b35246..89c9406ea14cf485b882277643485fd3a1b5886c 100644 (file)
@@ -762,6 +762,10 @@ gv100_compute_setup_launch_desc(struct nvc0_context *nvc0, u32 *qmd,
    NVC3C0_QMDV02_02_DEF_SET(qmd, SAMPLER_INDEX, VIA_HEADER_INDEX);
    NVC3C0_QMDV02_02_VAL_SET(qmd, SHARED_MEMORY_SIZE,
                                   align(cp->cp.smem_size, 0x100));
+   NVC3C0_QMDV02_02_VAL_SET(qmd, SHADER_LOCAL_MEMORY_LOW_SIZE,
+                                 (cp->hdr[1] & 0xfffff0) +
+                                 align(cp->cp.lmem_size, 0x10));
+   NVC3C0_QMDV02_02_VAL_SET(qmd, SHADER_LOCAL_MEMORY_HIGH_SIZE, 0);
    NVC3C0_QMDV02_02_VAL_SET(qmd, MIN_SM_CONFIG_SHARED_MEM_SIZE,
                                   gv100_sm_config_smem_size(8 * 1024));
    NVC3C0_QMDV02_02_VAL_SET(qmd, MAX_SM_CONFIG_SHARED_MEM_SIZE,