anv/genX: Add flush_pipeline_select_gpgpu
[mesa.git] / src / intel / vulkan / gen7_cmd_buffer.c
1 /*
2 * Copyright © 2015 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23
24 #include <assert.h>
25 #include <stdbool.h>
26 #include <string.h>
27 #include <unistd.h>
28 #include <fcntl.h>
29
30 #include "anv_private.h"
31
32 #include "genxml/gen_macros.h"
33 #include "genxml/genX_pack.h"
34
35 #if GEN_GEN == 7 && !GEN_IS_HASWELL
36 void
37 gen7_cmd_buffer_emit_descriptor_pointers(struct anv_cmd_buffer *cmd_buffer,
38 uint32_t stages)
39 {
40 static const uint32_t sampler_state_opcodes[] = {
41 [MESA_SHADER_VERTEX] = 43,
42 [MESA_SHADER_TESS_CTRL] = 44, /* HS */
43 [MESA_SHADER_TESS_EVAL] = 45, /* DS */
44 [MESA_SHADER_GEOMETRY] = 46,
45 [MESA_SHADER_FRAGMENT] = 47,
46 [MESA_SHADER_COMPUTE] = 0,
47 };
48
49 static const uint32_t binding_table_opcodes[] = {
50 [MESA_SHADER_VERTEX] = 38,
51 [MESA_SHADER_TESS_CTRL] = 39,
52 [MESA_SHADER_TESS_EVAL] = 40,
53 [MESA_SHADER_GEOMETRY] = 41,
54 [MESA_SHADER_FRAGMENT] = 42,
55 [MESA_SHADER_COMPUTE] = 0,
56 };
57
58 anv_foreach_stage(s, stages) {
59 if (cmd_buffer->state.samplers[s].alloc_size > 0) {
60 anv_batch_emit(&cmd_buffer->batch,
61 GENX(3DSTATE_SAMPLER_STATE_POINTERS_VS),
62 ._3DCommandSubOpcode = sampler_state_opcodes[s],
63 .PointertoVSSamplerState = cmd_buffer->state.samplers[s].offset);
64 }
65
66 /* Always emit binding table pointers if we're asked to, since on SKL
67 * this is what flushes push constants. */
68 anv_batch_emit(&cmd_buffer->batch,
69 GENX(3DSTATE_BINDING_TABLE_POINTERS_VS),
70 ._3DCommandSubOpcode = binding_table_opcodes[s],
71 .PointertoVSBindingTable = cmd_buffer->state.binding_tables[s].offset);
72 }
73 }
74
75 uint32_t
76 gen7_cmd_buffer_flush_descriptor_sets(struct anv_cmd_buffer *cmd_buffer)
77 {
78 VkShaderStageFlags dirty = cmd_buffer->state.descriptors_dirty &
79 cmd_buffer->state.pipeline->active_stages;
80
81 VkResult result = VK_SUCCESS;
82 anv_foreach_stage(s, dirty) {
83 result = anv_cmd_buffer_emit_samplers(cmd_buffer, s,
84 &cmd_buffer->state.samplers[s]);
85 if (result != VK_SUCCESS)
86 break;
87 result = anv_cmd_buffer_emit_binding_table(cmd_buffer, s,
88 &cmd_buffer->state.binding_tables[s]);
89 if (result != VK_SUCCESS)
90 break;
91 }
92
93 if (result != VK_SUCCESS) {
94 assert(result == VK_ERROR_OUT_OF_DEVICE_MEMORY);
95
96 result = anv_cmd_buffer_new_binding_table_block(cmd_buffer);
97 assert(result == VK_SUCCESS);
98
99 /* Re-emit state base addresses so we get the new surface state base
100 * address before we start emitting binding tables etc.
101 */
102 anv_cmd_buffer_emit_state_base_address(cmd_buffer);
103
104 /* Re-emit all active binding tables */
105 dirty |= cmd_buffer->state.pipeline->active_stages;
106 anv_foreach_stage(s, dirty) {
107 result = anv_cmd_buffer_emit_samplers(cmd_buffer, s,
108 &cmd_buffer->state.samplers[s]);
109 if (result != VK_SUCCESS)
110 return result;
111 result = anv_cmd_buffer_emit_binding_table(cmd_buffer, s,
112 &cmd_buffer->state.binding_tables[s]);
113 if (result != VK_SUCCESS)
114 return result;
115 }
116 }
117
118 cmd_buffer->state.descriptors_dirty &= ~dirty;
119
120 return dirty;
121 }
122 #endif /* GEN_GEN == 7 && !GEN_IS_HASWELL */
123
124 static inline int64_t
125 clamp_int64(int64_t x, int64_t min, int64_t max)
126 {
127 if (x < min)
128 return min;
129 else if (x < max)
130 return x;
131 else
132 return max;
133 }
134
135 #if GEN_GEN == 7 && !GEN_IS_HASWELL
136 static void
137 emit_scissor_state(struct anv_cmd_buffer *cmd_buffer,
138 uint32_t count, const VkRect2D *scissors)
139 {
140 struct anv_state scissor_state =
141 anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, count * 8, 32);
142
143 for (uint32_t i = 0; i < count; i++) {
144 const VkRect2D *s = &scissors[i];
145
146 /* Since xmax and ymax are inclusive, we have to have xmax < xmin or
147 * ymax < ymin for empty clips. In case clip x, y, width height are all
148 * 0, the clamps below produce 0 for xmin, ymin, xmax, ymax, which isn't
149 * what we want. Just special case empty clips and produce a canonical
150 * empty clip. */
151 static const struct GEN7_SCISSOR_RECT empty_scissor = {
152 .ScissorRectangleYMin = 1,
153 .ScissorRectangleXMin = 1,
154 .ScissorRectangleYMax = 0,
155 .ScissorRectangleXMax = 0
156 };
157
158 const int max = 0xffff;
159 struct GEN7_SCISSOR_RECT scissor = {
160 /* Do this math using int64_t so overflow gets clamped correctly. */
161 .ScissorRectangleYMin = clamp_int64(s->offset.y, 0, max),
162 .ScissorRectangleXMin = clamp_int64(s->offset.x, 0, max),
163 .ScissorRectangleYMax = clamp_int64((uint64_t) s->offset.y + s->extent.height - 1, 0, max),
164 .ScissorRectangleXMax = clamp_int64((uint64_t) s->offset.x + s->extent.width - 1, 0, max)
165 };
166
167 if (s->extent.width <= 0 || s->extent.height <= 0) {
168 GEN7_SCISSOR_RECT_pack(NULL, scissor_state.map + i * 8,
169 &empty_scissor);
170 } else {
171 GEN7_SCISSOR_RECT_pack(NULL, scissor_state.map + i * 8, &scissor);
172 }
173 }
174
175 anv_batch_emit(&cmd_buffer->batch, GEN7_3DSTATE_SCISSOR_STATE_POINTERS,
176 .ScissorRectPointer = scissor_state.offset);
177
178 if (!cmd_buffer->device->info.has_llc)
179 anv_state_clflush(scissor_state);
180 }
181
182 void
183 gen7_cmd_buffer_emit_scissor(struct anv_cmd_buffer *cmd_buffer)
184 {
185 if (cmd_buffer->state.dynamic.scissor.count > 0) {
186 emit_scissor_state(cmd_buffer, cmd_buffer->state.dynamic.scissor.count,
187 cmd_buffer->state.dynamic.scissor.scissors);
188 } else {
189 /* Emit a default scissor based on the currently bound framebuffer */
190 emit_scissor_state(cmd_buffer, 1,
191 &(VkRect2D) {
192 .offset = { .x = 0, .y = 0, },
193 .extent = {
194 .width = cmd_buffer->state.framebuffer->width,
195 .height = cmd_buffer->state.framebuffer->height,
196 },
197 });
198 }
199 }
200 #endif
201
202 static const uint32_t vk_to_gen_index_type[] = {
203 [VK_INDEX_TYPE_UINT16] = INDEX_WORD,
204 [VK_INDEX_TYPE_UINT32] = INDEX_DWORD,
205 };
206
207 static const uint32_t restart_index_for_type[] = {
208 [VK_INDEX_TYPE_UINT16] = UINT16_MAX,
209 [VK_INDEX_TYPE_UINT32] = UINT32_MAX,
210 };
211
212 void genX(CmdBindIndexBuffer)(
213 VkCommandBuffer commandBuffer,
214 VkBuffer _buffer,
215 VkDeviceSize offset,
216 VkIndexType indexType)
217 {
218 ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, commandBuffer);
219 ANV_FROM_HANDLE(anv_buffer, buffer, _buffer);
220
221 cmd_buffer->state.dirty |= ANV_CMD_DIRTY_INDEX_BUFFER;
222 if (GEN_IS_HASWELL)
223 cmd_buffer->state.restart_index = restart_index_for_type[indexType];
224 cmd_buffer->state.gen7.index_buffer = buffer;
225 cmd_buffer->state.gen7.index_type = vk_to_gen_index_type[indexType];
226 cmd_buffer->state.gen7.index_offset = offset;
227 }
228
229 static VkResult
230 flush_compute_descriptor_set(struct anv_cmd_buffer *cmd_buffer)
231 {
232 struct anv_device *device = cmd_buffer->device;
233 struct anv_pipeline *pipeline = cmd_buffer->state.compute_pipeline;
234 struct anv_state surfaces = { 0, }, samplers = { 0, };
235 VkResult result;
236
237 result = anv_cmd_buffer_emit_samplers(cmd_buffer,
238 MESA_SHADER_COMPUTE, &samplers);
239 if (result != VK_SUCCESS)
240 return result;
241 result = anv_cmd_buffer_emit_binding_table(cmd_buffer,
242 MESA_SHADER_COMPUTE, &surfaces);
243 if (result != VK_SUCCESS)
244 return result;
245
246 struct anv_state push_state = anv_cmd_buffer_cs_push_constants(cmd_buffer);
247
248 const struct brw_cs_prog_data *cs_prog_data = get_cs_prog_data(pipeline);
249 const struct brw_stage_prog_data *prog_data = &cs_prog_data->base;
250
251 unsigned local_id_dwords = cs_prog_data->local_invocation_id_regs * 8;
252 unsigned push_constant_data_size =
253 (prog_data->nr_params + local_id_dwords) * 4;
254 unsigned reg_aligned_constant_size = ALIGN(push_constant_data_size, 32);
255 unsigned push_constant_regs = reg_aligned_constant_size / 32;
256
257 if (push_state.alloc_size) {
258 anv_batch_emit(&cmd_buffer->batch, GENX(MEDIA_CURBE_LOAD),
259 .CURBETotalDataLength = push_state.alloc_size,
260 .CURBEDataStartAddress = push_state.offset);
261 }
262
263 assert(prog_data->total_shared <= 64 * 1024);
264 uint32_t slm_size = 0;
265 if (prog_data->total_shared > 0) {
266 /* slm_size is in 4k increments, but must be a power of 2. */
267 slm_size = 4 * 1024;
268 while (slm_size < prog_data->total_shared)
269 slm_size <<= 1;
270 slm_size /= 4 * 1024;
271 }
272
273 struct anv_state state =
274 anv_state_pool_emit(&device->dynamic_state_pool,
275 GENX(INTERFACE_DESCRIPTOR_DATA), 64,
276 .KernelStartPointer = pipeline->cs_simd,
277 .BindingTablePointer = surfaces.offset,
278 .SamplerStatePointer = samplers.offset,
279 .ConstantURBEntryReadLength =
280 push_constant_regs,
281 #if !GEN_IS_HASWELL
282 .ConstantURBEntryReadOffset = 0,
283 #endif
284 .BarrierEnable = cs_prog_data->uses_barrier,
285 .SharedLocalMemorySize = slm_size,
286 .NumberofThreadsinGPGPUThreadGroup =
287 pipeline->cs_thread_width_max);
288
289 const uint32_t size = GENX(INTERFACE_DESCRIPTOR_DATA_length) * sizeof(uint32_t);
290 anv_batch_emit(&cmd_buffer->batch, GENX(MEDIA_INTERFACE_DESCRIPTOR_LOAD),
291 .InterfaceDescriptorTotalLength = size,
292 .InterfaceDescriptorDataStartAddress = state.offset);
293
294 return VK_SUCCESS;
295 }
296
297 static void
298 emit_lri(struct anv_batch *batch, uint32_t reg, uint32_t imm)
299 {
300 anv_batch_emit(batch, GENX(MI_LOAD_REGISTER_IMM),
301 .RegisterOffset = reg,
302 .DataDWord = imm);
303 }
304
305 #define GEN7_L3SQCREG1 0xb010
306 #define GEN7_L3CNTLREG2 0xb020
307 #define GEN7_L3CNTLREG3 0xb024
308
309 void
310 genX(cmd_buffer_config_l3)(struct anv_cmd_buffer *cmd_buffer, bool enable_slm)
311 {
312 /* References for GL state:
313 *
314 * - commits e307cfa..228d5a3
315 * - src/mesa/drivers/dri/i965/gen7_l3_state.c
316 */
317
318 uint32_t l3c2_val = enable_slm ?
319 /* All = 0 ways; URB = 16 ways; DC and RO = 16; SLM = 1 */
320 /*0x02040021*/0x010000a1 :
321 /* All = 0 ways; URB = 32 ways; DC = 0; RO = 32; SLM = 0 */
322 /*0x04080040*/0x02000030;
323 bool changed = cmd_buffer->state.current_l3_config != l3c2_val;
324
325 if (changed) {
326 /* According to the hardware docs, the L3 partitioning can only be changed
327 * while the pipeline is completely drained and the caches are flushed,
328 * which involves a first PIPE_CONTROL flush which stalls the pipeline and
329 * initiates invalidation of the relevant caches...
330 */
331 anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL),
332 .TextureCacheInvalidationEnable = true,
333 .ConstantCacheInvalidationEnable = true,
334 .InstructionCacheInvalidateEnable = true,
335 .DCFlushEnable = true,
336 .PostSyncOperation = NoWrite,
337 .CommandStreamerStallEnable = true);
338
339 /* ...followed by a second stalling flush which guarantees that
340 * invalidation is complete when the L3 configuration registers are
341 * modified.
342 */
343 anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL),
344 .DCFlushEnable = true,
345 .PostSyncOperation = NoWrite,
346 .CommandStreamerStallEnable = true);
347
348 anv_finishme("write GEN7_L3SQCREG1");
349 emit_lri(&cmd_buffer->batch, GEN7_L3CNTLREG2, l3c2_val);
350 emit_lri(&cmd_buffer->batch, GEN7_L3CNTLREG3,
351 enable_slm ? 0x00040810 : 0x00040410);
352 cmd_buffer->state.current_l3_config = l3c2_val;
353 }
354 }
355
356 void
357 genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer)
358 {
359 struct anv_pipeline *pipeline = cmd_buffer->state.compute_pipeline;
360 const struct brw_cs_prog_data *cs_prog_data = get_cs_prog_data(pipeline);
361 VkResult result;
362
363 assert(pipeline->active_stages == VK_SHADER_STAGE_COMPUTE_BIT);
364
365 bool needs_slm = cs_prog_data->base.total_shared > 0;
366 genX(cmd_buffer_config_l3)(cmd_buffer, needs_slm);
367
368 genX(flush_pipeline_select_gpgpu)(cmd_buffer);
369
370 if (cmd_buffer->state.compute_dirty & ANV_CMD_DIRTY_PIPELINE)
371 anv_batch_emit_batch(&cmd_buffer->batch, &pipeline->batch);
372
373 if ((cmd_buffer->state.descriptors_dirty & VK_SHADER_STAGE_COMPUTE_BIT) ||
374 (cmd_buffer->state.compute_dirty & ANV_CMD_DIRTY_PIPELINE)) {
375 /* FIXME: figure out descriptors for gen7 */
376 result = flush_compute_descriptor_set(cmd_buffer);
377 assert(result == VK_SUCCESS);
378 cmd_buffer->state.descriptors_dirty &= ~VK_SHADER_STAGE_COMPUTE_BIT;
379 }
380
381 cmd_buffer->state.compute_dirty = 0;
382 }
383
384 void
385 genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer)
386 {
387 struct anv_pipeline *pipeline = cmd_buffer->state.pipeline;
388
389 if (cmd_buffer->state.dirty & (ANV_CMD_DIRTY_PIPELINE |
390 ANV_CMD_DIRTY_RENDER_TARGETS |
391 ANV_CMD_DIRTY_DYNAMIC_LINE_WIDTH |
392 ANV_CMD_DIRTY_DYNAMIC_DEPTH_BIAS)) {
393
394 const struct anv_image_view *iview =
395 anv_cmd_buffer_get_depth_stencil_view(cmd_buffer);
396 const struct anv_image *image = iview ? iview->image : NULL;
397 const struct anv_format *anv_format =
398 iview ? anv_format_for_vk_format(iview->vk_format) : NULL;
399 const bool has_depth = iview && anv_format->has_depth;
400 const uint32_t depth_format = has_depth ?
401 isl_surf_get_depth_format(&cmd_buffer->device->isl_dev,
402 &image->depth_surface.isl) : D16_UNORM;
403
404 uint32_t sf_dw[GENX(3DSTATE_SF_length)];
405 struct GENX(3DSTATE_SF) sf = {
406 GENX(3DSTATE_SF_header),
407 .DepthBufferSurfaceFormat = depth_format,
408 .LineWidth = cmd_buffer->state.dynamic.line_width,
409 .GlobalDepthOffsetConstant = cmd_buffer->state.dynamic.depth_bias.bias,
410 .GlobalDepthOffsetScale = cmd_buffer->state.dynamic.depth_bias.slope,
411 .GlobalDepthOffsetClamp = cmd_buffer->state.dynamic.depth_bias.clamp
412 };
413 GENX(3DSTATE_SF_pack)(NULL, sf_dw, &sf);
414
415 anv_batch_emit_merge(&cmd_buffer->batch, sf_dw, pipeline->gen7.sf);
416 }
417
418 if (cmd_buffer->state.dirty & (ANV_CMD_DIRTY_DYNAMIC_BLEND_CONSTANTS |
419 ANV_CMD_DIRTY_DYNAMIC_STENCIL_REFERENCE)) {
420 struct anv_dynamic_state *d = &cmd_buffer->state.dynamic;
421 struct anv_state cc_state =
422 anv_cmd_buffer_alloc_dynamic_state(cmd_buffer,
423 GENX(COLOR_CALC_STATE_length) * 4,
424 64);
425 struct GENX(COLOR_CALC_STATE) cc = {
426 .BlendConstantColorRed = cmd_buffer->state.dynamic.blend_constants[0],
427 .BlendConstantColorGreen = cmd_buffer->state.dynamic.blend_constants[1],
428 .BlendConstantColorBlue = cmd_buffer->state.dynamic.blend_constants[2],
429 .BlendConstantColorAlpha = cmd_buffer->state.dynamic.blend_constants[3],
430 .StencilReferenceValue = d->stencil_reference.front & 0xff,
431 .BackFaceStencilReferenceValue = d->stencil_reference.back & 0xff,
432 };
433 GENX(COLOR_CALC_STATE_pack)(NULL, cc_state.map, &cc);
434 if (!cmd_buffer->device->info.has_llc)
435 anv_state_clflush(cc_state);
436
437 anv_batch_emit(&cmd_buffer->batch,
438 GENX(3DSTATE_CC_STATE_POINTERS),
439 .ColorCalcStatePointer = cc_state.offset);
440 }
441
442 if (cmd_buffer->state.dirty & (ANV_CMD_DIRTY_PIPELINE |
443 ANV_CMD_DIRTY_RENDER_TARGETS |
444 ANV_CMD_DIRTY_DYNAMIC_STENCIL_COMPARE_MASK |
445 ANV_CMD_DIRTY_DYNAMIC_STENCIL_WRITE_MASK)) {
446 uint32_t depth_stencil_dw[GENX(DEPTH_STENCIL_STATE_length)];
447 struct anv_dynamic_state *d = &cmd_buffer->state.dynamic;
448
449 struct GENX(DEPTH_STENCIL_STATE) depth_stencil = {
450 .StencilTestMask = d->stencil_compare_mask.front & 0xff,
451 .StencilWriteMask = d->stencil_write_mask.front & 0xff,
452
453 .BackfaceStencilTestMask = d->stencil_compare_mask.back & 0xff,
454 .BackfaceStencilWriteMask = d->stencil_write_mask.back & 0xff,
455 };
456 GENX(DEPTH_STENCIL_STATE_pack)(NULL, depth_stencil_dw, &depth_stencil);
457
458 struct anv_state ds_state =
459 anv_cmd_buffer_merge_dynamic(cmd_buffer, depth_stencil_dw,
460 pipeline->gen7.depth_stencil_state,
461 GENX(DEPTH_STENCIL_STATE_length), 64);
462
463 anv_batch_emit(&cmd_buffer->batch,
464 GENX(3DSTATE_DEPTH_STENCIL_STATE_POINTERS),
465 .PointertoDEPTH_STENCIL_STATE = ds_state.offset);
466 }
467
468 if (cmd_buffer->state.gen7.index_buffer &&
469 cmd_buffer->state.dirty & (ANV_CMD_DIRTY_PIPELINE |
470 ANV_CMD_DIRTY_INDEX_BUFFER)) {
471 struct anv_buffer *buffer = cmd_buffer->state.gen7.index_buffer;
472 uint32_t offset = cmd_buffer->state.gen7.index_offset;
473
474 #if GEN_IS_HASWELL
475 anv_batch_emit(&cmd_buffer->batch, GEN75_3DSTATE_VF,
476 .IndexedDrawCutIndexEnable = pipeline->primitive_restart,
477 .CutIndex = cmd_buffer->state.restart_index);
478 #endif
479
480 anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_INDEX_BUFFER),
481 #if !GEN_IS_HASWELL
482 .CutIndexEnable = pipeline->primitive_restart,
483 #endif
484 .IndexFormat = cmd_buffer->state.gen7.index_type,
485 .MemoryObjectControlState = GENX(MOCS),
486 .BufferStartingAddress = { buffer->bo, buffer->offset + offset },
487 .BufferEndingAddress = { buffer->bo, buffer->offset + buffer->size });
488 }
489
490 cmd_buffer->state.dirty = 0;
491 }
492
493 void genX(CmdSetEvent)(
494 VkCommandBuffer commandBuffer,
495 VkEvent event,
496 VkPipelineStageFlags stageMask)
497 {
498 stub();
499 }
500
501 void genX(CmdResetEvent)(
502 VkCommandBuffer commandBuffer,
503 VkEvent event,
504 VkPipelineStageFlags stageMask)
505 {
506 stub();
507 }
508
509 void genX(CmdWaitEvents)(
510 VkCommandBuffer commandBuffer,
511 uint32_t eventCount,
512 const VkEvent* pEvents,
513 VkPipelineStageFlags srcStageMask,
514 VkPipelineStageFlags destStageMask,
515 uint32_t memoryBarrierCount,
516 const VkMemoryBarrier* pMemoryBarriers,
517 uint32_t bufferMemoryBarrierCount,
518 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
519 uint32_t imageMemoryBarrierCount,
520 const VkImageMemoryBarrier* pImageMemoryBarriers)
521 {
522 stub();
523 }