From 8c2448d4e67a19647afc7785fb31be6f7a6f094c Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 7 Dec 2022 22:34:40 -0800 Subject: [PATCH] intel/compiler: Delete sampler key handling for planar format stuff i965 used these, but Gallium drivers do this lowering via a separate nir_lower_tex call from st/mesa. Vulkan drivers don't use these at all. Reviewed-by: Jason Ekstrand Reviewed-by: Lionel Landwerlin Part-of: --- src/gallium/drivers/crocus/crocus_program.c | 1 - src/intel/compiler/brw_compiler.h | 15 --------------- src/intel/compiler/brw_debug_recompile.c | 7 ------- src/intel/compiler/brw_nir.c | 13 ------------- 4 files changed, 36 deletions(-) diff --git a/src/gallium/drivers/crocus/crocus_program.c b/src/gallium/drivers/crocus/crocus_program.c index 0fe30edccb9..753d37ea50e 100644 --- a/src/gallium/drivers/crocus/crocus_program.c +++ b/src/gallium/drivers/crocus/crocus_program.c @@ -160,7 +160,6 @@ crocus_populate_sampler_prog_key_data(struct crocus_context *ice, struct crocus_sampler_view *texture = ice->state.shaders[stage].textures[s]; key->swizzles[s] = SWIZZLE_NOOP; - key->scale_factors[s] = 0.0f; if (!texture) continue; diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index df62c1de05f..ea84e551eff 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -203,21 +203,6 @@ struct brw_sampler_prog_key_data { * For Sandybridge, which shader w/a we need for gather quirks. */ enum gfx6_gather_sampler_wa gfx6_gather_wa[BRW_MAX_SAMPLERS]; - - /** - * Texture units that have a YUV image bound. - */ - uint32_t y_u_v_image_mask; - uint32_t y_uv_image_mask; - uint32_t yx_xuxv_image_mask; - uint32_t xy_uxvx_image_mask; - uint32_t ayuv_image_mask; - uint32_t xyuv_image_mask; - uint32_t bt709_mask; - uint32_t bt2020_mask; - - /* Scale factor for each texture. */ - float scale_factors[BRW_MAX_SAMPLERS]; }; struct brw_base_prog_key { diff --git a/src/intel/compiler/brw_debug_recompile.c b/src/intel/compiler/brw_debug_recompile.c index 705edde88b1..6e055e09f7c 100644 --- a/src/intel/compiler/brw_debug_recompile.c +++ b/src/intel/compiler/brw_debug_recompile.c @@ -63,17 +63,10 @@ debug_sampler_recompile(const struct brw_compiler *c, void *log, bool found = false; found |= check("gather channel quirk", gather_channel_quirk_mask); - found |= check("y_uv image bound", y_uv_image_mask); - found |= check("y_u_v image bound", y_u_v_image_mask); - found |= check("yx_xuxv image bound", yx_xuxv_image_mask); - found |= check("xy_uxvx image bound", xy_uxvx_image_mask); - found |= check("ayuv image bound", ayuv_image_mask); - found |= check("xyuv image bound", xyuv_image_mask); for (unsigned i = 0; i < BRW_MAX_SAMPLERS; i++) { found |= check("EXT_texture_swizzle or DEPTH_TEXTURE_MODE", swizzles[i]); found |= check("textureGather workarounds", gfx6_gather_wa[i]); - found |= check_float("scale factor", scale_factors[i]); } for (unsigned i = 0; i < 3; i++) { diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index b89d7db4ddb..1933c487ab7 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -1451,19 +1451,6 @@ brw_nir_apply_sampler_key(nir_shader *nir, /* Prior to Haswell, we have to lower gradients on shadow samplers */ tex_options.lower_txd_shadow = devinfo->verx10 <= 70; - tex_options.lower_y_uv_external = key_tex->y_uv_image_mask; - tex_options.lower_y_u_v_external = key_tex->y_u_v_image_mask; - tex_options.lower_yx_xuxv_external = key_tex->yx_xuxv_image_mask; - tex_options.lower_xy_uxvx_external = key_tex->xy_uxvx_image_mask; - tex_options.lower_ayuv_external = key_tex->ayuv_image_mask; - tex_options.lower_xyuv_external = key_tex->xyuv_image_mask; - tex_options.bt709_external = key_tex->bt709_mask; - tex_options.bt2020_external = key_tex->bt2020_mask; - - /* Setup array of scaling factors for each texture. */ - memcpy(&tex_options.scale_factors, &key_tex->scale_factors, - sizeof(tex_options.scale_factors)); - return nir_lower_tex(nir, &tex_options); }