Chia-I Wu | 0914213 | 2014-08-11 15:42:55 +0800 | [diff] [blame] | 1 | /* |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2 | * Vulkan |
Chia-I Wu | 0914213 | 2014-08-11 15:42:55 +0800 | [diff] [blame] | 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 | * Chia-I Wu <olv@lunarg.com> |
| 26 | * Courtney Goeltzenleuchter <courtney@lunarg.com> |
Chia-I Wu | 0914213 | 2014-08-11 15:42:55 +0800 | [diff] [blame] | 27 | */ |
| 28 | |
| 29 | #ifndef CMD_H |
| 30 | #define CMD_H |
| 31 | |
| 32 | #include "intel.h" |
| 33 | #include "obj.h" |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 34 | #include "view.h" |
Courtney Goeltzenleuchter | 09772bb | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 35 | #include "state.h" |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 36 | |
| 37 | struct intel_pipeline; |
Chia-I Wu | f2b6d72 | 2014-09-02 08:52:27 +0800 | [diff] [blame] | 38 | struct intel_pipeline_shader; |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 39 | struct intel_viewport_state; |
| 40 | struct intel_raster_state; |
| 41 | struct intel_msaa_state; |
| 42 | struct intel_blend_state; |
| 43 | struct intel_ds_state; |
Chia-I Wu | f838506 | 2015-01-04 16:27:24 +0800 | [diff] [blame] | 44 | struct intel_desc_set; |
Chia-I Wu | c6025ac | 2015-02-18 14:59:11 -0700 | [diff] [blame] | 45 | struct intel_render_pass; |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 46 | |
Chia-I Wu | 00b51a8 | 2014-09-09 12:07:37 +0800 | [diff] [blame] | 47 | struct intel_cmd_item; |
Chia-I Wu | 958d1b7 | 2014-08-21 11:28:11 +0800 | [diff] [blame] | 48 | struct intel_cmd_reloc; |
Chia-I Wu | 6032b89 | 2014-10-17 14:47:18 +0800 | [diff] [blame] | 49 | struct intel_cmd_meta; |
Chia-I Wu | 958d1b7 | 2014-08-21 11:28:11 +0800 | [diff] [blame] | 50 | |
Chia-I Wu | 8370b40 | 2014-08-29 12:28:37 +0800 | [diff] [blame] | 51 | /* |
| 52 | * We know what workarounds are needed for intel_pipeline. These are mostly |
Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 53 | * for pipeline derivatives. |
Chia-I Wu | 8370b40 | 2014-08-29 12:28:37 +0800 | [diff] [blame] | 54 | */ |
| 55 | enum intel_cmd_wa_flags { |
| 56 | /* |
| 57 | * From the Sandy Bridge PRM, volume 2 part 1, page 60: |
| 58 | * |
| 59 | * "Before any depth stall flush (including those produced by |
| 60 | * non-pipelined state commands), software needs to first send a |
| 61 | * PIPE_CONTROL with no bits set except Post-Sync Operation != 0." |
| 62 | */ |
| 63 | INTEL_CMD_WA_GEN6_PRE_DEPTH_STALL_WRITE = 1 << 0, |
| 64 | |
| 65 | /* |
| 66 | * From the Sandy Bridge PRM, volume 2 part 1, page 274: |
| 67 | * |
| 68 | * "A PIPE_CONTROL command, with only the Stall At Pixel Scoreboard |
| 69 | * field set (DW1 Bit 1), must be issued prior to any change to the |
| 70 | * value in this field (Maximum Number of Threads in 3DSTATE_WM)" |
| 71 | * |
| 72 | * From the Ivy Bridge PRM, volume 2 part 1, page 286: |
| 73 | * |
| 74 | * "If this field (Maximum Number of Threads in 3DSTATE_PS) is changed |
| 75 | * between 3DPRIMITIVE commands, a PIPE_CONTROL command with Stall at |
| 76 | * Pixel Scoreboard set is required to be issued." |
| 77 | */ |
| 78 | INTEL_CMD_WA_GEN6_PRE_COMMAND_SCOREBOARD_STALL = 1 << 1, |
| 79 | |
| 80 | /* |
| 81 | * From the Ivy Bridge PRM, volume 2 part 1, page 106: |
| 82 | * |
| 83 | * "A PIPE_CONTROL with Post-Sync Operation set to 1h and a depth |
| 84 | * stall needs to be sent just prior to any 3DSTATE_VS, |
| 85 | * 3DSTATE_URB_VS, 3DSTATE_CONSTANT_VS, |
| 86 | * 3DSTATE_BINDING_TABLE_POINTER_VS, 3DSTATE_SAMPLER_STATE_POINTER_VS |
| 87 | * command. Only one PIPE_CONTROL needs to be sent before any |
| 88 | * combination of VS associated 3DSTATE." |
| 89 | */ |
| 90 | INTEL_CMD_WA_GEN7_PRE_VS_DEPTH_STALL_WRITE = 1 << 2, |
| 91 | |
| 92 | /* |
| 93 | * From the Ivy Bridge PRM, volume 2 part 1, page 258: |
| 94 | * |
| 95 | * "Due to an HW issue driver needs to send a pipe control with stall |
| 96 | * when ever there is state change in depth bias related state" |
Chia-I Wu | 8370b40 | 2014-08-29 12:28:37 +0800 | [diff] [blame] | 97 | */ |
| 98 | INTEL_CMD_WA_GEN7_POST_COMMAND_CS_STALL = 1 << 3, |
| 99 | |
| 100 | /* |
| 101 | * From the Ivy Bridge PRM, volume 2 part 1, page 276: |
| 102 | * |
| 103 | * "The driver must make sure a PIPE_CONTROL with the Depth Stall |
| 104 | * Enable bit set after all the following states are programmed: |
| 105 | * |
| 106 | * - 3DSTATE_PS |
| 107 | * - 3DSTATE_VIEWPORT_STATE_POINTERS_CC |
| 108 | * - 3DSTATE_CONSTANT_PS |
| 109 | * - 3DSTATE_BINDING_TABLE_POINTERS_PS |
| 110 | * - 3DSTATE_SAMPLER_STATE_POINTERS_PS |
| 111 | * - 3DSTATE_CC_STATE_POINTERS |
| 112 | * - 3DSTATE_BLEND_STATE_POINTERS |
| 113 | * - 3DSTATE_DEPTH_STENCIL_STATE_POINTERS" |
| 114 | */ |
| 115 | INTEL_CMD_WA_GEN7_POST_COMMAND_DEPTH_STALL = 1 << 4, |
| 116 | }; |
| 117 | |
Chia-I Wu | 68f319d | 2014-09-09 09:43:21 +0800 | [diff] [blame] | 118 | enum intel_cmd_writer_type { |
| 119 | INTEL_CMD_WRITER_BATCH, |
Chia-I Wu | 15cccf7 | 2015-02-10 04:07:40 +0800 | [diff] [blame] | 120 | INTEL_CMD_WRITER_SURFACE, |
Chia-I Wu | 68f319d | 2014-09-09 09:43:21 +0800 | [diff] [blame] | 121 | INTEL_CMD_WRITER_STATE, |
| 122 | INTEL_CMD_WRITER_INSTRUCTION, |
| 123 | |
| 124 | INTEL_CMD_WRITER_COUNT, |
| 125 | }; |
| 126 | |
Courtney Goeltzenleuchter | e20aaa2 | 2015-09-21 17:19:25 -0600 | [diff] [blame] | 127 | enum intel_use_pipeline_dynamic_state { |
| 128 | INTEL_USE_PIPELINE_DYNAMIC_VIEWPORT = (1 << 0), |
| 129 | INTEL_USE_PIPELINE_DYNAMIC_SCISSOR = (1 << 1), |
| 130 | INTEL_USE_PIPELINE_DYNAMIC_LINE_WIDTH = (1 << 2), |
| 131 | INTEL_USE_PIPELINE_DYNAMIC_DEPTH_BIAS = (1 << 3), |
| 132 | INTEL_USE_PIPELINE_DYNAMIC_BLEND_CONSTANTS = (1 << 4), |
| 133 | INTEL_USE_PIPELINE_DYNAMIC_DEPTH_BOUNDS = (1 << 5), |
| 134 | INTEL_USE_PIPELINE_DYNAMIC_STENCIL_COMPARE_MASK = (1 << 6), |
| 135 | INTEL_USE_PIPELINE_DYNAMIC_STENCIL_WRITE_MASK = (1 << 7), |
| 136 | INTEL_USE_PIPELINE_DYNAMIC_STENCIL_REFERENCE = (1 << 8) |
| 137 | }; |
| 138 | |
Chia-I Wu | a57761b | 2014-10-14 14:27:44 +0800 | [diff] [blame] | 139 | struct intel_cmd_shader_cache { |
| 140 | struct { |
| 141 | const void *shader; |
| 142 | uint32_t kernel_offset; |
| 143 | } *entries; |
| 144 | |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 145 | uint32_t count; |
| 146 | uint32_t used; |
Courtney Goeltzenleuchter | d85c1d6 | 2014-08-27 14:04:53 -0600 | [diff] [blame] | 147 | }; |
| 148 | |
Chia-I Wu | 862c557 | 2015-03-28 15:23:55 +0800 | [diff] [blame] | 149 | struct intel_cmd_dset_data { |
| 150 | struct intel_desc_offset *set_offsets; |
| 151 | uint32_t set_offset_count; |
| 152 | |
| 153 | uint32_t *dynamic_offsets; |
| 154 | uint32_t dynamic_offset_count; |
| 155 | }; |
| 156 | |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 157 | /* |
| 158 | * States bounded to the command buffer. We want to write states directly to |
| 159 | * the command buffer when possible, and reduce this struct. |
| 160 | */ |
| 161 | struct intel_cmd_bind { |
Chia-I Wu | 6032b89 | 2014-10-17 14:47:18 +0800 | [diff] [blame] | 162 | const struct intel_cmd_meta *meta; |
| 163 | |
Chia-I Wu | a57761b | 2014-10-14 14:27:44 +0800 | [diff] [blame] | 164 | struct intel_cmd_shader_cache shader_cache; |
| 165 | |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 166 | struct { |
| 167 | const struct intel_pipeline *graphics; |
| 168 | const struct intel_pipeline *compute; |
Chia-I Wu | a57761b | 2014-10-14 14:27:44 +0800 | [diff] [blame] | 169 | |
| 170 | uint32_t vs_offset; |
| 171 | uint32_t tcs_offset; |
| 172 | uint32_t tes_offset; |
| 173 | uint32_t gs_offset; |
| 174 | uint32_t fs_offset; |
| 175 | uint32_t cs_offset; |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 176 | } pipeline; |
| 177 | |
Courtney Goeltzenleuchter | d85c1d6 | 2014-08-27 14:04:53 -0600 | [diff] [blame] | 178 | struct { |
Courtney Goeltzenleuchter | e20aaa2 | 2015-09-21 17:19:25 -0600 | [diff] [blame] | 179 | VkFlags use_pipeline_dynamic_state; |
Courtney Goeltzenleuchter | 09772bb | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 180 | struct intel_dynamic_viewport viewport; |
| 181 | struct intel_dynamic_line_width line_width; |
| 182 | struct intel_dynamic_depth_bias depth_bias; |
| 183 | struct intel_dynamic_blend blend; |
| 184 | struct intel_dynamic_depth_bounds depth_bounds; |
| 185 | struct intel_dynamic_stencil stencil; |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 186 | } state; |
| 187 | |
| 188 | struct { |
Chia-I Wu | 862c557 | 2015-03-28 15:23:55 +0800 | [diff] [blame] | 189 | struct intel_cmd_dset_data graphics_data; |
Chia-I Wu | 862c557 | 2015-03-28 15:23:55 +0800 | [diff] [blame] | 190 | struct intel_cmd_dset_data compute_data; |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 191 | } dset; |
| 192 | |
| 193 | struct { |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 194 | const struct intel_buf *buf[INTEL_MAX_VERTEX_BINDING_COUNT]; |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 195 | VkDeviceSize offset[INTEL_MAX_VERTEX_BINDING_COUNT]; |
Chia-I Wu | 3b04af5 | 2014-11-08 10:48:20 +0800 | [diff] [blame] | 196 | } vertex; |
| 197 | |
| 198 | struct { |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 199 | const struct intel_buf *buf; |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 200 | VkDeviceSize offset; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 201 | VkIndexType type; |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 202 | } index; |
| 203 | |
Tony Barbour | fa6cac7 | 2015-01-16 14:27:35 -0700 | [diff] [blame] | 204 | |
Chia-I Wu | bbc7d91 | 2015-02-27 14:59:50 -0700 | [diff] [blame] | 205 | bool render_pass_changed; |
Courtney Goeltzenleuchter | e3b0f3a | 2015-04-03 15:25:24 -0600 | [diff] [blame] | 206 | const struct intel_render_pass *render_pass; |
Chia-I Wu | bdeed15 | 2015-07-09 12:16:29 +0800 | [diff] [blame] | 207 | const struct intel_render_pass_subpass *render_pass_subpass; |
Courtney Goeltzenleuchter | e3b0f3a | 2015-04-03 15:25:24 -0600 | [diff] [blame] | 208 | const struct intel_fb *fb; |
Chia-I Wu | 513ae5b | 2015-07-01 19:04:59 +0800 | [diff] [blame] | 209 | VkRenderPassContents render_pass_contents; |
Chia-I Wu | 48c283d | 2014-08-25 23:13:46 +0800 | [diff] [blame] | 210 | |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 211 | uint32_t draw_count; |
Chia-I Wu | 48c283d | 2014-08-25 23:13:46 +0800 | [diff] [blame] | 212 | uint32_t wa_flags; |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 213 | }; |
Chia-I Wu | 0914213 | 2014-08-11 15:42:55 +0800 | [diff] [blame] | 214 | |
Chia-I Wu | e24c329 | 2014-08-21 14:05:23 +0800 | [diff] [blame] | 215 | struct intel_cmd_writer { |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 216 | size_t size; |
Chia-I Wu | e24c329 | 2014-08-21 14:05:23 +0800 | [diff] [blame] | 217 | struct intel_bo *bo; |
Chia-I Wu | 0f50ba8 | 2014-09-09 10:25:46 +0800 | [diff] [blame] | 218 | void *ptr; |
Chia-I Wu | e24c329 | 2014-08-21 14:05:23 +0800 | [diff] [blame] | 219 | |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 220 | size_t used; |
Chia-I Wu | 00b51a8 | 2014-09-09 12:07:37 +0800 | [diff] [blame] | 221 | |
Chia-I Wu | f98dd88 | 2015-02-10 04:17:47 +0800 | [diff] [blame] | 222 | uint32_t sba_offset; |
| 223 | |
Chia-I Wu | 00b51a8 | 2014-09-09 12:07:37 +0800 | [diff] [blame] | 224 | /* for decoding */ |
| 225 | struct intel_cmd_item *items; |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 226 | uint32_t item_alloc; |
| 227 | uint32_t item_used; |
Chia-I Wu | e24c329 | 2014-08-21 14:05:23 +0800 | [diff] [blame] | 228 | }; |
| 229 | |
Cody Northrop | f02f9f8 | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 230 | struct intel_cmd_pool { |
| 231 | struct intel_obj obj; |
| 232 | struct intel_dev *dev; |
| 233 | |
| 234 | uint32_t queue_family_index; |
| 235 | uint32_t create_flags; |
| 236 | }; |
| 237 | |
| 238 | static inline struct intel_cmd_pool *intel_cmd_pool(VkCmdPool pool) |
| 239 | { |
| 240 | return *(struct intel_cmd_pool **) &pool; |
| 241 | } |
| 242 | |
| 243 | static inline struct intel_cmd_pool *intel_cmd_pool_from_base(struct intel_base *base) |
| 244 | { |
| 245 | return (struct intel_cmd_pool *) base; |
| 246 | } |
| 247 | |
| 248 | static inline struct intel_cmd_pool *intel_cmd_pool_from_obj(struct intel_obj *obj) |
| 249 | { |
| 250 | return (struct intel_cmd_pool *) &obj->base; |
| 251 | } |
| 252 | |
| 253 | VkResult intel_cmd_pool_create(struct intel_dev *dev, |
| 254 | const VkCmdPoolCreateInfo *info, |
| 255 | struct intel_cmd_pool **cmd_pool_ret); |
| 256 | void intel_cmd_pool_destroy(struct intel_cmd_pool *pool); |
| 257 | |
Courtney Goeltzenleuchter | 831c183 | 2015-10-23 14:21:05 -0600 | [diff] [blame] | 258 | void intel_free_cmd_buffers( |
| 259 | struct intel_cmd_pool *cmd_pool, |
| 260 | uint32_t count, |
| 261 | const VkCmdBuffer *cmd_bufs); |
| 262 | |
Chia-I Wu | 730e536 | 2014-08-19 12:15:09 +0800 | [diff] [blame] | 263 | struct intel_cmd { |
| 264 | struct intel_obj obj; |
| 265 | |
| 266 | struct intel_dev *dev; |
Chia-I Wu | 0b78444 | 2014-08-25 22:54:16 +0800 | [diff] [blame] | 267 | struct intel_bo *scratch_bo; |
Chia-I Wu | 513ae5b | 2015-07-01 19:04:59 +0800 | [diff] [blame] | 268 | bool primary; |
Chia-I Wu | 6388329 | 2014-08-25 13:50:26 +0800 | [diff] [blame] | 269 | int pipeline_select; |
Chia-I Wu | 730e536 | 2014-08-19 12:15:09 +0800 | [diff] [blame] | 270 | |
Chia-I Wu | 343b137 | 2014-08-20 16:39:20 +0800 | [diff] [blame] | 271 | struct intel_cmd_reloc *relocs; |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 272 | uint32_t reloc_count; |
Chia-I Wu | 343b137 | 2014-08-20 16:39:20 +0800 | [diff] [blame] | 273 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 274 | VkFlags flags; |
Chia-I Wu | 730e536 | 2014-08-19 12:15:09 +0800 | [diff] [blame] | 275 | |
Chia-I Wu | 68f319d | 2014-09-09 09:43:21 +0800 | [diff] [blame] | 276 | struct intel_cmd_writer writers[INTEL_CMD_WRITER_COUNT]; |
Chia-I Wu | 730e536 | 2014-08-19 12:15:09 +0800 | [diff] [blame] | 277 | |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 278 | uint32_t reloc_used; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 279 | VkResult result; |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 280 | |
| 281 | struct intel_cmd_bind bind; |
Chia-I Wu | 730e536 | 2014-08-19 12:15:09 +0800 | [diff] [blame] | 282 | }; |
| 283 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 284 | static inline struct intel_cmd *intel_cmd(VkCmdBuffer cmd) |
Chia-I Wu | 730e536 | 2014-08-19 12:15:09 +0800 | [diff] [blame] | 285 | { |
| 286 | return (struct intel_cmd *) cmd; |
| 287 | } |
| 288 | |
| 289 | static inline struct intel_cmd *intel_cmd_from_obj(struct intel_obj *obj) |
| 290 | { |
| 291 | return (struct intel_cmd *) obj; |
| 292 | } |
| 293 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 294 | VkResult intel_cmd_create(struct intel_dev *dev, |
Courtney Goeltzenleuchter | 831c183 | 2015-10-23 14:21:05 -0600 | [diff] [blame] | 295 | const VkCmdBufferAllocInfo *info, |
Chia-I Wu | 730e536 | 2014-08-19 12:15:09 +0800 | [diff] [blame] | 296 | struct intel_cmd **cmd_ret); |
| 297 | void intel_cmd_destroy(struct intel_cmd *cmd); |
| 298 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 299 | VkResult intel_cmd_begin(struct intel_cmd *cmd, const VkCmdBufferBeginInfo* pBeginInfo); |
| 300 | VkResult intel_cmd_end(struct intel_cmd *cmd); |
Chia-I Wu | 730e536 | 2014-08-19 12:15:09 +0800 | [diff] [blame] | 301 | |
Chia-I Wu | 465fe21 | 2015-02-11 11:27:06 -0700 | [diff] [blame] | 302 | void intel_cmd_decode(struct intel_cmd *cmd, bool decode_inst_writer); |
Chia-I Wu | 00b51a8 | 2014-09-09 12:07:37 +0800 | [diff] [blame] | 303 | |
Chia-I Wu | e24c329 | 2014-08-21 14:05:23 +0800 | [diff] [blame] | 304 | static inline struct intel_bo *intel_cmd_get_batch(const struct intel_cmd *cmd, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 305 | VkDeviceSize *used) |
Chia-I Wu | e24c329 | 2014-08-21 14:05:23 +0800 | [diff] [blame] | 306 | { |
Chia-I Wu | 68f319d | 2014-09-09 09:43:21 +0800 | [diff] [blame] | 307 | const struct intel_cmd_writer *writer = |
| 308 | &cmd->writers[INTEL_CMD_WRITER_BATCH]; |
Chia-I Wu | e24c329 | 2014-08-21 14:05:23 +0800 | [diff] [blame] | 309 | |
| 310 | if (used) |
Chia-I Wu | 72292b7 | 2014-09-09 10:48:33 +0800 | [diff] [blame] | 311 | *used = writer->used; |
Chia-I Wu | e24c329 | 2014-08-21 14:05:23 +0800 | [diff] [blame] | 312 | |
| 313 | return writer->bo; |
| 314 | } |
| 315 | |
Chia-I Wu | 0914213 | 2014-08-11 15:42:55 +0800 | [diff] [blame] | 316 | #endif /* CMD_H */ |