Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 1 | /* |
| 2 | * XGL |
| 3 | * |
| 4 | * Copyright (C) 2014 LunarG, Inc. |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * copy of this software and associated documentation files (the "Software"), |
| 8 | * to deal in the Software without restriction, including without limitation |
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | * and/or sell copies of the Software, and to permit persons to whom the |
| 11 | * Software is furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included |
| 14 | * in all copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 22 | * DEALINGS IN THE SOFTWARE. |
Chia-I Wu | 44e4236 | 2014-09-02 08:32:09 +0800 | [diff] [blame] | 23 | * |
| 24 | * Authors: |
| 25 | * Courtney Goeltzenleuchter <courtney@lunarg.com> |
| 26 | * Chia-I Wu <olv@lunarg.com> |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 27 | */ |
| 28 | |
Chia-I Wu | 8370b40 | 2014-08-29 12:28:37 +0800 | [diff] [blame] | 29 | #include "genhw/genhw.h" |
| 30 | |
| 31 | #include "cmd.h" |
Courtney Goeltzenleuchter | 4250999 | 2014-08-21 17:33:46 -0600 | [diff] [blame] | 32 | #include "shader.h" |
Chia-I Wu | ed83387 | 2014-08-23 17:00:35 +0800 | [diff] [blame] | 33 | #include "pipeline_priv.h" |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 34 | |
Courtney Goeltzenleuchter | 814cd29 | 2014-08-28 13:16:27 -0600 | [diff] [blame] | 35 | static uint32_t *pipeline_cmd_ptr(struct intel_pipeline *pipeline, int cmd_len) |
| 36 | { |
| 37 | uint32_t *ptr; |
| 38 | |
| 39 | assert(pipeline->cmd_len + cmd_len < INTEL_PSO_CMD_ENTRIES); |
| 40 | ptr = &pipeline->cmds[pipeline->cmd_len]; |
| 41 | pipeline->cmd_len += cmd_len; |
| 42 | return ptr; |
| 43 | } |
| 44 | |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 45 | static XGL_RESULT pipeline_ia_state(struct intel_pipeline *pipeline, |
| 46 | const XGL_PIPELINE_IA_STATE_CREATE_INFO* ia_state) |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 47 | { |
Courtney Goeltzenleuchter | 4250999 | 2014-08-21 17:33:46 -0600 | [diff] [blame] | 48 | pipeline->ia_state = *ia_state; |
| 49 | |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 50 | if (ia_state->provokingVertex == XGL_PROVOKING_VERTEX_FIRST) { |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 51 | pipeline->provoking_vertex_tri = 0; |
| 52 | pipeline->provoking_vertex_trifan = 1; |
| 53 | pipeline->provoking_vertex_line = 0; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 54 | } else { |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 55 | pipeline->provoking_vertex_tri = 2; |
| 56 | pipeline->provoking_vertex_trifan = 2; |
| 57 | pipeline->provoking_vertex_line = 1; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | switch (ia_state->topology) { |
| 61 | case XGL_TOPOLOGY_POINT_LIST: |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 62 | pipeline->prim_type = GEN6_3DPRIM_POINTLIST; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 63 | break; |
| 64 | case XGL_TOPOLOGY_LINE_LIST: |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 65 | pipeline->prim_type = GEN6_3DPRIM_LINELIST; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 66 | break; |
| 67 | case XGL_TOPOLOGY_LINE_STRIP: |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 68 | pipeline->prim_type = GEN6_3DPRIM_LINESTRIP; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 69 | break; |
| 70 | case XGL_TOPOLOGY_TRIANGLE_LIST: |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 71 | pipeline->prim_type = GEN6_3DPRIM_TRILIST; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 72 | break; |
| 73 | case XGL_TOPOLOGY_TRIANGLE_STRIP: |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 74 | pipeline->prim_type = GEN6_3DPRIM_TRISTRIP; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 75 | break; |
| 76 | case XGL_TOPOLOGY_RECT_LIST: |
| 77 | /* |
| 78 | * TODO: Rect lists are special in XGL, do we need to do |
| 79 | * something special here? |
| 80 | * XGL Guide: |
| 81 | * The rectangle list is a special geometry primitive type |
| 82 | * that can be used for implementing post-processing techniques |
| 83 | * or efficient copy operations. There are some special limitations |
| 84 | * for rectangle primitives. They cannot be clipped, must |
| 85 | * be axis aligned and cannot have depth gradient. |
| 86 | * Failure to comply with these restrictions results in |
| 87 | * undefined rendering results. |
| 88 | */ |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 89 | pipeline->prim_type = GEN6_3DPRIM_RECTLIST; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 90 | break; |
| 91 | case XGL_TOPOLOGY_QUAD_LIST: |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 92 | pipeline->prim_type = GEN6_3DPRIM_QUADLIST; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 93 | break; |
| 94 | case XGL_TOPOLOGY_QUAD_STRIP: |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 95 | pipeline->prim_type = GEN6_3DPRIM_QUADSTRIP; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 96 | break; |
| 97 | case XGL_TOPOLOGY_LINE_LIST_ADJ: |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 98 | pipeline->prim_type = GEN6_3DPRIM_LINELIST_ADJ; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 99 | break; |
| 100 | case XGL_TOPOLOGY_LINE_STRIP_ADJ: |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 101 | pipeline->prim_type = GEN6_3DPRIM_LINESTRIP_ADJ; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 102 | break; |
| 103 | case XGL_TOPOLOGY_TRIANGLE_LIST_ADJ: |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 104 | pipeline->prim_type = GEN6_3DPRIM_TRILIST_ADJ; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 105 | break; |
| 106 | case XGL_TOPOLOGY_TRIANGLE_STRIP_ADJ: |
Courtney Goeltzenleuchter | 8a3de59 | 2014-08-22 09:09:46 -0600 | [diff] [blame] | 107 | pipeline->prim_type = GEN6_3DPRIM_TRISTRIP_ADJ; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 108 | break; |
| 109 | case XGL_TOPOLOGY_PATCH: |
| 110 | // TODO: implement something here |
| 111 | break; |
| 112 | default: |
| 113 | return XGL_ERROR_BAD_PIPELINE_DATA; |
| 114 | } |
| 115 | |
| 116 | if (ia_state->primitiveRestartEnable) { |
| 117 | pipeline->primitive_restart = true; |
| 118 | pipeline->primitive_restart_index = ia_state->primitiveRestartIndex; |
| 119 | } else { |
| 120 | pipeline->primitive_restart = false; |
| 121 | } |
| 122 | |
| 123 | if (ia_state->disableVertexReuse) { |
| 124 | // TODO: What do we do to disable vertex reuse? |
| 125 | } |
| 126 | |
| 127 | return XGL_SUCCESS; |
| 128 | } |
| 129 | |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 130 | static XGL_RESULT pipeline_rs_state(struct intel_pipeline *pipeline, |
| 131 | const XGL_PIPELINE_RS_STATE_CREATE_INFO* rs_state) |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 132 | { |
| 133 | pipeline->depthClipEnable = rs_state->depthClipEnable; |
| 134 | pipeline->rasterizerDiscardEnable = rs_state->rasterizerDiscardEnable; |
| 135 | pipeline->pointSize = rs_state->pointSize; |
| 136 | return XGL_SUCCESS; |
| 137 | } |
| 138 | |
Courtney Goeltzenleuchter | 4250999 | 2014-08-21 17:33:46 -0600 | [diff] [blame] | 139 | static void pipeline_destroy(struct intel_obj *obj) |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 140 | { |
| 141 | struct intel_pipeline *pipeline = intel_pipeline_from_obj(obj); |
| 142 | |
Courtney Goeltzenleuchter | d85c1d6 | 2014-08-27 14:04:53 -0600 | [diff] [blame] | 143 | if (pipeline->active_shaders & SHADER_VERTEX_FLAG) { |
Chia-I Wu | 282d3bc | 2014-08-28 15:36:44 +0800 | [diff] [blame] | 144 | icd_free(pipeline->intel_vs.pCode); |
Courtney Goeltzenleuchter | d85c1d6 | 2014-08-27 14:04:53 -0600 | [diff] [blame] | 145 | } |
| 146 | if (pipeline->active_shaders & SHADER_GEOMETRY_FLAG) { |
Chia-I Wu | 282d3bc | 2014-08-28 15:36:44 +0800 | [diff] [blame] | 147 | icd_free(pipeline->gs.pCode); |
Courtney Goeltzenleuchter | d85c1d6 | 2014-08-27 14:04:53 -0600 | [diff] [blame] | 148 | } |
| 149 | if (pipeline->active_shaders & SHADER_FRAGMENT_FLAG) { |
Chia-I Wu | 282d3bc | 2014-08-28 15:36:44 +0800 | [diff] [blame] | 150 | icd_free(pipeline->intel_fs.pCode); |
Courtney Goeltzenleuchter | d85c1d6 | 2014-08-27 14:04:53 -0600 | [diff] [blame] | 151 | } |
| 152 | if (pipeline->active_shaders & SHADER_TESS_CONTROL_FLAG) { |
Chia-I Wu | 282d3bc | 2014-08-28 15:36:44 +0800 | [diff] [blame] | 153 | icd_free(pipeline->tess_control.pCode); |
Courtney Goeltzenleuchter | d85c1d6 | 2014-08-27 14:04:53 -0600 | [diff] [blame] | 154 | } |
| 155 | if (pipeline->active_shaders & SHADER_TESS_EVAL_FLAG) { |
Chia-I Wu | 282d3bc | 2014-08-28 15:36:44 +0800 | [diff] [blame] | 156 | icd_free(pipeline->tess_eval.pCode); |
Courtney Goeltzenleuchter | d85c1d6 | 2014-08-27 14:04:53 -0600 | [diff] [blame] | 157 | } |
| 158 | |
Chia-I Wu | ed83387 | 2014-08-23 17:00:35 +0800 | [diff] [blame] | 159 | if (pipeline->vs_rmap) |
| 160 | intel_rmap_destroy(pipeline->vs_rmap); |
| 161 | if (pipeline->fs_rmap) |
| 162 | intel_rmap_destroy(pipeline->fs_rmap); |
| 163 | |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 164 | intel_base_destroy(&pipeline->obj.base); |
| 165 | } |
| 166 | |
Chia-I Wu | e346767 | 2014-09-02 13:06:11 +0800 | [diff] [blame] | 167 | static void intel_pipe_shader_init(struct intel_shader *sh, |
| 168 | struct intel_pipe_shader *pipe_sh) |
Courtney Goeltzenleuchter | c4ef614 | 2014-08-29 16:25:30 -0600 | [diff] [blame] | 169 | { |
| 170 | pipe_sh->in_count = sh->in_count; |
| 171 | pipe_sh->out_count = sh->out_count; |
| 172 | pipe_sh->sampler_count = sh->sampler_count; |
| 173 | pipe_sh->surface_count = sh->surface_count; |
| 174 | pipe_sh->barycentric_interps = sh->barycentric_interps; |
| 175 | pipe_sh->urb_read_length = sh->urb_read_length; |
| 176 | pipe_sh->urb_grf_start = sh->urb_grf_start; |
| 177 | pipe_sh->uses = sh->uses; |
| 178 | } |
| 179 | |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 180 | static XGL_RESULT pipeline_shader(struct intel_pipeline *pipeline, |
| 181 | const XGL_PIPELINE_SHADER *info) |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 182 | { |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 183 | struct intel_shader *sh = intel_shader(info->shader); |
| 184 | void *kernel; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 185 | |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 186 | // TODO: process shader object and include in pipeline |
| 187 | // For now that processing is simply a copy so that the app |
| 188 | // can destroy the original shader object after pipeline creation. |
| 189 | kernel = icd_alloc(sh->ir->size, 0, XGL_SYSTEM_ALLOC_INTERNAL_SHADER); |
| 190 | if (!kernel) |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 191 | return XGL_ERROR_OUT_OF_MEMORY; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 192 | |
Courtney Goeltzenleuchter | c4ef614 | 2014-08-29 16:25:30 -0600 | [diff] [blame] | 193 | // TODO: This should be a compile step |
| 194 | memcpy(kernel, sh->ir->kernel, sh->ir->size); |
| 195 | |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 196 | switch (info->stage) { |
| 197 | case XGL_SHADER_STAGE_VERTEX: |
| 198 | /* |
| 199 | * TODO: What should we do here? |
| 200 | * shader_state (XGL_PIPELINE_SHADER) contains links |
| 201 | * to application memory in the pLinkConstBufferInfo and |
| 202 | * it's pBufferData pointers. Do we need to bring all that |
| 203 | * into the driver or is it okay to rely on those references |
| 204 | * holding good data. In OpenGL we'd make a driver copy. Not |
| 205 | * as clear for XGL. |
| 206 | * For now, use the app pointers. |
| 207 | */ |
| 208 | pipeline->vs = *info; |
Courtney Goeltzenleuchter | c4ef614 | 2014-08-29 16:25:30 -0600 | [diff] [blame] | 209 | |
| 210 | /* |
| 211 | * Grab what we need from the intel_shader object as that |
| 212 | * could go away after the pipeline is created. |
| 213 | */ |
Chia-I Wu | e346767 | 2014-09-02 13:06:11 +0800 | [diff] [blame] | 214 | intel_pipe_shader_init(sh, &pipeline->intel_vs); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 215 | pipeline->intel_vs.pCode = kernel; |
| 216 | pipeline->intel_vs.codeSize = sh->ir->size; |
| 217 | pipeline->active_shaders |= SHADER_VERTEX_FLAG; |
| 218 | pipeline->vs_rmap = intel_rmap_create(pipeline->dev, |
| 219 | &info->descriptorSetMapping[0], |
| 220 | &info->dynamicMemoryViewMapping, 0); |
| 221 | if (!pipeline->vs_rmap) { |
| 222 | icd_free(kernel); |
| 223 | return XGL_ERROR_OUT_OF_MEMORY; |
| 224 | } |
| 225 | break; |
| 226 | case XGL_SHADER_STAGE_GEOMETRY: |
Chia-I Wu | e346767 | 2014-09-02 13:06:11 +0800 | [diff] [blame] | 227 | intel_pipe_shader_init(sh, &pipeline->gs); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 228 | pipeline->gs.pCode = kernel; |
| 229 | pipeline->gs.codeSize = sh->ir->size; |
| 230 | pipeline->active_shaders |= SHADER_GEOMETRY_FLAG; |
| 231 | break; |
| 232 | case XGL_SHADER_STAGE_FRAGMENT: |
| 233 | pipeline->fs = *info; |
Chia-I Wu | e346767 | 2014-09-02 13:06:11 +0800 | [diff] [blame] | 234 | intel_pipe_shader_init(sh, &pipeline->intel_fs); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 235 | pipeline->intel_fs.pCode = kernel; |
| 236 | pipeline->intel_fs.codeSize = sh->ir->size; |
| 237 | pipeline->active_shaders |= SHADER_FRAGMENT_FLAG; |
| 238 | /* assuming one RT; need to parse the shader */ |
| 239 | pipeline->fs_rmap = intel_rmap_create(pipeline->dev, |
| 240 | &info->descriptorSetMapping[0], |
| 241 | &info->dynamicMemoryViewMapping, 1); |
| 242 | if (!pipeline->fs_rmap) { |
| 243 | icd_free(kernel); |
| 244 | return XGL_ERROR_OUT_OF_MEMORY; |
| 245 | } |
| 246 | break; |
| 247 | case XGL_SHADER_STAGE_TESS_CONTROL: |
Chia-I Wu | e346767 | 2014-09-02 13:06:11 +0800 | [diff] [blame] | 248 | intel_pipe_shader_init(sh, &pipeline->tess_control); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 249 | pipeline->tess_control.pCode = kernel; |
| 250 | pipeline->tess_control.codeSize = sh->ir->size; |
| 251 | pipeline->active_shaders |= SHADER_TESS_CONTROL_FLAG; |
| 252 | break; |
| 253 | case XGL_SHADER_STAGE_TESS_EVALUATION: |
Chia-I Wu | e346767 | 2014-09-02 13:06:11 +0800 | [diff] [blame] | 254 | intel_pipe_shader_init(sh, &pipeline->tess_eval); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 255 | pipeline->tess_eval.pCode = kernel; |
| 256 | pipeline->tess_eval.codeSize = sh->ir->size; |
| 257 | pipeline->active_shaders |= SHADER_TESS_EVAL_FLAG; |
| 258 | break; |
| 259 | case XGL_SHADER_STAGE_COMPUTE: |
Chia-I Wu | e346767 | 2014-09-02 13:06:11 +0800 | [diff] [blame] | 260 | intel_pipe_shader_init(sh, &pipeline->compute); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 261 | pipeline->compute.pCode = kernel; |
| 262 | pipeline->compute.codeSize = sh->ir->size; |
| 263 | pipeline->active_shaders |= SHADER_COMPUTE_FLAG; |
| 264 | break; |
| 265 | default: |
| 266 | assert(!"unknown shader stage"); |
| 267 | break; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 268 | } |
| 269 | |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 270 | return XGL_SUCCESS; |
| 271 | } |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 272 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 273 | static XGL_RESULT pipeline_validate(struct intel_pipeline *pipeline) |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 274 | { |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 275 | /* |
| 276 | * Validate required elements |
| 277 | */ |
| 278 | if (!(pipeline->active_shaders & SHADER_VERTEX_FLAG)) { |
| 279 | // TODO: Log debug message: Vertex Shader required. |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 280 | return XGL_ERROR_BAD_PIPELINE_DATA; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | /* |
| 284 | * Tessalation control and evaluation have to both have a shader defined or |
| 285 | * neither should have a shader defined. |
| 286 | */ |
| 287 | if (((pipeline->active_shaders & SHADER_TESS_CONTROL_FLAG) == 0) != |
| 288 | ((pipeline->active_shaders & SHADER_TESS_EVAL_FLAG) == 0) ) { |
| 289 | // TODO: Log debug message: Both Tess control and Tess eval are required to use tessalation |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 290 | return XGL_ERROR_BAD_PIPELINE_DATA; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | if ((pipeline->active_shaders & SHADER_COMPUTE_FLAG) && |
| 294 | (pipeline->active_shaders & (SHADER_VERTEX_FLAG | SHADER_TESS_CONTROL_FLAG | |
| 295 | SHADER_TESS_EVAL_FLAG | SHADER_GEOMETRY_FLAG | |
| 296 | SHADER_FRAGMENT_FLAG))) { |
| 297 | // TODO: Log debug message: Can only specify compute shader when doing compute |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 298 | return XGL_ERROR_BAD_PIPELINE_DATA; |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | /* |
Courtney Goeltzenleuchter | 4250999 | 2014-08-21 17:33:46 -0600 | [diff] [blame] | 302 | * XGL_TOPOLOGY_PATCH primitive topology is only valid for tessellation pipelines. |
| 303 | * Mismatching primitive topology and tessellation fails graphics pipeline creation. |
| 304 | */ |
| 305 | if (pipeline->active_shaders & (SHADER_TESS_CONTROL_FLAG | SHADER_TESS_EVAL_FLAG) && |
| 306 | (pipeline->ia_state.topology != XGL_TOPOLOGY_PATCH)) { |
| 307 | // TODO: Log debug message: Invalid topology used with tessalation shader. |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 308 | return XGL_ERROR_BAD_PIPELINE_DATA; |
Courtney Goeltzenleuchter | 4250999 | 2014-08-21 17:33:46 -0600 | [diff] [blame] | 309 | } |
| 310 | |
| 311 | if ((pipeline->ia_state.topology == XGL_TOPOLOGY_PATCH) && |
| 312 | (pipeline->active_shaders & ~(SHADER_TESS_CONTROL_FLAG | SHADER_TESS_EVAL_FLAG))) { |
| 313 | // TODO: Log debug message: Cannot use TOPOLOGY_PATCH on non-tessalation shader. |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 314 | return XGL_ERROR_BAD_PIPELINE_DATA; |
Courtney Goeltzenleuchter | 4250999 | 2014-08-21 17:33:46 -0600 | [diff] [blame] | 315 | } |
| 316 | |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 317 | return XGL_SUCCESS; |
| 318 | } |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 319 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 320 | static void pipeline_build_urb_alloc_gen6(struct intel_pipeline *pipeline, |
| 321 | const struct intel_pipeline_create_info *info) |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 322 | { |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 323 | const struct intel_gpu *gpu = pipeline->dev->gpu; |
| 324 | const int urb_size = ((gpu->gt == 2) ? 64 : 32) * 1024; |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 325 | const struct intel_shader *vs = intel_shader(info->vs.shader); |
| 326 | const struct intel_shader *gs = intel_shader(info->gs.shader); |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 327 | int vs_entry_size, gs_entry_size; |
| 328 | int vs_size, gs_size; |
| 329 | |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 330 | INTEL_GPU_ASSERT(gpu, 6, 6); |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 331 | |
| 332 | vs_entry_size = ((vs->in_count >= vs->out_count) ? |
| 333 | vs->in_count : vs->out_count); |
| 334 | gs_entry_size = (gs) ? gs->out_count : 0; |
| 335 | |
| 336 | /* in bytes */ |
| 337 | vs_entry_size *= sizeof(float) * 4; |
| 338 | gs_entry_size *= sizeof(float) * 4; |
| 339 | |
| 340 | if (gs) { |
| 341 | vs_size = urb_size / 2; |
| 342 | gs_size = vs_size; |
| 343 | } else { |
| 344 | vs_size = urb_size; |
| 345 | gs_size = 0; |
| 346 | } |
| 347 | |
| 348 | /* 3DSTATE_URB */ |
| 349 | { |
| 350 | const uint8_t cmd_len = 3; |
| 351 | const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_URB) | |
| 352 | (cmd_len - 2); |
| 353 | int vs_alloc_size, gs_alloc_size; |
| 354 | int vs_entry_count, gs_entry_count; |
| 355 | uint32_t *dw; |
| 356 | |
| 357 | /* in 1024-bit rows */ |
| 358 | vs_alloc_size = (vs_entry_size + 128 - 1) / 128; |
| 359 | gs_alloc_size = (gs_entry_size + 128 - 1) / 128; |
| 360 | |
| 361 | /* valid range is [1, 5] */ |
| 362 | if (!vs_alloc_size) |
| 363 | vs_alloc_size = 1; |
| 364 | if (!gs_alloc_size) |
| 365 | gs_alloc_size = 1; |
| 366 | assert(vs_alloc_size <= 5 && gs_alloc_size <= 5); |
| 367 | |
| 368 | /* valid range is [24, 256], multiples of 4 */ |
| 369 | vs_entry_count = (vs_size / 128 / vs_alloc_size) & ~3; |
| 370 | if (vs_entry_count > 256) |
| 371 | vs_entry_count = 256; |
| 372 | assert(vs_entry_count >= 24); |
| 373 | |
| 374 | /* valid range is [0, 256], multiples of 4 */ |
| 375 | gs_entry_count = (gs_size / 128 / gs_alloc_size) & ~3; |
| 376 | if (gs_entry_count > 256) |
| 377 | gs_entry_count = 256; |
| 378 | |
Courtney Goeltzenleuchter | 814cd29 | 2014-08-28 13:16:27 -0600 | [diff] [blame] | 379 | dw = pipeline_cmd_ptr(pipeline, cmd_len); |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 380 | |
| 381 | dw[0] = dw0; |
| 382 | dw[1] = (vs_alloc_size - 1) << GEN6_URB_DW1_VS_ENTRY_SIZE__SHIFT | |
| 383 | vs_entry_count << GEN6_URB_DW1_VS_ENTRY_COUNT__SHIFT; |
| 384 | dw[2] = gs_entry_count << GEN6_URB_DW2_GS_ENTRY_COUNT__SHIFT | |
| 385 | (gs_alloc_size - 1) << GEN6_URB_DW2_GS_ENTRY_SIZE__SHIFT; |
| 386 | } |
| 387 | } |
| 388 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 389 | static void pipeline_build_urb_alloc_gen7(struct intel_pipeline *pipeline, |
| 390 | const struct intel_pipeline_create_info *info) |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 391 | { |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 392 | const struct intel_gpu *gpu = pipeline->dev->gpu; |
| 393 | const int urb_size = ((gpu->gt == 3) ? 512 : |
| 394 | (gpu->gt == 2) ? 256 : 128) * 1024; |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 395 | const struct intel_shader *vs = intel_shader(info->vs.shader); |
| 396 | const struct intel_shader *gs = intel_shader(info->gs.shader); |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 397 | /* some space is reserved for PCBs */ |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 398 | int urb_offset = ((gpu->gt == 3) ? 32 : 16) * 1024; |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 399 | int vs_entry_size, gs_entry_size; |
| 400 | int vs_size, gs_size; |
| 401 | |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 402 | INTEL_GPU_ASSERT(gpu, 7, 7.5); |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 403 | |
| 404 | vs_entry_size = ((vs->in_count >= vs->out_count) ? |
| 405 | vs->in_count : vs->out_count); |
| 406 | gs_entry_size = (gs) ? gs->out_count : 0; |
| 407 | |
| 408 | /* in bytes */ |
| 409 | vs_entry_size *= sizeof(float) * 4; |
| 410 | gs_entry_size *= sizeof(float) * 4; |
| 411 | |
| 412 | if (gs) { |
| 413 | vs_size = (urb_size - urb_offset) / 2; |
| 414 | gs_size = vs_size; |
| 415 | } else { |
| 416 | vs_size = urb_size - urb_offset; |
| 417 | gs_size = 0; |
| 418 | } |
| 419 | |
| 420 | /* 3DSTATE_URB_* */ |
| 421 | { |
| 422 | const uint8_t cmd_len = 2; |
| 423 | int vs_alloc_size, gs_alloc_size; |
| 424 | int vs_entry_count, gs_entry_count; |
| 425 | uint32_t *dw; |
| 426 | |
| 427 | /* in 512-bit rows */ |
| 428 | vs_alloc_size = (vs_entry_size + 64 - 1) / 64; |
| 429 | gs_alloc_size = (gs_entry_size + 64 - 1) / 64; |
| 430 | |
| 431 | if (!vs_alloc_size) |
| 432 | vs_alloc_size = 1; |
| 433 | if (!gs_alloc_size) |
| 434 | gs_alloc_size = 1; |
| 435 | |
| 436 | /* avoid performance decrease due to banking */ |
| 437 | if (vs_alloc_size == 5) |
| 438 | vs_alloc_size = 6; |
| 439 | |
| 440 | /* in multiples of 8 */ |
| 441 | vs_entry_count = (vs_size / 64 / vs_alloc_size) & ~7; |
| 442 | assert(vs_entry_count >= 32); |
| 443 | |
| 444 | gs_entry_count = (gs_size / 64 / gs_alloc_size) & ~7; |
| 445 | |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 446 | if (intel_gpu_gen(gpu) >= INTEL_GEN(7.5)) { |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 447 | const int max_vs_entry_count = |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 448 | (gpu->gt >= 2) ? 1664 : 640; |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 449 | const int max_gs_entry_count = |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 450 | (gpu->gt >= 2) ? 640 : 256; |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 451 | if (vs_entry_count >= max_vs_entry_count) |
| 452 | vs_entry_count = max_vs_entry_count; |
| 453 | if (gs_entry_count >= max_gs_entry_count) |
| 454 | gs_entry_count = max_gs_entry_count; |
| 455 | } else { |
| 456 | const int max_vs_entry_count = |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 457 | (gpu->gt == 2) ? 704 : 512; |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 458 | const int max_gs_entry_count = |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 459 | (gpu->gt == 2) ? 320 : 192; |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 460 | if (vs_entry_count >= max_vs_entry_count) |
| 461 | vs_entry_count = max_vs_entry_count; |
| 462 | if (gs_entry_count >= max_gs_entry_count) |
| 463 | gs_entry_count = max_gs_entry_count; |
| 464 | } |
| 465 | |
Courtney Goeltzenleuchter | 814cd29 | 2014-08-28 13:16:27 -0600 | [diff] [blame] | 466 | dw = pipeline_cmd_ptr(pipeline, cmd_len*4); |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 467 | dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_URB_VS) | (cmd_len - 2); |
| 468 | dw[1] = (urb_offset / 8192) << GEN7_URB_ANY_DW1_OFFSET__SHIFT | |
| 469 | (vs_alloc_size - 1) << GEN7_URB_ANY_DW1_ENTRY_SIZE__SHIFT | |
| 470 | vs_entry_count; |
| 471 | |
| 472 | dw += 2; |
| 473 | if (gs_size) |
| 474 | urb_offset += vs_size; |
| 475 | dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_URB_GS) | (cmd_len - 2); |
| 476 | dw[1] = (urb_offset / 8192) << GEN7_URB_ANY_DW1_OFFSET__SHIFT | |
| 477 | (gs_alloc_size - 1) << GEN7_URB_ANY_DW1_ENTRY_SIZE__SHIFT | |
| 478 | gs_entry_count; |
| 479 | |
| 480 | dw += 2; |
| 481 | dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_URB_HS) | (cmd_len - 2); |
| 482 | dw[1] = (urb_offset / 8192) << GEN7_URB_ANY_DW1_OFFSET__SHIFT; |
| 483 | |
| 484 | dw += 2; |
| 485 | dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_URB_DS) | (cmd_len - 2); |
| 486 | dw[1] = (urb_offset / 8192) << GEN7_URB_ANY_DW1_OFFSET__SHIFT; |
| 487 | } |
| 488 | } |
| 489 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 490 | static void pipeline_build_push_const_alloc_gen7(struct intel_pipeline *pipeline, |
| 491 | const struct intel_pipeline_create_info *info) |
Courtney Goeltzenleuchter | b286770 | 2014-08-28 17:44:05 -0600 | [diff] [blame] | 492 | { |
| 493 | const uint8_t cmd_len = 2; |
| 494 | uint32_t offset = 0; |
| 495 | uint32_t size = 8192; |
| 496 | uint32_t *dw; |
| 497 | int end; |
| 498 | |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 499 | INTEL_GPU_ASSERT(pipeline->dev->gpu, 7, 7.5); |
Courtney Goeltzenleuchter | b286770 | 2014-08-28 17:44:05 -0600 | [diff] [blame] | 500 | |
| 501 | /* |
| 502 | * From the Ivy Bridge PRM, volume 2 part 1, page 68: |
| 503 | * |
| 504 | * "(A table that says the maximum size of each constant buffer is |
| 505 | * 16KB") |
| 506 | * |
| 507 | * From the Ivy Bridge PRM, volume 2 part 1, page 115: |
| 508 | * |
| 509 | * "The sum of the Constant Buffer Offset and the Constant Buffer Size |
| 510 | * may not exceed the maximum value of the Constant Buffer Size." |
| 511 | * |
| 512 | * Thus, the valid range of buffer end is [0KB, 16KB]. |
| 513 | */ |
| 514 | end = (offset + size) / 1024; |
| 515 | if (end > 16) { |
| 516 | assert(!"invalid constant buffer end"); |
| 517 | end = 16; |
| 518 | } |
| 519 | |
| 520 | /* the valid range of buffer offset is [0KB, 15KB] */ |
| 521 | offset = (offset + 1023) / 1024; |
| 522 | if (offset > 15) { |
| 523 | assert(!"invalid constant buffer offset"); |
| 524 | offset = 15; |
| 525 | } |
| 526 | |
| 527 | if (offset > end) { |
| 528 | assert(!size); |
| 529 | offset = end; |
| 530 | } |
| 531 | |
| 532 | /* the valid range of buffer size is [0KB, 15KB] */ |
| 533 | size = end - offset; |
| 534 | if (size > 15) { |
| 535 | assert(!"invalid constant buffer size"); |
| 536 | size = 15; |
| 537 | } |
| 538 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 539 | dw = pipeline_cmd_ptr(pipeline, cmd_len * 5); |
Courtney Goeltzenleuchter | b286770 | 2014-08-28 17:44:05 -0600 | [diff] [blame] | 540 | dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_PUSH_CONSTANT_ALLOC_VS) | (cmd_len - 2); |
| 541 | dw[1] = offset << GEN7_PCB_ALLOC_ANY_DW1_OFFSET__SHIFT | |
| 542 | size << GEN7_PCB_ALLOC_ANY_DW1_SIZE__SHIFT; |
| 543 | |
| 544 | dw += 2; |
| 545 | dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_PUSH_CONSTANT_ALLOC_PS) | (cmd_len - 2); |
| 546 | dw[1] = size << GEN7_PCB_ALLOC_ANY_DW1_OFFSET__SHIFT | |
| 547 | size << GEN7_PCB_ALLOC_ANY_DW1_SIZE__SHIFT; |
| 548 | |
| 549 | dw += 2; |
| 550 | dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_PUSH_CONSTANT_ALLOC_HS) | (cmd_len - 2); |
| 551 | dw[1] = 0 << GEN7_PCB_ALLOC_ANY_DW1_OFFSET__SHIFT | |
| 552 | 0 << GEN7_PCB_ALLOC_ANY_DW1_SIZE__SHIFT; |
| 553 | |
| 554 | dw += 2; |
| 555 | dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_PUSH_CONSTANT_ALLOC_DS) | (cmd_len - 2); |
| 556 | dw[1] = 0 << GEN7_PCB_ALLOC_ANY_DW1_OFFSET__SHIFT | |
| 557 | 0 << GEN7_PCB_ALLOC_ANY_DW1_SIZE__SHIFT; |
| 558 | |
| 559 | dw += 2; |
| 560 | dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_PUSH_CONSTANT_ALLOC_GS) | (cmd_len - 2); |
| 561 | dw[1] = 0 << GEN7_PCB_ALLOC_ANY_DW1_OFFSET__SHIFT | |
| 562 | 0 << GEN7_PCB_ALLOC_ANY_DW1_SIZE__SHIFT; |
Chia-I Wu | 8370b40 | 2014-08-29 12:28:37 +0800 | [diff] [blame] | 563 | |
Courtney Goeltzenleuchter | b286770 | 2014-08-28 17:44:05 -0600 | [diff] [blame] | 564 | // gen7_wa_pipe_control_cs_stall(p, true, true); |
| 565 | // looks equivalent to: gen6_wa_wm_multisample_flush - this does more |
| 566 | // than the documentation seems to imply |
| 567 | } |
| 568 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 569 | static void pipeline_build_vertex_elements(struct intel_pipeline *pipeline, |
| 570 | const struct intel_pipeline_create_info *info) |
Chia-I Wu | 4d9ad91 | 2014-08-29 14:20:36 +0800 | [diff] [blame] | 571 | { |
| 572 | const uint8_t cmd_len = 3; |
| 573 | const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_VERTEX_ELEMENTS) | |
| 574 | (cmd_len - 2); |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 575 | const struct intel_shader *vs = intel_shader(info->vs.shader); |
Chia-I Wu | 4d9ad91 | 2014-08-29 14:20:36 +0800 | [diff] [blame] | 576 | int comps[4] = { GEN6_VFCOMP_NOSTORE, GEN6_VFCOMP_NOSTORE, |
| 577 | GEN6_VFCOMP_NOSTORE, GEN6_VFCOMP_NOSTORE }; |
| 578 | uint32_t *dw; |
| 579 | |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 580 | INTEL_GPU_ASSERT(pipeline->dev->gpu, 6, 7.5); |
Chia-I Wu | 4d9ad91 | 2014-08-29 14:20:36 +0800 | [diff] [blame] | 581 | |
| 582 | if (!(vs->uses & (INTEL_SHADER_USE_VID | INTEL_SHADER_USE_IID))) |
| 583 | return; |
| 584 | |
| 585 | dw = pipeline_cmd_ptr(pipeline, cmd_len); |
| 586 | dw[0] = dw0; |
| 587 | dw++; |
| 588 | |
| 589 | comps[0] = (vs->uses & INTEL_SHADER_USE_VID) ? |
| 590 | GEN6_VFCOMP_STORE_VID : GEN6_VFCOMP_STORE_0; |
| 591 | if (vs->uses & INTEL_SHADER_USE_IID) |
| 592 | comps[1] = GEN6_VFCOMP_STORE_IID; |
| 593 | |
| 594 | /* VERTEX_ELEMENT_STATE */ |
| 595 | dw[0] = GEN6_VE_STATE_DW0_VALID; |
| 596 | dw[1] = comps[0] << GEN6_VE_STATE_DW1_COMP0__SHIFT | |
| 597 | comps[1] << GEN6_VE_STATE_DW1_COMP1__SHIFT | |
| 598 | comps[2] << GEN6_VE_STATE_DW1_COMP2__SHIFT | |
| 599 | comps[3] << GEN6_VE_STATE_DW1_COMP3__SHIFT; |
| 600 | } |
| 601 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 602 | static void pipeline_build_gs(struct intel_pipeline *pipeline, |
| 603 | const struct intel_pipeline_create_info *info) |
Courtney Goeltzenleuchter | b286770 | 2014-08-28 17:44:05 -0600 | [diff] [blame] | 604 | { |
Courtney Goeltzenleuchter | b286770 | 2014-08-28 17:44:05 -0600 | [diff] [blame] | 605 | // gen7_emit_3DSTATE_GS done by cmd_pipeline |
Courtney Goeltzenleuchter | b286770 | 2014-08-28 17:44:05 -0600 | [diff] [blame] | 606 | } |
| 607 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 608 | static void pipeline_build_hs(struct intel_pipeline *pipeline, |
| 609 | const struct intel_pipeline_create_info *info) |
Courtney Goeltzenleuchter | dee81a6 | 2014-08-28 18:05:24 -0600 | [diff] [blame] | 610 | { |
| 611 | const uint8_t cmd_len = 7; |
| 612 | const uint32_t dw0 = GEN7_RENDER_CMD(3D, 3DSTATE_HS) | (cmd_len - 2); |
| 613 | uint32_t *dw; |
| 614 | |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 615 | INTEL_GPU_ASSERT(pipeline->dev->gpu, 7, 7.5); |
Courtney Goeltzenleuchter | dee81a6 | 2014-08-28 18:05:24 -0600 | [diff] [blame] | 616 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 617 | dw = pipeline_cmd_ptr(pipeline, cmd_len); |
Courtney Goeltzenleuchter | dee81a6 | 2014-08-28 18:05:24 -0600 | [diff] [blame] | 618 | dw[0] = dw0; |
| 619 | dw[1] = 0; |
| 620 | dw[2] = 0; |
| 621 | dw[3] = 0; |
| 622 | dw[4] = 0; |
| 623 | dw[5] = 0; |
| 624 | dw[6] = 0; |
| 625 | } |
| 626 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 627 | static void pipeline_build_te(struct intel_pipeline *pipeline, |
| 628 | const struct intel_pipeline_create_info *info) |
Courtney Goeltzenleuchter | dee81a6 | 2014-08-28 18:05:24 -0600 | [diff] [blame] | 629 | { |
| 630 | const uint8_t cmd_len = 4; |
| 631 | const uint32_t dw0 = GEN7_RENDER_CMD(3D, 3DSTATE_TE) | (cmd_len - 2); |
| 632 | uint32_t *dw; |
| 633 | |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 634 | INTEL_GPU_ASSERT(pipeline->dev->gpu, 7, 7.5); |
Courtney Goeltzenleuchter | dee81a6 | 2014-08-28 18:05:24 -0600 | [diff] [blame] | 635 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 636 | dw = pipeline_cmd_ptr(pipeline, cmd_len); |
Courtney Goeltzenleuchter | dee81a6 | 2014-08-28 18:05:24 -0600 | [diff] [blame] | 637 | dw[0] = dw0; |
| 638 | dw[1] = 0; |
| 639 | dw[2] = 0; |
| 640 | dw[3] = 0; |
| 641 | } |
| 642 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 643 | static void pipeline_build_ds(struct intel_pipeline *pipeline, |
| 644 | const struct intel_pipeline_create_info *info) |
Courtney Goeltzenleuchter | dee81a6 | 2014-08-28 18:05:24 -0600 | [diff] [blame] | 645 | { |
| 646 | const uint8_t cmd_len = 6; |
| 647 | const uint32_t dw0 = GEN7_RENDER_CMD(3D, 3DSTATE_DS) | (cmd_len - 2); |
| 648 | uint32_t *dw; |
| 649 | |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 650 | INTEL_GPU_ASSERT(pipeline->dev->gpu, 7, 7.5); |
Courtney Goeltzenleuchter | dee81a6 | 2014-08-28 18:05:24 -0600 | [diff] [blame] | 651 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 652 | dw = pipeline_cmd_ptr(pipeline, cmd_len); |
Courtney Goeltzenleuchter | dee81a6 | 2014-08-28 18:05:24 -0600 | [diff] [blame] | 653 | dw[0] = dw0; |
| 654 | dw[1] = 0; |
| 655 | dw[2] = 0; |
| 656 | dw[3] = 0; |
| 657 | dw[4] = 0; |
| 658 | dw[5] = 0; |
| 659 | } |
| 660 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 661 | static XGL_RESULT pipeline_build_all(struct intel_pipeline *pipeline, |
| 662 | const struct intel_pipeline_create_info *info) |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 663 | { |
| 664 | XGL_RESULT ret; |
| 665 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 666 | pipeline_build_vertex_elements(pipeline, info); |
Chia-I Wu | 4d9ad91 | 2014-08-29 14:20:36 +0800 | [diff] [blame] | 667 | |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 668 | if (intel_gpu_gen(pipeline->dev->gpu) >= INTEL_GEN(7)) { |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 669 | pipeline_build_urb_alloc_gen7(pipeline, info); |
| 670 | pipeline_build_push_const_alloc_gen7(pipeline, info); |
| 671 | pipeline_build_gs(pipeline, info); |
| 672 | pipeline_build_hs(pipeline, info); |
| 673 | pipeline_build_te(pipeline, info); |
| 674 | pipeline_build_ds(pipeline, info); |
Chia-I Wu | 8370b40 | 2014-08-29 12:28:37 +0800 | [diff] [blame] | 675 | |
| 676 | pipeline->wa_flags = INTEL_CMD_WA_GEN6_PRE_DEPTH_STALL_WRITE | |
| 677 | INTEL_CMD_WA_GEN6_PRE_COMMAND_SCOREBOARD_STALL | |
| 678 | INTEL_CMD_WA_GEN7_PRE_VS_DEPTH_STALL_WRITE | |
| 679 | INTEL_CMD_WA_GEN7_POST_COMMAND_CS_STALL | |
| 680 | INTEL_CMD_WA_GEN7_POST_COMMAND_DEPTH_STALL; |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 681 | } else { |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 682 | pipeline_build_urb_alloc_gen6(pipeline, info); |
Chia-I Wu | 8370b40 | 2014-08-29 12:28:37 +0800 | [diff] [blame] | 683 | |
| 684 | pipeline->wa_flags = INTEL_CMD_WA_GEN6_PRE_DEPTH_STALL_WRITE | |
| 685 | INTEL_CMD_WA_GEN6_PRE_COMMAND_SCOREBOARD_STALL; |
Chia-I Wu | bb2d8ca | 2014-08-28 23:15:48 +0800 | [diff] [blame] | 686 | } |
| 687 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 688 | ret = pipeline_ia_state(pipeline, &info->ia); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 689 | |
| 690 | if (ret == XGL_SUCCESS) |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 691 | ret = pipeline_rs_state(pipeline, &info->rs); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 692 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 693 | if (ret == XGL_SUCCESS && info->vs.shader) |
| 694 | ret = pipeline_shader(pipeline, &info->vs); |
| 695 | if (ret == XGL_SUCCESS && info->tcs.shader) |
| 696 | ret = pipeline_shader(pipeline, &info->tcs); |
| 697 | if (ret == XGL_SUCCESS && info->tes.shader) |
| 698 | ret = pipeline_shader(pipeline, &info->tes); |
| 699 | if (ret == XGL_SUCCESS && info->gs.shader) |
| 700 | ret = pipeline_shader(pipeline, &info->gs); |
| 701 | if (ret == XGL_SUCCESS && info->fs.shader) |
| 702 | ret = pipeline_shader(pipeline, &info->fs); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 703 | |
| 704 | if (ret == XGL_SUCCESS) { |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 705 | pipeline->db_format = info->db.format; |
| 706 | pipeline->cb_state = info->cb; |
| 707 | pipeline->tess_state = info->tess; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 708 | } |
| 709 | |
| 710 | return ret; |
| 711 | } |
| 712 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 713 | struct intel_pipeline_create_info_header { |
| 714 | XGL_STRUCTURE_TYPE struct_type; |
| 715 | const struct intel_pipeline_create_info_header *next; |
| 716 | }; |
| 717 | |
| 718 | static XGL_RESULT pipeline_create_info_init(struct intel_pipeline_create_info *info, |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 719 | const struct intel_pipeline_create_info_header *header) |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 720 | { |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 721 | memset(info, 0, sizeof(*info)); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 722 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 723 | while (header) { |
| 724 | const void *src = (const void *) header; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 725 | XGL_SIZE size; |
| 726 | void *dst; |
| 727 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 728 | switch (header->struct_type) { |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 729 | case XGL_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 730 | size = sizeof(info->graphics); |
| 731 | dst = &info->graphics; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 732 | break; |
| 733 | case XGL_STRUCTURE_TYPE_PIPELINE_IA_STATE_CREATE_INFO: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 734 | size = sizeof(info->ia); |
| 735 | dst = &info->ia; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 736 | break; |
| 737 | case XGL_STRUCTURE_TYPE_PIPELINE_DB_STATE_CREATE_INFO: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 738 | size = sizeof(info->db); |
| 739 | dst = &info->db; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 740 | break; |
| 741 | case XGL_STRUCTURE_TYPE_PIPELINE_CB_STATE_CREATE_INFO: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 742 | size = sizeof(info->cb); |
| 743 | dst = &info->cb; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 744 | break; |
| 745 | case XGL_STRUCTURE_TYPE_PIPELINE_RS_STATE_CREATE_INFO: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 746 | size = sizeof(info->rs); |
| 747 | dst = &info->rs; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 748 | break; |
| 749 | case XGL_STRUCTURE_TYPE_PIPELINE_TESS_STATE_CREATE_INFO: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 750 | size = sizeof(info->tess); |
| 751 | dst = &info->tess; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 752 | break; |
| 753 | case XGL_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO: |
| 754 | { |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 755 | const XGL_PIPELINE_SHADER *shader = |
| 756 | (const XGL_PIPELINE_SHADER *) (header + 1); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 757 | |
| 758 | src = (const void *) shader; |
| 759 | size = sizeof(*shader); |
| 760 | |
| 761 | switch (shader->stage) { |
| 762 | case XGL_SHADER_STAGE_VERTEX: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 763 | dst = &info->vs; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 764 | break; |
| 765 | case XGL_SHADER_STAGE_TESS_CONTROL: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 766 | dst = &info->tcs; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 767 | break; |
| 768 | case XGL_SHADER_STAGE_TESS_EVALUATION: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 769 | dst = &info->tes; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 770 | break; |
| 771 | case XGL_SHADER_STAGE_GEOMETRY: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 772 | dst = &info->gs; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 773 | break; |
| 774 | case XGL_SHADER_STAGE_FRAGMENT: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 775 | dst = &info->fs; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 776 | break; |
| 777 | case XGL_SHADER_STAGE_COMPUTE: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 778 | dst = &info->cs; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 779 | break; |
| 780 | default: |
| 781 | return XGL_ERROR_BAD_PIPELINE_DATA; |
| 782 | break; |
| 783 | } |
| 784 | } |
| 785 | break; |
| 786 | case XGL_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO: |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 787 | size = sizeof(info->compute); |
| 788 | dst = &info->compute; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 789 | break; |
| 790 | default: |
| 791 | return XGL_ERROR_BAD_PIPELINE_DATA; |
| 792 | break; |
| 793 | } |
| 794 | |
| 795 | memcpy(dst, src, size); |
| 796 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 797 | header = header->next; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 798 | } |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 799 | |
| 800 | return XGL_SUCCESS; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 801 | } |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 802 | |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 803 | static XGL_RESULT graphics_pipeline_create(struct intel_dev *dev, |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 804 | const XGL_GRAPHICS_PIPELINE_CREATE_INFO *info_, |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 805 | struct intel_pipeline **pipeline_ret) |
| 806 | { |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 807 | struct intel_pipeline_create_info info; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 808 | struct intel_pipeline *pipeline; |
| 809 | XGL_RESULT ret; |
| 810 | |
Chia-I Wu | 509b3f2 | 2014-09-02 10:24:05 +0800 | [diff] [blame^] | 811 | ret = pipeline_create_info_init(&info, |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 812 | (const struct intel_pipeline_create_info_header *) info_); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 813 | if (ret != XGL_SUCCESS) |
| 814 | return ret; |
| 815 | |
| 816 | pipeline = (struct intel_pipeline *) |
| 817 | intel_base_create(dev, sizeof(*pipeline), dev->base.dbg, |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 818 | XGL_DBG_OBJECT_GRAPHICS_PIPELINE, info_, 0); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 819 | if (!pipeline) |
| 820 | return XGL_ERROR_OUT_OF_MEMORY; |
| 821 | |
| 822 | pipeline->dev = dev; |
| 823 | pipeline->obj.destroy = pipeline_destroy; |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 824 | |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 825 | ret = pipeline_build_all(pipeline, &info); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 826 | if (ret == XGL_SUCCESS) |
Chia-I Wu | f90ff0c | 2014-09-02 09:32:46 +0800 | [diff] [blame] | 827 | ret = pipeline_validate(pipeline); |
Chia-I Wu | 3efef43 | 2014-08-28 15:00:16 +0800 | [diff] [blame] | 828 | if (ret != XGL_SUCCESS) { |
| 829 | pipeline_destroy(&pipeline->obj); |
| 830 | return ret; |
| 831 | } |
| 832 | |
| 833 | *pipeline_ret = pipeline; |
| 834 | |
| 835 | return XGL_SUCCESS; |
| 836 | } |
| 837 | |
| 838 | XGL_RESULT XGLAPI intelCreateGraphicsPipeline( |
| 839 | XGL_DEVICE device, |
| 840 | const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, |
| 841 | XGL_PIPELINE* pPipeline) |
| 842 | { |
| 843 | struct intel_dev *dev = intel_dev(device); |
| 844 | |
| 845 | return graphics_pipeline_create(dev, pCreateInfo, |
| 846 | (struct intel_pipeline **) pPipeline); |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 847 | } |
| 848 | |
| 849 | XGL_RESULT XGLAPI intelCreateComputePipeline( |
| 850 | XGL_DEVICE device, |
| 851 | const XGL_COMPUTE_PIPELINE_CREATE_INFO* pCreateInfo, |
| 852 | XGL_PIPELINE* pPipeline) |
| 853 | { |
| 854 | return XGL_ERROR_UNAVAILABLE; |
| 855 | } |
| 856 | |
| 857 | XGL_RESULT XGLAPI intelStorePipeline( |
| 858 | XGL_PIPELINE pipeline, |
| 859 | XGL_SIZE* pDataSize, |
| 860 | XGL_VOID* pData) |
| 861 | { |
| 862 | return XGL_ERROR_UNAVAILABLE; |
| 863 | } |
| 864 | |
| 865 | XGL_RESULT XGLAPI intelLoadPipeline( |
| 866 | XGL_DEVICE device, |
| 867 | XGL_SIZE dataSize, |
| 868 | const XGL_VOID* pData, |
| 869 | XGL_PIPELINE* pPipeline) |
| 870 | { |
| 871 | return XGL_ERROR_UNAVAILABLE; |
| 872 | } |
| 873 | |
| 874 | XGL_RESULT XGLAPI intelCreatePipelineDelta( |
| 875 | XGL_DEVICE device, |
| 876 | XGL_PIPELINE p1, |
| 877 | XGL_PIPELINE p2, |
| 878 | XGL_PIPELINE_DELTA* delta) |
| 879 | { |
| 880 | return XGL_ERROR_UNAVAILABLE; |
| 881 | } |