nir/builder: Make nir_get_ptr_bitsize take a nir_shader
authorJason Ekstrand <jason@jlekstrand.net>
Sat, 15 Aug 2020 02:19:07 +0000 (21:19 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 17 Aug 2020 14:36:18 +0000 (14:36 +0000)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6330>

src/compiler/nir/nir_builder.h

index 10268ddf6bdf8ab15165e565d16a2d286ab4c496..1c1ed9d437358cb93c53577c24f09f8f7787a78f 100644 (file)
@@ -963,10 +963,10 @@ nir_ssa_for_alu_src(nir_builder *build, nir_alu_instr *instr, unsigned srcn)
 }
 
 static inline unsigned
-nir_get_ptr_bitsize(nir_builder *build)
+nir_get_ptr_bitsize(nir_shader *shader)
 {
-   if (build->shader->info.stage == MESA_SHADER_KERNEL)
-      return build->shader->info.cs.ptr_size;
+   if (shader->info.stage == MESA_SHADER_KERNEL)
+      return shader->info.cs.ptr_size;
    return 32;
 }
 
@@ -981,7 +981,7 @@ nir_build_deref_var(nir_builder *build, nir_variable *var)
    deref->var = var;
 
    nir_ssa_dest_init(&deref->instr, &deref->dest, 1,
-                     nir_get_ptr_bitsize(build), NULL);
+                     nir_get_ptr_bitsize(build->shader), NULL);
 
    nir_builder_instr_insert(build, &deref->instr);