Skip to content

Commit

Permalink
iris/anv: Disable hw acceleration for astc 1.on MTL platform 2.CTS case
Browse files Browse the repository at this point in the history
Disable HW accelaration on MTL platform.
On other platforms, only disable hw accelaration when running CTS.
Will enable again when it works well on MTL.

Tracked-On: OAM-116833
Signed-off-by: Lin, Shenghua <[email protected]>
  • Loading branch information
ShenghuaLinINTEL authored and celadon committed Jun 17, 2024
1 parent 812efb7 commit d68f867
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/gallium/auxiliary/util/u_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
return pscreen->get_driver_query_info && pscreen->get_driver_query_group_info &&
pscreen->get_driver_query_group_info(pscreen, 0, NULL) != 0;

case PIPE_CAP_TRANSCODE_ASTC_WORK_WELL:
return 1;

default:
unreachable("bad PIPE_CAP_*");
}
Expand Down
3 changes: 3 additions & 0 deletions src/gallium/drivers/iris/iris_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ iris_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_ASTC_VOID_EXTENTS_NEED_DENORM_FLUSH:
return devinfo->ver == 9 && !intel_device_info_is_9lp(devinfo);

case PIPE_CAP_TRANSCODE_ASTC_WORK_WELL:
return !intel_device_info_is_mtl(devinfo);

default:
return u_pipe_screen_get_param_defaults(pscreen, param);
}
Expand Down
1 change: 1 addition & 0 deletions src/gallium/include/pipe/p_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ enum pipe_cap
PIPE_CAP_VALIDATE_ALL_DIRTY_STATES,
PIPE_CAP_HAS_CONST_BW,
PIPE_CAP_PERFORMANCE_MONITOR,
PIPE_CAP_TRANSCODE_ASTC_WORK_WELL,
PIPE_CAP_LAST,
/* XXX do not add caps after PIPE_CAP_LAST! */
};
Expand Down
3 changes: 2 additions & 1 deletion src/intel/vulkan/anv_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -2241,7 +2241,8 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
isl_format_supports_sampling(&device->info,
ISL_FORMAT_ASTC_LDR_2D_4X4_FLT16);
if (!device->has_astc_ldr &&
driQueryOptionb(&device->instance->dri_options, "vk_require_astc"))
driQueryOptionb(&device->instance->dri_options, "vk_require_astc") &&
!intel_device_info_is_mtl(&devinfo))
device->emu_astc_ldr = true;
if (devinfo.ver == 9 && !intel_device_info_is_9lp(&devinfo)) {
device->flush_astc_ldr_void_extent_denorms =
Expand Down
1 change: 1 addition & 0 deletions src/mesa/state_tracker/st_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
PIPE_TEXTURE_2D, 0, 0,
PIPE_BIND_SAMPLER_VIEW);
st->transcode_astc = options->transcode_astc &&
screen->get_param(screen, PIPE_CAP_TRANSCODE_ASTC_WORK_WELL) &&
screen->is_format_supported(screen, PIPE_FORMAT_DXT5_SRGBA,
PIPE_TEXTURE_2D, 0, 0,
PIPE_BIND_SAMPLER_VIEW) &&
Expand Down
7 changes: 7 additions & 0 deletions src/util/00-mesa-defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,9 @@ TODO: document the other workarounds.
<application name="Insurgency" executable="insurgency_linux">
<option name="force_gl_vendor" value="X.Org" />
</application>
<application name="Android CTS" executable="com.drawelements.deqp:testercore">
<option name="transcode_astc" value="false" />
</application>

<application name="SPECviewperf13" executable="viewperf">
<!-- creo-03 needs this to compile shaders; we don't support some corner cases -->
Expand Down Expand Up @@ -1229,6 +1232,10 @@ TODO: document the other workarounds.
<engine engine_name_match="mesa zink">
<option name="no_16bit" value="true" />
</engine>
<application name="Android CTS" executable="com.drawelements.deqp:testercore">
<option name="vk_require_astc" value="false" />
</application>

<!-- Disable FCV optimization for Unreal Engine 5.1 workloads. -->
<engine engine_name_match="UnrealEngine5.1">
<option name="anv_disable_fcv" value="true" />
Expand Down

0 comments on commit d68f867

Please sign in to comment.