mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 06:10:12 +01:00
radv: move features related drirc to radv_drirc::features
For better organization. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37145>
This commit is contained in:
parent
d915f24cb2
commit
d575b91b3a
3 changed files with 28 additions and 20 deletions
|
|
@ -203,6 +203,18 @@ static const driOptionDescription radv_dri_options[] = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
static void
|
||||
radv_init_dri_features_options(struct radv_instance *instance)
|
||||
{
|
||||
struct radv_drirc *drirc = &instance->drirc;
|
||||
|
||||
drirc->features.cooperative_matrix2_nv = driQueryOptionb(&drirc->options, "radv_cooperative_matrix2_nv");
|
||||
drirc->features.emulate_rt = driQueryOptionb(&drirc->options, "radv_emulate_rt");
|
||||
drirc->features.expose_float16_gfx8 = driQueryOptionb(&drirc->options, "radv_enable_float16_gfx8");
|
||||
drirc->features.vk_require_etc2 = driQueryOptionb(&drirc->options, "vk_require_etc2");
|
||||
drirc->features.vk_require_astc = driQueryOptionb(&drirc->options, "vk_require_astc");
|
||||
}
|
||||
|
||||
static void
|
||||
radv_init_dri_options(struct radv_instance *instance)
|
||||
{
|
||||
|
|
@ -213,6 +225,8 @@ radv_init_dri_options(struct radv_instance *instance)
|
|||
instance->vk.app_info.app_name, instance->vk.app_info.app_version,
|
||||
instance->vk.app_info.engine_name, instance->vk.app_info.engine_version);
|
||||
|
||||
radv_init_dri_features_options(instance);
|
||||
|
||||
drirc->enable_mrt_output_nan_fixup = driQueryOptionb(&drirc->options, "radv_enable_mrt_output_nan_fixup");
|
||||
|
||||
drirc->disable_shrink_image_store = driQueryOptionb(&drirc->options, "radv_disable_shrink_image_store");
|
||||
|
|
@ -275,21 +289,12 @@ radv_init_dri_options(struct radv_instance *instance)
|
|||
|
||||
drirc->report_llvm9_version_string = driQueryOptionb(&drirc->options, "radv_report_llvm9_version_string");
|
||||
|
||||
drirc->vk_require_etc2 = driQueryOptionb(&drirc->options, "vk_require_etc2");
|
||||
drirc->vk_require_astc = driQueryOptionb(&drirc->options, "vk_require_astc");
|
||||
|
||||
drirc->disable_dcc_mips = driQueryOptionb(&drirc->options, "radv_disable_dcc_mips");
|
||||
drirc->disable_dcc_stores = driQueryOptionb(&drirc->options, "radv_disable_dcc_stores");
|
||||
|
||||
drirc->lower_terminate_to_discard = driQueryOptionb(&drirc->options, "vk_lower_terminate_to_discard");
|
||||
|
||||
drirc->emulate_rt = driQueryOptionb(&drirc->options, "radv_emulate_rt");
|
||||
|
||||
drirc->expose_float16_gfx8 = driQueryOptionb(&drirc->options, "radv_enable_float16_gfx8");
|
||||
|
||||
drirc->disable_hiz_his_gfx12 = driQueryOptionb(&drirc->options, "radv_disable_hiz_his_gfx12");
|
||||
|
||||
drirc->cooperative_matrix2_nv = driQueryOptionb(&drirc->options, "radv_cooperative_matrix2_nv");
|
||||
}
|
||||
|
||||
static const struct vk_instance_extension_table radv_instance_extensions_supported = {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,14 @@ struct radv_drirc {
|
|||
struct driOptionCache options;
|
||||
struct driOptionCache available_options;
|
||||
|
||||
struct {
|
||||
bool cooperative_matrix2_nv;
|
||||
bool emulate_rt;
|
||||
bool expose_float16_gfx8;
|
||||
bool vk_require_astc;
|
||||
bool vk_require_etc2;
|
||||
} features;
|
||||
|
||||
bool enable_mrt_output_nan_fixup;
|
||||
bool disable_tc_compat_htile_in_general;
|
||||
bool disable_shrink_image_store;
|
||||
|
|
@ -53,15 +61,10 @@ struct radv_drirc {
|
|||
bool flush_before_timestamp_write;
|
||||
bool clear_lds;
|
||||
bool report_llvm9_version_string;
|
||||
bool vk_require_etc2;
|
||||
bool vk_require_astc;
|
||||
bool disable_dcc_mips;
|
||||
bool disable_dcc_stores;
|
||||
bool lower_terminate_to_discard;
|
||||
bool emulate_rt;
|
||||
bool expose_float16_gfx8;
|
||||
bool disable_hiz_his_gfx12;
|
||||
bool cooperative_matrix2_nv;
|
||||
bool no_dynamic_bounds;
|
||||
bool invariant_geom;
|
||||
bool split_fma;
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ radv_cooperative_matrix2_nv_enabled(const struct radv_physical_device *pdev)
|
|||
|
||||
const struct radv_instance *instance = radv_physical_device_instance(pdev);
|
||||
|
||||
return instance->drirc.cooperative_matrix2_nv;
|
||||
return instance->drirc.features.cooperative_matrix2_nv;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -177,7 +177,7 @@ radv_emulate_rt(const struct radv_physical_device *pdev)
|
|||
return true;
|
||||
|
||||
/* Do not force emulated RT on GPUs that have native support. */
|
||||
return !pdev->info.has_image_bvh_intersect_ray && instance->drirc.emulate_rt;
|
||||
return !pdev->info.has_image_bvh_intersect_ray && instance->drirc.features.emulate_rt;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -876,8 +876,8 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc
|
|||
.storagePushConstant8 = true,
|
||||
.shaderBufferInt64Atomics = true,
|
||||
.shaderSharedInt64Atomics = true,
|
||||
.shaderFloat16 =
|
||||
pdev->info.has_packed_math_16bit || (pdev->info.gfx_level == GFX8 && instance->drirc.expose_float16_gfx8),
|
||||
.shaderFloat16 = pdev->info.has_packed_math_16bit ||
|
||||
(pdev->info.gfx_level == GFX8 && instance->drirc.features.expose_float16_gfx8),
|
||||
.shaderInt8 = true,
|
||||
|
||||
.descriptorIndexing = pdev->info.has_vm_always_valid,
|
||||
|
|
@ -2284,8 +2284,8 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm
|
|||
pdev->emulate_etc2 = !pdev->info.has_etc_support;
|
||||
pdev->emulate_astc = true;
|
||||
#else
|
||||
pdev->emulate_etc2 = !pdev->info.has_etc_support && instance->drirc.vk_require_etc2;
|
||||
pdev->emulate_astc = instance->drirc.vk_require_astc;
|
||||
pdev->emulate_etc2 = !pdev->info.has_etc_support && instance->drirc.features.vk_require_etc2;
|
||||
pdev->emulate_astc = instance->drirc.features.vk_require_astc;
|
||||
#endif
|
||||
|
||||
snprintf(pdev->name, sizeof(pdev->name), "AMD RADV %s%s", pdev->info.name, radv_get_compiler_string(pdev));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue