intel: remove pipeline_*.[ch]

With most of the work moved to the compiler, we can fold them into pipeline.c.
diff --git a/icd/intel/pipeline.c b/icd/intel/pipeline.c
index 0a9997e..cc04221 100644
--- a/icd/intel/pipeline.c
+++ b/icd/intel/pipeline.c
@@ -27,11 +27,111 @@
  */
 
 #include "genhw/genhw.h"
+#include "compiler/pipeline/pipeline_compiler_interface.h"
 #include "cmd.h"
 #include "format.h"
 #include "shader.h"
-#include "pipeline_priv.h"
+#include "pipeline.h"
 
+struct intel_pipeline_create_info {
+    XGL_GRAPHICS_PIPELINE_CREATE_INFO   graphics;
+    XGL_PIPELINE_VERTEX_INPUT_CREATE_INFO vi;
+    XGL_PIPELINE_IA_STATE_CREATE_INFO   ia;
+    XGL_PIPELINE_DB_STATE_CREATE_INFO   db;
+    XGL_PIPELINE_CB_STATE               cb;
+    XGL_PIPELINE_RS_STATE_CREATE_INFO   rs;
+    XGL_PIPELINE_TESS_STATE_CREATE_INFO tess;
+    XGL_PIPELINE_SHADER                 vs;
+    XGL_PIPELINE_SHADER                 tcs;
+    XGL_PIPELINE_SHADER                 tes;
+    XGL_PIPELINE_SHADER                 gs;
+    XGL_PIPELINE_SHADER                 fs;
+
+    XGL_COMPUTE_PIPELINE_CREATE_INFO    compute;
+};
+struct intel_pipeline_shader *intel_pipeline_shader_create_meta(struct intel_dev *dev,
+                                                                enum intel_dev_meta_shader id)
+{
+    struct intel_pipeline_shader *sh;
+    XGL_RESULT ret;
+
+    sh = icd_alloc(sizeof(*sh), 0, XGL_SYSTEM_ALLOC_INTERNAL);
+    if (!sh)
+        return NULL;
+    memset(sh, 0, sizeof(*sh));
+
+    ret = intel_pipeline_shader_compile_meta(sh, dev->gpu, id);
+    if (ret != XGL_SUCCESS) {
+        icd_free(sh);
+        return NULL;
+    }
+
+    switch (id) {
+    case INTEL_DEV_META_VS_FILL_MEM:
+    case INTEL_DEV_META_VS_COPY_MEM:
+    case INTEL_DEV_META_VS_COPY_MEM_UNALIGNED:
+        sh->max_threads = intel_gpu_get_max_threads(dev->gpu,
+                XGL_SHADER_STAGE_VERTEX);
+        break;
+    default:
+        sh->max_threads = intel_gpu_get_max_threads(dev->gpu,
+                XGL_SHADER_STAGE_FRAGMENT);
+        break;
+    }
+
+    return sh;
+}
+
+void intel_pipeline_shader_destroy(struct intel_pipeline_shader *sh)
+{
+    intel_pipeline_shader_cleanup(sh);
+    icd_free(sh);
+}
+
+static XGL_RESULT pipeline_build_shader(struct intel_pipeline *pipeline,
+                                        struct intel_pipeline_shader *sh,
+                                        const XGL_PIPELINE_SHADER *sh_info)
+{
+    XGL_RESULT ret;
+
+    ret = intel_pipeline_shader_compile(sh, pipeline->dev->gpu, sh_info);
+    if (ret != XGL_SUCCESS)
+        return ret;
+
+    sh->max_threads =
+        intel_gpu_get_max_threads(pipeline->dev->gpu, sh_info->stage);
+
+    /* 1KB aligned */
+    sh->scratch_offset = u_align(pipeline->scratch_size, 1024);
+    pipeline->scratch_size = sh->scratch_offset +
+        sh->per_thread_scratch_size * sh->max_threads;
+
+    pipeline->active_shaders |= 1 << sh_info->stage;
+
+    return XGL_SUCCESS;
+}
+
+static XGL_RESULT pipeline_build_shaders(struct intel_pipeline *pipeline,
+                                         const struct intel_pipeline_create_info *info)
+{
+    XGL_RESULT ret = XGL_SUCCESS;
+
+    if (ret == XGL_SUCCESS && info->vs.shader)
+        ret = pipeline_build_shader(pipeline, &pipeline->vs, &info->vs);
+    if (ret == XGL_SUCCESS && info->tcs.shader)
+        ret = pipeline_build_shader(pipeline, &pipeline->tcs, &info->tcs);
+    if (ret == XGL_SUCCESS && info->tes.shader)
+        ret = pipeline_build_shader(pipeline, &pipeline->tes, &info->tes);
+    if (ret == XGL_SUCCESS && info->gs.shader)
+        ret = pipeline_build_shader(pipeline, &pipeline->gs, &info->gs);
+    if (ret == XGL_SUCCESS && info->fs.shader)
+        ret = pipeline_build_shader(pipeline, &pipeline->fs, &info->fs);
+
+    if (ret == XGL_SUCCESS && info->compute.cs.shader)
+        ret = pipeline_build_shader(pipeline, &pipeline->cs, &info->compute.cs);
+
+    return ret;
+}
 static uint32_t *pipeline_cmd_ptr(struct intel_pipeline *pipeline, int cmd_len)
 {
     uint32_t *ptr;
@@ -141,7 +241,29 @@
 {
     struct intel_pipeline *pipeline = intel_pipeline_from_obj(obj);
 
-    pipeline_tear_shaders(pipeline);
+    if (pipeline->active_shaders & SHADER_VERTEX_FLAG) {
+        intel_pipeline_shader_cleanup(&pipeline->vs);
+    }
+
+    if (pipeline->active_shaders & SHADER_TESS_CONTROL_FLAG) {
+        intel_pipeline_shader_cleanup(&pipeline->tcs);
+    }
+
+    if (pipeline->active_shaders & SHADER_TESS_EVAL_FLAG) {
+        intel_pipeline_shader_cleanup(&pipeline->tes);
+    }
+
+    if (pipeline->active_shaders & SHADER_GEOMETRY_FLAG) {
+        intel_pipeline_shader_cleanup(&pipeline->gs);
+    }
+
+    if (pipeline->active_shaders & SHADER_FRAGMENT_FLAG) {
+        intel_pipeline_shader_cleanup(&pipeline->fs);
+    }
+
+    if (pipeline->active_shaders & SHADER_COMPUTE_FLAG) {
+        intel_pipeline_shader_cleanup(&pipeline->cs);
+    }
 
     intel_base_destroy(&pipeline->obj.base);
 }