crocus: limit texture gather workarounds to gen7/hsw

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11507>
This commit is contained in:
Dave Airlie 2021-06-21 16:47:23 +10:00 committed by Marge Bot
parent df0e131b43
commit fa52824f3d
2 changed files with 7 additions and 3 deletions

View 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 */

View 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];