blob: 42f8f362a59bb1173cc1bc342d34c2fece8b5619 [file] [log] [blame]
Chia-I Wub2755562014-08-20 13:38:52 +08001/*
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.
23 */
24
Chia-I Wu9f039862014-08-20 15:39:56 +080025#include "genhw/genhw.h"
Chia-I Wub2755562014-08-20 13:38:52 +080026#include "dset.h"
Chia-I Wu7fae4e32014-08-21 11:39:44 +080027#include "img.h"
Chia-I Wub2755562014-08-20 13:38:52 +080028#include "mem.h"
Chia-I Wu018a3962014-08-21 10:37:52 +080029#include "pipeline.h"
Chia-I Wub2755562014-08-20 13:38:52 +080030#include "state.h"
31#include "view.h"
32#include "cmd_priv.h"
33
Chia-I Wu59c097e2014-08-21 10:51:07 +080034static void gen6_3DPRIMITIVE(struct intel_cmd *cmd,
Chia-I Wu254db422014-08-21 11:54:29 +080035 int prim_type, bool indexed,
Chia-I Wu59c097e2014-08-21 10:51:07 +080036 uint32_t vertex_count,
37 uint32_t vertex_start,
38 uint32_t instance_count,
39 uint32_t instance_start,
40 uint32_t vertex_base)
41{
42 const uint8_t cmd_len = 6;
43 uint32_t dw0;
44
45 CMD_ASSERT(cmd, 6, 6);
46
Chia-I Wub0b9f692014-08-21 11:33:29 +080047 dw0 = GEN_RENDER_CMD(3D, GEN6, 3DPRIMITIVE) |
Chia-I Wu254db422014-08-21 11:54:29 +080048 prim_type << GEN6_3DPRIM_DW0_TYPE__SHIFT |
Chia-I Wu59c097e2014-08-21 10:51:07 +080049 (cmd_len - 2);
50
51 if (indexed)
52 dw0 |= GEN6_3DPRIM_DW0_ACCESS_RANDOM;
53
Chia-I Wue24c3292014-08-21 14:05:23 +080054 cmd_batch_reserve(cmd, cmd_len);
55 cmd_batch_write(cmd, dw0);
56 cmd_batch_write(cmd, vertex_count);
57 cmd_batch_write(cmd, vertex_start);
58 cmd_batch_write(cmd, instance_count);
59 cmd_batch_write(cmd, instance_start);
60 cmd_batch_write(cmd, vertex_base);
Chia-I Wu59c097e2014-08-21 10:51:07 +080061}
62
63static void gen7_3DPRIMITIVE(struct intel_cmd *cmd,
Chia-I Wu254db422014-08-21 11:54:29 +080064 int prim_type, bool indexed,
Chia-I Wu59c097e2014-08-21 10:51:07 +080065 uint32_t vertex_count,
66 uint32_t vertex_start,
67 uint32_t instance_count,
68 uint32_t instance_start,
69 uint32_t vertex_base)
70{
71 const uint8_t cmd_len = 7;
72 uint32_t dw0, dw1;
73
74 CMD_ASSERT(cmd, 7, 7.5);
75
Chia-I Wub0b9f692014-08-21 11:33:29 +080076 dw0 = GEN_RENDER_CMD(3D, GEN6, 3DPRIMITIVE) | (cmd_len - 2);
Chia-I Wu254db422014-08-21 11:54:29 +080077 dw1 = prim_type << GEN7_3DPRIM_DW1_TYPE__SHIFT;
Chia-I Wu59c097e2014-08-21 10:51:07 +080078
79 if (indexed)
80 dw1 |= GEN7_3DPRIM_DW1_ACCESS_RANDOM;
81
Chia-I Wue24c3292014-08-21 14:05:23 +080082 cmd_batch_reserve(cmd, cmd_len);
83 cmd_batch_write(cmd, dw0);
84 cmd_batch_write(cmd, dw1);
85 cmd_batch_write(cmd, vertex_count);
86 cmd_batch_write(cmd, vertex_start);
87 cmd_batch_write(cmd, instance_count);
88 cmd_batch_write(cmd, instance_start);
89 cmd_batch_write(cmd, vertex_base);
Chia-I Wu59c097e2014-08-21 10:51:07 +080090}
91
Chia-I Wu254db422014-08-21 11:54:29 +080092static bool gen6_can_primitive_restart(const struct intel_cmd *cmd)
93{
94 const struct intel_pipeline *p = cmd->bind.pipeline.graphics;
95 bool supported;
96
97 CMD_ASSERT(cmd, 6, 7.5);
98
99 if (cmd_gen(cmd) >= INTEL_GEN(7.5))
100 return (p->prim_type != GEN6_3DPRIM_RECTLIST);
101
102 switch (p->prim_type) {
103 case GEN6_3DPRIM_POINTLIST:
104 case GEN6_3DPRIM_LINELIST:
105 case GEN6_3DPRIM_LINESTRIP:
106 case GEN6_3DPRIM_TRILIST:
107 case GEN6_3DPRIM_TRISTRIP:
108 supported = true;
109 break;
110 default:
111 supported = false;
112 break;
113 }
114
115 if (!supported)
116 return false;
117
118 switch (cmd->bind.index.type) {
119 case XGL_INDEX_8:
120 supported = (p->primitive_restart_index != 0xffu);
121 break;
122 case XGL_INDEX_16:
123 supported = (p->primitive_restart_index != 0xffffu);
124 break;
125 case XGL_INDEX_32:
126 supported = (p->primitive_restart_index != 0xffffffffu);
127 break;
128 default:
129 supported = false;
130 break;
131 }
132
133 return supported;
134}
135
Chia-I Wu59c097e2014-08-21 10:51:07 +0800136static void gen6_3DSTATE_INDEX_BUFFER(struct intel_cmd *cmd,
Chia-I Wu958d1b72014-08-21 11:28:11 +0800137 const struct intel_mem *mem,
Chia-I Wu59c097e2014-08-21 10:51:07 +0800138 XGL_GPU_SIZE offset,
139 XGL_INDEX_TYPE type,
140 bool enable_cut_index)
141{
142 const uint8_t cmd_len = 3;
143 uint32_t dw0, end_offset;
144 unsigned offset_align;
145
146 CMD_ASSERT(cmd, 6, 7.5);
147
Chia-I Wub0b9f692014-08-21 11:33:29 +0800148 dw0 = GEN_RENDER_CMD(3D, GEN6, 3DSTATE_INDEX_BUFFER) | (cmd_len - 2);
Chia-I Wu59c097e2014-08-21 10:51:07 +0800149
150 /* the bit is moved to 3DSTATE_VF */
151 if (cmd_gen(cmd) >= INTEL_GEN(7.5))
152 assert(!enable_cut_index);
153 if (enable_cut_index)
154 dw0 |= GEN6_IB_DW0_CUT_INDEX_ENABLE;
155
156 switch (type) {
157 case XGL_INDEX_8:
158 dw0 |= GEN6_IB_DW0_FORMAT_BYTE;
159 offset_align = 1;
160 break;
161 case XGL_INDEX_16:
162 dw0 |= GEN6_IB_DW0_FORMAT_WORD;
163 offset_align = 2;
164 break;
165 case XGL_INDEX_32:
166 dw0 |= GEN6_IB_DW0_FORMAT_DWORD;
167 offset_align = 4;
168 break;
169 default:
170 cmd->result = XGL_ERROR_INVALID_VALUE;
171 return;
172 break;
173 }
174
175 if (offset % offset_align) {
176 cmd->result = XGL_ERROR_INVALID_VALUE;
177 return;
178 }
179
180 /* aligned and inclusive */
181 end_offset = mem->size - (mem->size % offset_align) - 1;
182
Chia-I Wue24c3292014-08-21 14:05:23 +0800183 cmd_batch_reserve(cmd, cmd_len);
184 cmd_batch_write(cmd, dw0);
185 cmd_batch_reloc(cmd, offset, mem, INTEL_DOMAIN_VERTEX, 0);
186 cmd_batch_reloc(cmd, end_offset, mem, INTEL_DOMAIN_VERTEX, 0);
Chia-I Wu59c097e2014-08-21 10:51:07 +0800187}
188
Chia-I Wu254db422014-08-21 11:54:29 +0800189static inline void
190gen75_3DSTATE_VF(struct intel_cmd *cmd,
191 bool enable_cut_index,
192 uint32_t cut_index)
193{
194 const uint8_t cmd_len = 2;
195 uint32_t dw0;
196
197 CMD_ASSERT(cmd, 7.5, 7.5);
198
199 dw0 = GEN_RENDER_CMD(3D, GEN75, 3DSTATE_VF) | (cmd_len - 2);
200 if (enable_cut_index)
201 dw0 |= GEN75_VF_DW0_CUT_INDEX_ENABLE;
202
Chia-I Wue24c3292014-08-21 14:05:23 +0800203 cmd_batch_reserve(cmd, cmd_len);
204 cmd_batch_write(cmd, dw0);
205 cmd_batch_write(cmd, cut_index);
Chia-I Wu254db422014-08-21 11:54:29 +0800206}
207
Chia-I Wu7fae4e32014-08-21 11:39:44 +0800208static void gen6_3DSTATE_DEPTH_BUFFER(struct intel_cmd *cmd,
209 const struct intel_ds_view *view)
210{
211 const uint8_t cmd_len = 7;
212 uint32_t dw0;
213
214 CMD_ASSERT(cmd, 6, 7.5);
215
216 dw0 = (cmd_gen(cmd) >= INTEL_GEN(7)) ?
217 GEN_RENDER_CMD(3D, GEN7, 3DSTATE_DEPTH_BUFFER) :
218 GEN_RENDER_CMD(3D, GEN6, 3DSTATE_DEPTH_BUFFER);
219 dw0 |= (cmd_len - 2);
220
Chia-I Wue24c3292014-08-21 14:05:23 +0800221 cmd_batch_reserve(cmd, cmd_len);
222 cmd_batch_write(cmd, dw0);
223 cmd_batch_write(cmd, view->cmd[0]);
224 cmd_batch_reloc(cmd, view->cmd[1], view->img->obj.mem,
225 INTEL_DOMAIN_RENDER,
226 INTEL_DOMAIN_RENDER);
227 cmd_batch_write(cmd, view->cmd[2]);
228 cmd_batch_write(cmd, view->cmd[3]);
229 cmd_batch_write(cmd, view->cmd[4]);
230 cmd_batch_write(cmd, view->cmd[5]);
Chia-I Wu7fae4e32014-08-21 11:39:44 +0800231}
232
233static void gen6_3DSTATE_STENCIL_BUFFER(struct intel_cmd *cmd,
234 const struct intel_ds_view *view)
235{
236 const uint8_t cmd_len = 3;
237 uint32_t dw0;
238
239 CMD_ASSERT(cmd, 6, 7.5);
240
241 dw0 = (cmd_gen(cmd) >= INTEL_GEN(7)) ?
242 GEN_RENDER_CMD(3D, GEN7, 3DSTATE_STENCIL_BUFFER) :
243 GEN_RENDER_CMD(3D, GEN6, 3DSTATE_STENCIL_BUFFER);
244 dw0 |= (cmd_len - 2);
245
Chia-I Wue24c3292014-08-21 14:05:23 +0800246 cmd_batch_reserve(cmd, cmd_len);
247 cmd_batch_write(cmd, dw0);
248 cmd_batch_write(cmd, view->cmd[6]);
249 cmd_batch_reloc(cmd, view->cmd[7], view->img->obj.mem,
250 INTEL_DOMAIN_RENDER,
251 INTEL_DOMAIN_RENDER);
Chia-I Wu7fae4e32014-08-21 11:39:44 +0800252}
253
254static void gen6_3DSTATE_HIER_DEPTH_BUFFER(struct intel_cmd *cmd,
255 const struct intel_ds_view *view)
256{
257 const uint8_t cmd_len = 3;
258 uint32_t dw0;
259
260 CMD_ASSERT(cmd, 6, 7.5);
261
262 dw0 = (cmd_gen(cmd) >= INTEL_GEN(7)) ?
263 GEN_RENDER_CMD(3D, GEN7, 3DSTATE_HIER_DEPTH_BUFFER) :
264 GEN_RENDER_CMD(3D, GEN6, 3DSTATE_HIER_DEPTH_BUFFER);
265 dw0 |= (cmd_len - 2);
266
Chia-I Wue24c3292014-08-21 14:05:23 +0800267 cmd_batch_reserve(cmd, cmd_len);
268 cmd_batch_write(cmd, dw0);
269 cmd_batch_write(cmd, view->cmd[8]);
270 cmd_batch_reloc(cmd, view->cmd[9], view->img->obj.mem,
271 INTEL_DOMAIN_RENDER,
272 INTEL_DOMAIN_RENDER);
Chia-I Wu7fae4e32014-08-21 11:39:44 +0800273}
274
Chia-I Wub2755562014-08-20 13:38:52 +0800275XGL_VOID XGLAPI intelCmdBindPipeline(
276 XGL_CMD_BUFFER cmdBuffer,
277 XGL_PIPELINE_BIND_POINT pipelineBindPoint,
278 XGL_PIPELINE pipeline)
279{
280 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
281
282 switch (pipelineBindPoint) {
283 case XGL_PIPELINE_BIND_POINT_COMPUTE:
Chia-I Wu018a3962014-08-21 10:37:52 +0800284 cmd->bind.pipeline.compute = intel_pipeline(pipeline);
Chia-I Wub2755562014-08-20 13:38:52 +0800285 break;
286 case XGL_PIPELINE_BIND_POINT_GRAPHICS:
Chia-I Wu018a3962014-08-21 10:37:52 +0800287 cmd->bind.pipeline.graphics = intel_pipeline(pipeline);
Chia-I Wub2755562014-08-20 13:38:52 +0800288 break;
289 default:
290 break;
291 }
292}
293
294XGL_VOID XGLAPI intelCmdBindPipelineDelta(
295 XGL_CMD_BUFFER cmdBuffer,
296 XGL_PIPELINE_BIND_POINT pipelineBindPoint,
297 XGL_PIPELINE_DELTA delta)
298{
299 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
300
301 switch (pipelineBindPoint) {
302 case XGL_PIPELINE_BIND_POINT_COMPUTE:
303 cmd->bind.pipeline.compute_delta = delta;
304 break;
305 case XGL_PIPELINE_BIND_POINT_GRAPHICS:
306 cmd->bind.pipeline.graphics_delta = delta;
307 break;
308 default:
309 break;
310 }
311}
312
313XGL_VOID XGLAPI intelCmdBindStateObject(
314 XGL_CMD_BUFFER cmdBuffer,
315 XGL_STATE_BIND_POINT stateBindPoint,
316 XGL_STATE_OBJECT state)
317{
318 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
319
320 switch (stateBindPoint) {
321 case XGL_STATE_BIND_VIEWPORT:
322 cmd->bind.state.viewport =
323 intel_viewport_state((XGL_VIEWPORT_STATE_OBJECT) state);
324 break;
325 case XGL_STATE_BIND_RASTER:
326 cmd->bind.state.raster =
327 intel_raster_state((XGL_RASTER_STATE_OBJECT) state);
328 break;
329 case XGL_STATE_BIND_DEPTH_STENCIL:
330 cmd->bind.state.ds =
331 intel_ds_state((XGL_DEPTH_STENCIL_STATE_OBJECT) state);
332 break;
333 case XGL_STATE_BIND_COLOR_BLEND:
334 cmd->bind.state.blend =
335 intel_blend_state((XGL_COLOR_BLEND_STATE_OBJECT) state);
336 break;
337 case XGL_STATE_BIND_MSAA:
338 cmd->bind.state.msaa =
339 intel_msaa_state((XGL_MSAA_STATE_OBJECT) state);
340 break;
341 default:
342 break;
343 }
344}
345
346XGL_VOID XGLAPI intelCmdBindDescriptorSet(
347 XGL_CMD_BUFFER cmdBuffer,
348 XGL_PIPELINE_BIND_POINT pipelineBindPoint,
349 XGL_UINT index,
350 XGL_DESCRIPTOR_SET descriptorSet,
351 XGL_UINT slotOffset)
352{
353 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
354 struct intel_dset *dset = intel_dset(descriptorSet);
355
356 assert(!index);
357
358 switch (pipelineBindPoint) {
359 case XGL_PIPELINE_BIND_POINT_COMPUTE:
360 cmd->bind.dset.compute = dset;
361 cmd->bind.dset.compute_offset = slotOffset;
362 break;
363 case XGL_PIPELINE_BIND_POINT_GRAPHICS:
364 cmd->bind.dset.graphics = dset;
365 cmd->bind.dset.graphics_offset = slotOffset;
366 break;
367 default:
368 break;
369 }
370}
371
372XGL_VOID XGLAPI intelCmdBindDynamicMemoryView(
373 XGL_CMD_BUFFER cmdBuffer,
374 XGL_PIPELINE_BIND_POINT pipelineBindPoint,
375 const XGL_MEMORY_VIEW_ATTACH_INFO* pMemView)
376{
377 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
378
379 switch (pipelineBindPoint) {
380 case XGL_PIPELINE_BIND_POINT_COMPUTE:
381 intel_mem_view_init(&cmd->bind.mem_view.compute, cmd->dev, pMemView);
382 break;
383 case XGL_PIPELINE_BIND_POINT_GRAPHICS:
384 intel_mem_view_init(&cmd->bind.mem_view.graphics, cmd->dev, pMemView);
385 break;
386 default:
387 break;
388 }
389}
390
391XGL_VOID XGLAPI intelCmdBindIndexData(
392 XGL_CMD_BUFFER cmdBuffer,
393 XGL_GPU_MEMORY mem_,
394 XGL_GPU_SIZE offset,
395 XGL_INDEX_TYPE indexType)
396{
397 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
398 struct intel_mem *mem = intel_mem(mem_);
399
Chia-I Wu9f039862014-08-20 15:39:56 +0800400 if (cmd_gen(cmd) >= INTEL_GEN(7.5)) {
401 gen6_3DSTATE_INDEX_BUFFER(cmd, mem, offset, indexType, false);
402 } else {
403 cmd->bind.index.mem = mem;
404 cmd->bind.index.offset = offset;
405 cmd->bind.index.type = indexType;
406 }
Chia-I Wub2755562014-08-20 13:38:52 +0800407}
408
409XGL_VOID XGLAPI intelCmdBindAttachments(
410 XGL_CMD_BUFFER cmdBuffer,
411 XGL_UINT colorAttachmentCount,
412 const XGL_COLOR_ATTACHMENT_BIND_INFO* pColorAttachments,
413 const XGL_DEPTH_STENCIL_BIND_INFO* pDepthStencilAttachment)
414{
415 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
Chia-I Wu7fae4e32014-08-21 11:39:44 +0800416 const struct intel_ds_view *ds;
Chia-I Wub2755562014-08-20 13:38:52 +0800417 XGL_UINT i;
418
419 for (i = 0; i < colorAttachmentCount; i++) {
420 const XGL_COLOR_ATTACHMENT_BIND_INFO *att = &pColorAttachments[i];
421 struct intel_rt_view *rt = intel_rt_view(att->view);
422
423 cmd->bind.att.rt[i] = rt;
424 }
425
426 cmd->bind.att.rt_count = colorAttachmentCount;
427
428 if (pDepthStencilAttachment) {
Chia-I Wu7fae4e32014-08-21 11:39:44 +0800429 cmd->bind.att.ds = intel_ds_view(pDepthStencilAttachment->view);
430 ds = cmd->bind.att.ds;
431
Chia-I Wub2755562014-08-20 13:38:52 +0800432 } else {
Chia-I Wu7fae4e32014-08-21 11:39:44 +0800433 /* all zeros */
434 static const struct intel_ds_view null_ds;
435 ds = &null_ds;
Chia-I Wub2755562014-08-20 13:38:52 +0800436 }
Chia-I Wu7fae4e32014-08-21 11:39:44 +0800437
Chia-I Wu254db422014-08-21 11:54:29 +0800438 /* TODO workarounds */
Chia-I Wu7fae4e32014-08-21 11:39:44 +0800439 gen6_3DSTATE_DEPTH_BUFFER(cmd, ds);
440 gen6_3DSTATE_STENCIL_BUFFER(cmd, ds);
441 gen6_3DSTATE_HIER_DEPTH_BUFFER(cmd, ds);
Chia-I Wub2755562014-08-20 13:38:52 +0800442}
443
444XGL_VOID XGLAPI intelCmdDraw(
445 XGL_CMD_BUFFER cmdBuffer,
446 XGL_UINT firstVertex,
447 XGL_UINT vertexCount,
448 XGL_UINT firstInstance,
449 XGL_UINT instanceCount)
450{
Chia-I Wu59c097e2014-08-21 10:51:07 +0800451 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
Chia-I Wu254db422014-08-21 11:54:29 +0800452 const struct intel_pipeline *p = cmd->bind.pipeline.graphics;
Chia-I Wu59c097e2014-08-21 10:51:07 +0800453
454 /* TODO emit bounded states */
Chia-I Wu59c097e2014-08-21 10:51:07 +0800455
456 if (cmd_gen(cmd) >= INTEL_GEN(7)) {
Chia-I Wu254db422014-08-21 11:54:29 +0800457 gen7_3DPRIMITIVE(cmd, p->prim_type, false, vertexCount,
458 firstVertex, instanceCount, firstInstance, 0);
Chia-I Wu59c097e2014-08-21 10:51:07 +0800459 } else {
Chia-I Wu254db422014-08-21 11:54:29 +0800460 gen6_3DPRIMITIVE(cmd, p->prim_type, false, vertexCount,
461 firstVertex, instanceCount, firstInstance, 0);
Chia-I Wu59c097e2014-08-21 10:51:07 +0800462 }
Chia-I Wub2755562014-08-20 13:38:52 +0800463}
464
465XGL_VOID XGLAPI intelCmdDrawIndexed(
466 XGL_CMD_BUFFER cmdBuffer,
467 XGL_UINT firstIndex,
468 XGL_UINT indexCount,
469 XGL_INT vertexOffset,
470 XGL_UINT firstInstance,
471 XGL_UINT instanceCount)
472{
Chia-I Wu59c097e2014-08-21 10:51:07 +0800473 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
Chia-I Wu254db422014-08-21 11:54:29 +0800474 const struct intel_pipeline *p = cmd->bind.pipeline.graphics;
Chia-I Wu59c097e2014-08-21 10:51:07 +0800475
476 /* TODO emit bounded states */
Chia-I Wu254db422014-08-21 11:54:29 +0800477
478 if (p->primitive_restart && !gen6_can_primitive_restart(cmd))
479 cmd->result = XGL_ERROR_UNKNOWN;
480
481 if (cmd_gen(cmd) >= INTEL_GEN(7.5)) {
482 gen75_3DSTATE_VF(cmd, p->primitive_restart,
483 p->primitive_restart_index);
484 } else {
485 gen6_3DSTATE_INDEX_BUFFER(cmd, cmd->bind.index.mem,
486 cmd->bind.index.offset, cmd->bind.index.type,
487 p->primitive_restart);
488 }
Chia-I Wu59c097e2014-08-21 10:51:07 +0800489
490 if (cmd_gen(cmd) >= INTEL_GEN(7)) {
Chia-I Wu254db422014-08-21 11:54:29 +0800491 gen7_3DPRIMITIVE(cmd, p->prim_type, true, indexCount,
492 firstIndex, instanceCount, firstInstance, 0);
Chia-I Wu59c097e2014-08-21 10:51:07 +0800493 } else {
Chia-I Wu254db422014-08-21 11:54:29 +0800494 gen6_3DPRIMITIVE(cmd, p->prim_type, true, indexCount,
495 firstIndex, instanceCount, firstInstance, 0);
Chia-I Wu59c097e2014-08-21 10:51:07 +0800496 }
Chia-I Wub2755562014-08-20 13:38:52 +0800497}
498
499XGL_VOID XGLAPI intelCmdDrawIndirect(
500 XGL_CMD_BUFFER cmdBuffer,
501 XGL_GPU_MEMORY mem,
502 XGL_GPU_SIZE offset,
503 XGL_UINT32 count,
504 XGL_UINT32 stride)
505{
Chia-I Wu59c097e2014-08-21 10:51:07 +0800506 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
507
508 cmd->result = XGL_ERROR_UNKNOWN;
Chia-I Wub2755562014-08-20 13:38:52 +0800509}
510
511XGL_VOID XGLAPI intelCmdDrawIndexedIndirect(
512 XGL_CMD_BUFFER cmdBuffer,
513 XGL_GPU_MEMORY mem,
514 XGL_GPU_SIZE offset,
515 XGL_UINT32 count,
516 XGL_UINT32 stride)
517{
Chia-I Wu59c097e2014-08-21 10:51:07 +0800518 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
519
520 cmd->result = XGL_ERROR_UNKNOWN;
Chia-I Wub2755562014-08-20 13:38:52 +0800521}
522
523XGL_VOID XGLAPI intelCmdDispatch(
524 XGL_CMD_BUFFER cmdBuffer,
525 XGL_UINT x,
526 XGL_UINT y,
527 XGL_UINT z)
528{
Chia-I Wu59c097e2014-08-21 10:51:07 +0800529 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
530
531 cmd->result = XGL_ERROR_UNKNOWN;
Chia-I Wub2755562014-08-20 13:38:52 +0800532}
533
534XGL_VOID XGLAPI intelCmdDispatchIndirect(
535 XGL_CMD_BUFFER cmdBuffer,
536 XGL_GPU_MEMORY mem,
537 XGL_GPU_SIZE offset)
538{
Chia-I Wu59c097e2014-08-21 10:51:07 +0800539 struct intel_cmd *cmd = intel_cmd(cmdBuffer);
540
541 cmd->result = XGL_ERROR_UNKNOWN;
Chia-I Wub2755562014-08-20 13:38:52 +0800542}