From b0bbd9c0d3310b80e20f2414311d4c14677d6558 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 5 Jun 2023 15:11:32 +0200 Subject: [PATCH] nir: do not needlessly rely on optimizations We're going to do this rewrite once we get to nir_opt_algebraic anyway, so let's save a little bit of needless work here. Reviewed-by: Rhys Perry Part-of: --- src/intel/vulkan_hasvk/anv_nir_lower_ycbcr_textures.c | 3 +-- src/vulkan/runtime/vk_nir_convert_ycbcr.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/intel/vulkan_hasvk/anv_nir_lower_ycbcr_textures.c b/src/intel/vulkan_hasvk/anv_nir_lower_ycbcr_textures.c index f39493fa33c..f43aff91575 100644 --- a/src/intel/vulkan_hasvk/anv_nir_lower_ycbcr_textures.c +++ b/src/intel/vulkan_hasvk/anv_nir_lower_ycbcr_textures.c @@ -72,8 +72,7 @@ implicit_downsampled_coord(nir_builder *b, { return nir_fadd(b, value, - nir_fdiv(b, - nir_imm_float(b, 1.0f), + nir_frcp(b, nir_fmul(b, nir_imm_float(b, div_scale), max_value))); diff --git a/src/vulkan/runtime/vk_nir_convert_ycbcr.c b/src/vulkan/runtime/vk_nir_convert_ycbcr.c index 8c2183c2657..9e0f1718aae 100644 --- a/src/vulkan/runtime/vk_nir_convert_ycbcr.c +++ b/src/vulkan/runtime/vk_nir_convert_ycbcr.c @@ -192,8 +192,7 @@ implicit_downsampled_coord(nir_builder *b, { return nir_fadd(b, value, - nir_fdiv(b, - nir_imm_float(b, 1.0f), + nir_frcp(b, nir_fmul(b, nir_imm_float(b, div_scale), max_value)));