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

Author: Jason Ekstrand <[email protected]>
Date:   Thu Oct  1 10:43:05 2020 -0500

spirv/opencl: Drop dest_type from handle_v_load_store

At that point in the function, we don't know if it's a load or a store
so calling it dest_type isn't really helpful.  Also, we don't really
want the glsl_type; we want the base_type.

Reviewed-by: Jesse Natalie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6945>

---

 src/compiler/spirv/vtn_opencl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/compiler/spirv/vtn_opencl.c b/src/compiler/spirv/vtn_opencl.c
index 975336aa4c4..13adb846d38 100644
--- a/src/compiler/spirv/vtn_opencl.c
+++ b/src/compiler/spirv/vtn_opencl.c
@@ -623,8 +623,8 @@ _handle_v_load_store(struct vtn_builder *b, enum 
OpenCLstd_Entrypoints opcode,
       type = vtn_get_value_type(b, w[5]);
    unsigned a = load ? 0 : 1;
 
-   const struct glsl_type *dest_type = type->type;
-   unsigned components = glsl_get_vector_elements(dest_type);
+   enum glsl_base_type base_type = glsl_get_base_type(type->type);
+   unsigned components = glsl_get_vector_elements(type->type);
 
    nir_ssa_def *offset = vtn_get_nir_ssa(b, w[5 + a]);
    struct vtn_value *p = vtn_value(b, w[6 + a], vtn_value_type_pointer);
@@ -643,7 +643,7 @@ _handle_v_load_store(struct vtn_builder *b, enum 
OpenCLstd_Entrypoints opcode,
          comps[i] = vtn_local_load(b, arr_deref, p->type->access);
          ncomps[i] = comps[i]->def;
       } else {
-         struct vtn_ssa_value *ssa = vtn_create_ssa_value(b, 
glsl_scalar_type(glsl_get_base_type(dest_type)));
+         struct vtn_ssa_value *ssa = vtn_create_ssa_value(b, 
glsl_scalar_type(base_type));
          struct vtn_ssa_value *val = vtn_ssa_value(b, w[5]);
          ssa->def = nir_channel(&b->nb, val->def, i);
          vtn_local_store(b, ssa, arr_deref, p->type->access);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to