return nir_shader_instructions_pass(nir, invert_point_coord_instr, nir_metadata_dominance, NULL);
}
-static VkShaderModule
+static struct zink_shader_object
compile_module(struct zink_screen *screen, struct zink_shader *zs, nir_shader *nir)
{
VkShaderModule mod = VK_NULL_HANDLE;
zs->spirv = spirv;
else
ralloc_free(spirv);
- return mod;
+ struct zink_shader_object obj = {.mod = mod};
+ return obj;
}
VkShaderModule
zink_shader_compile(struct zink_screen *screen, struct zink_shader *zs,
nir_shader *nir, const struct zink_shader_key *key, const void *extra_data)
{
- VkShaderModule mod = VK_NULL_HANDLE;
struct zink_shader_info *sinfo = &zs->sinfo;
bool need_optimize = false;
bool inlined_uniforms = false;
} else if (need_optimize)
optimize_nir(nir, zs);
- mod = compile_module(screen, zs, nir);
+ struct zink_shader_object obj = compile_module(screen, zs, nir);
ralloc_free(nir);
- return mod;
+ return obj.mod;
}
struct zink_shader_object
}
}
optimize_nir(nir, zs);
- VkShaderModule mod = compile_module(screen, zs, nir);
+ struct zink_shader_object obj = compile_module(screen, zs, nir);
ralloc_free(nir);
- struct zink_shader_object obj = {.mod = mod};
return obj;
}