Mesa (master): spirv: Remove a redundant vtn_fail_if

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 6 00:40:26 UTC 2020


Module: Mesa
Branch: master
Commit: aabe37b96944aabdba16460bdf96faa9beee29e7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=aabe37b96944aabdba16460bdf96faa9beee29e7

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Wed Jul 29 18:18:17 2020 -0500

spirv: Remove a redundant vtn_fail_if

We already fail in these same cases in vk_desc_type_for_mode.  These
additional assertions are just extra code to update.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6479>

---

 src/compiler/spirv/vtn_variables.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 7307457df40..30bde8e4c1a 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -243,10 +243,6 @@ vtn_variable_resource_index(struct vtn_builder *b, struct vtn_variable *var,
    nir_intrinsic_set_binding(instr, var->binding);
    nir_intrinsic_set_desc_type(instr, vk_desc_type_for_mode(b, var->mode));
 
-   vtn_fail_if(var->mode != vtn_variable_mode_ubo &&
-               var->mode != vtn_variable_mode_ssbo,
-               "Invalid mode for vulkan_resource_index");
-
    nir_address_format addr_format = vtn_mode_to_address_format(b, var->mode);
    nir_ssa_dest_init(&instr->instr, &instr->dest,
                      nir_address_format_num_components(addr_format),
@@ -270,9 +266,6 @@ vtn_resource_reindex(struct vtn_builder *b, enum vtn_variable_mode mode,
    instr->src[1] = nir_src_for_ssa(offset_index);
    nir_intrinsic_set_desc_type(instr, vk_desc_type_for_mode(b, mode));
 
-   vtn_fail_if(mode != vtn_variable_mode_ubo && mode != vtn_variable_mode_ssbo,
-               "Invalid mode for vulkan_resource_reindex");
-
    nir_address_format addr_format = vtn_mode_to_address_format(b, mode);
    nir_ssa_dest_init(&instr->instr, &instr->dest,
                      nir_address_format_num_components(addr_format),
@@ -295,9 +288,6 @@ vtn_descriptor_load(struct vtn_builder *b, enum vtn_variable_mode mode,
    desc_load->src[0] = nir_src_for_ssa(desc_index);
    nir_intrinsic_set_desc_type(desc_load, vk_desc_type_for_mode(b, mode));
 
-   vtn_fail_if(mode != vtn_variable_mode_ubo && mode != vtn_variable_mode_ssbo,
-               "Invalid mode for load_vulkan_descriptor");
-
    nir_address_format addr_format = vtn_mode_to_address_format(b, mode);
    nir_ssa_dest_init(&desc_load->instr, &desc_load->dest,
                      nir_address_format_num_components(addr_format),



More information about the mesa-commit mailing list