From: Bas Nieuwenhuizen Date: Wed, 23 Jan 2019 21:41:46 +0000 (+0100) Subject: radv: Fix the shader info pass for not having the variable. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00253ab2c4983fc300e3c8d21629b69257995bcf;p=mesa.git radv: Fix the shader info pass for not having the variable. For example with VK_EXT_buffer_device_address or VK_KHR_variable_pointers. Fixes: a2b5cc3c399 "radv: enable variable pointers" Reviewed-by: Samuel Pitoiset --- diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c index 7e5a3789af2..e17b0e54e69 100644 --- a/src/amd/vulkan/radv_shader_info.c +++ b/src/amd/vulkan/radv_shader_info.c @@ -101,7 +101,7 @@ gather_intrinsic_load_deref_info(const nir_shader *nir, case MESA_SHADER_VERTEX: { nir_variable *var = nir_deref_instr_get_variable(nir_instr_as_deref(instr->src[0].ssa->parent_instr)); - if (var->data.mode == nir_var_shader_in) { + if (var && var->data.mode == nir_var_shader_in) { unsigned idx = var->data.location; uint8_t mask = nir_ssa_def_components_read(&instr->dest.ssa); @@ -150,7 +150,7 @@ gather_intrinsic_store_deref_info(const nir_shader *nir, { nir_variable *var = nir_deref_instr_get_variable(nir_instr_as_deref(instr->src[0].ssa->parent_instr)); - if (var->data.mode == nir_var_shader_out) { + if (var && var->data.mode == nir_var_shader_out) { unsigned idx = var->data.location; switch (nir->info.stage) {