crocus: limit texture gather workarounds to gen7/hsw
authorDave Airlie <airlied@redhat.com>
Mon, 21 Jun 2021 06:47:23 +0000 (16:47 +1000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 22 Jun 2021 18:56:20 +0000 (18:56 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11507>

src/gallium/drivers/crocus/crocus_program.c
src/gallium/drivers/crocus/crocus_state.c

index 24a8dcf..de360c6 100644 (file)
@@ -878,7 +878,7 @@ crocus_setup_binding_table(const struct intel_device_info *devinfo,
    bt->sizes[CROCUS_SURFACE_GROUP_TEXTURE] = BITSET_LAST_BIT(info->textures_used);
    bt->used_mask[CROCUS_SURFACE_GROUP_TEXTURE] = info->textures_used[0];
 
-   if (info->uses_texture_gather) {
+   if (info->uses_texture_gather && devinfo->ver < 8) {
       bt->sizes[CROCUS_SURFACE_GROUP_TEXTURE_GATHER] = BITSET_LAST_BIT(info->textures_used);
       bt->used_mask[CROCUS_SURFACE_GROUP_TEXTURE_GATHER] = info->textures_used[0];
    }
@@ -1005,7 +1005,7 @@ crocus_setup_binding_table(const struct intel_device_info *devinfo,
       nir_foreach_instr (instr, block) {
          if (instr->type == nir_instr_type_tex) {
             nir_tex_instr *tex = nir_instr_as_tex(instr);
-            bool is_gather = tex->op == nir_texop_tg4;
+            bool is_gather = devinfo->ver < 8 && tex->op == nir_texop_tg4;
 
             /* rewrite the tg4 component from green to blue before replacing the
                texture index */
index 04e8019..d51c55e 100644 (file)
@@ -2401,7 +2401,7 @@ crocus_create_sampler_view(struct pipe_context *ctx,
    /* just create a second view struct for texture gather just in case */
    isv->gather_view = isv->view;
 
-#if GFX_VER >= 7
+#if GFX_VER == 7
    if (fmt.fmt == ISL_FORMAT_R32G32_FLOAT ||
        fmt.fmt == ISL_FORMAT_R32G32_SINT ||
        fmt.fmt == ISL_FORMAT_R32G32_UINT) {
@@ -4908,7 +4908,9 @@ crocus_populate_binding_table(struct crocus_context *ice,
    int s = 0;
    uint32_t *surf_offsets = shader->surf_offset;
 
+#if GFX_VER < 8
    const struct shader_info *info = crocus_get_shader_info(ice, stage);
+#endif
 
    if (stage == MESA_SHADER_FRAGMENT) {
       struct pipe_framebuffer_state *cso_fb = &ice->state.framebuffer;
@@ -4983,6 +4985,7 @@ crocus_populate_binding_table(struct crocus_context *ice,
       s++;
    }
 
+#if GFX_VER < 8
    if (info && info->uses_texture_gather) {
       foreach_surface_used(i, CROCUS_SURFACE_GROUP_TEXTURE_GATHER) {
          struct crocus_sampler_view *view = shs->textures[i];
@@ -4993,6 +4996,7 @@ crocus_populate_binding_table(struct crocus_context *ice,
          s++;
       }
    }
+#endif
 
    foreach_surface_used(i, CROCUS_SURFACE_GROUP_IMAGE) {
       struct crocus_image_view *view = &shs->image[i];