forked from KhronosGroup/Vulkan-ValidationLayers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbest_practices.cpp
835 lines (695 loc) · 45.5 KB
/
best_practices.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
/* Copyright (c) 2015-2019 The Khronos Group Inc.
* Copyright (c) 2015-2019 Valve Corporation
* Copyright (c) 2015-2019 LunarG, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author: Camden Stocker <[email protected]>
*/
#include "best_practices.h"
#include "layer_chassis_dispatch.h"
#include "best_practices_error_enums.h"
#include <string>
#include <iomanip>
// get the API name is proper format
std::string BestPractices::GetAPIVersionName(uint32_t version) const {
std::stringstream version_name;
uint32_t major = VK_VERSION_MAJOR(version);
uint32_t minor = VK_VERSION_MINOR(version);
uint32_t patch = VK_VERSION_PATCH(version);
version_name << major << "." << minor << "." << patch << " (0x" << std::setfill('0') << std::setw(8) << std::hex << version
<< ")";
return version_name.str();
}
bool BestPractices::PreCallValidateCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
VkInstance* pInstance) const {
bool skip = false;
for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
if (white_list(pCreateInfo->ppEnabledExtensionNames[i], kDeviceExtensionNames)) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_CreateInstance_ExtensionMismatch,
"vkCreateInstance(): Attempting to enable Device Extension %s at CreateInstance time.",
pCreateInfo->ppEnabledExtensionNames[i]);
}
}
return skip;
}
void BestPractices::PreCallRecordCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
VkInstance* pInstance) {
instance_api_version = pCreateInfo->pApplicationInfo->apiVersion;
}
bool BestPractices::PreCallValidateCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) const {
bool skip = false;
// get API version of physical device passed when creating device.
VkPhysicalDeviceProperties physical_device_properties{};
DispatchGetPhysicalDeviceProperties(physicalDevice, &physical_device_properties);
auto device_api_version = physical_device_properties.apiVersion;
// check api versions and warn if instance api Version is higher than version on device.
if (instance_api_version > device_api_version) {
std::string inst_api_name = GetAPIVersionName(instance_api_version);
std::string dev_api_name = GetAPIVersionName(device_api_version);
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_CreateDevice_API_Mismatch,
"vkCreateDevice(): API Version of current instance, %s is higher than API Version on device, %s",
inst_api_name.c_str(), dev_api_name.c_str());
}
for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
if (white_list(pCreateInfo->ppEnabledExtensionNames[i], kInstanceExtensionNames)) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_CreateInstance_ExtensionMismatch,
"vkCreateDevice(): Attempting to enable Instance Extension %s at CreateDevice time.",
pCreateInfo->ppEnabledExtensionNames[i]);
}
}
auto pd_state = GetPhysicalDeviceState(physicalDevice);
if ((pd_state->vkGetPhysicalDeviceFeaturesState == UNCALLED) && (pCreateInfo->pEnabledFeatures != NULL)) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_CreateDevice_PDFeaturesNotCalled,
"vkCreateDevice() called before getting physical device features from vkGetPhysicalDeviceFeatures().");
}
return skip;
}
bool BestPractices::PreCallValidateCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) const {
bool skip = false;
if ((pCreateInfo->queueFamilyIndexCount > 1) && (pCreateInfo->sharingMode == VK_SHARING_MODE_EXCLUSIVE)) {
std::stringstream bufferHex;
bufferHex << "0x" << std::hex << HandleToUint64(pBuffer);
skip |=
log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_SharingModeExclusive,
"Warning: Buffer (%s) specifies a sharing mode of VK_SHARING_MODE_EXCLUSIVE while specifying multiple queues "
"(queueFamilyIndexCount of %" PRIu32 ").",
bufferHex.str().c_str(), pCreateInfo->queueFamilyIndexCount);
}
return skip;
}
bool BestPractices::PreCallValidateCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, VkImage* pImage) const {
bool skip = false;
if ((pCreateInfo->queueFamilyIndexCount > 1) && (pCreateInfo->sharingMode == VK_SHARING_MODE_EXCLUSIVE)) {
std::stringstream imageHex;
imageHex << "0x" << std::hex << HandleToUint64(pImage);
skip |=
log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_SharingModeExclusive,
"Warning: Image (%s) specifies a sharing mode of VK_SHARING_MODE_EXCLUSIVE while specifying multiple queues "
"(queueFamilyIndexCount of %" PRIu32 ").",
imageHex.str().c_str(), pCreateInfo->queueFamilyIndexCount);
}
return skip;
}
bool BestPractices::PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) const {
bool skip = false;
auto physical_device_state = GetPhysicalDeviceState();
if (physical_device_state->vkGetPhysicalDeviceSurfaceCapabilitiesKHRState == UNCALLED) {
skip |= log_msg(
report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_Swapchain_GetSurfaceNotCalled,
"vkCreateSwapchainKHR() called before getting surface capabilities from vkGetPhysicalDeviceSurfaceCapabilitiesKHR().");
}
if (physical_device_state->vkGetPhysicalDeviceSurfacePresentModesKHRState != QUERY_DETAILS) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_Swapchain_GetSurfaceNotCalled,
"vkCreateSwapchainKHR() called before getting surface present mode(s) from "
"vkGetPhysicalDeviceSurfacePresentModesKHR().");
}
if (physical_device_state->vkGetPhysicalDeviceSurfaceFormatsKHRState != QUERY_DETAILS) {
skip |=
log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_Swapchain_GetSurfaceNotCalled,
"vkCreateSwapchainKHR() called before getting surface format(s) from vkGetPhysicalDeviceSurfaceFormatsKHR().");
}
if ((pCreateInfo->queueFamilyIndexCount > 1) && (pCreateInfo->imageSharingMode == VK_SHARING_MODE_EXCLUSIVE)) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_SharingModeExclusive,
"Warning: A Swapchain is being created which specifies a sharing mode of VK_SHARING_MODE_EXCULSIVE while "
"specifying multiple queues (queueFamilyIndexCount of %" PRIu32 ").",
pCreateInfo->queueFamilyIndexCount);
}
return skip;
}
bool BestPractices::PreCallValidateCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount,
const VkSwapchainCreateInfoKHR* pCreateInfos,
const VkAllocationCallbacks* pAllocator,
VkSwapchainKHR* pSwapchains) const {
bool skip = false;
for (uint32_t i = 0; i < swapchainCount; i++) {
if ((pCreateInfos[i].queueFamilyIndexCount > 1) && (pCreateInfos[i].imageSharingMode == VK_SHARING_MODE_EXCLUSIVE)) {
skip |=
log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_SharingModeExclusive,
"Warning: A shared swapchain (index %" PRIu32
") is being created which specifies a sharing mode of VK_SHARING_MODE_EXCLUSIVE while specifying multiple "
"queues (queueFamilyIndexCount of %" PRIu32 ").",
i, pCreateInfos[i].queueFamilyIndexCount);
}
}
return skip;
}
bool BestPractices::PreCallValidateCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) const {
bool skip = false;
for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) {
VkFormat format = pCreateInfo->pAttachments[i].format;
if (pCreateInfo->pAttachments[i].initialLayout == VK_IMAGE_LAYOUT_UNDEFINED) {
if ((FormatIsColor(format) || FormatHasDepth(format)) &&
pCreateInfo->pAttachments[i].loadOp == VK_ATTACHMENT_LOAD_OP_LOAD) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_RenderPass_Attatchment,
"Render pass has an attachment with loadOp == VK_ATTACHMENT_LOAD_OP_LOAD and "
"initialLayout == VK_IMAGE_LAYOUT_UNDEFINED. This is probably not what you "
"intended. Consider using VK_ATTACHMENT_LOAD_OP_DONT_CARE instead if the "
"image truely is undefined at the start of the render pass.");
}
if (FormatHasStencil(format) && pCreateInfo->pAttachments[i].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_LOAD) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_RenderPass_Attatchment,
"Render pass has an attachment with stencilLoadOp == VK_ATTACHMENT_LOAD_OP_LOAD "
"and initialLayout == VK_IMAGE_LAYOUT_UNDEFINED. This is probably not what you "
"intended. Consider using VK_ATTACHMENT_LOAD_OP_DONT_CARE instead if the "
"image truely is undefined at the start of the render pass.");
}
}
}
for (uint32_t dependency = 0; dependency < pCreateInfo->dependencyCount; dependency++) {
skip |= CheckPipelineStageFlags("vkCreateRenderPass", pCreateInfo->pDependencies[dependency].srcStageMask);
skip |= CheckPipelineStageFlags("vkCreateRenderPass", pCreateInfo->pDependencies[dependency].dstStageMask);
}
return skip;
}
bool BestPractices::PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo,
const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) const {
bool skip = false;
if (num_mem_objects + 1 > kMemoryObjectWarningLimit) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_AllocateMemory_TooManyObjects,
"Performance Warning: This app has > %" PRIu32 " memory objects.", kMemoryObjectWarningLimit);
}
// TODO: Insert get check for GetPhysicalDeviceMemoryProperties once the state is tracked in the StateTracker
return skip;
}
void BestPractices::PostCallRecordAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo,
const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory,
VkResult result) {
ValidationStateTracker::PostCallRecordAllocateMemory(device, pAllocateInfo, pAllocator, pMemory, result);
if (VK_SUCCESS == result) {
num_mem_objects++;
}
}
bool BestPractices::PreCallValidateFreeMemory(VkDevice device, VkDeviceMemory memory,
const VkAllocationCallbacks* pAllocator) const {
bool skip = false;
const DEVICE_MEMORY_STATE* mem_info = ValidationStateTracker::GetDevMemState(memory);
for (auto& obj : mem_info->obj_bindings) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, get_debug_report_enum[obj.type], 0, layer_name.c_str(),
"VK Object %s still has a reference to mem obj %s.", report_data->FormatHandle(obj).c_str(),
report_data->FormatHandle(mem_info->mem).c_str());
}
return skip;
}
void BestPractices::PreCallRecordFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator) {
if (memory != VK_NULL_HANDLE) {
num_mem_objects--;
}
}
bool BestPractices::ValidateBindBufferMemory(VkBuffer buffer, const char* api_name) const {
bool skip = false;
const BUFFER_STATE* buffer_state = GetBufferState(buffer);
if (!buffer_state->memory_requirements_checked && !buffer_state->external_memory_handle) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_BufferMemReqNotCalled,
"%s: Binding memory to %s but vkGetBufferMemoryRequirements() has not been called on that buffer.",
api_name, report_data->FormatHandle(buffer).c_str());
}
return skip;
}
bool BestPractices::PreCallValidateBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory,
VkDeviceSize memoryOffset) const {
bool skip = false;
const char* api_name = "BindBufferMemory()";
skip |= ValidateBindBufferMemory(buffer, api_name);
return skip;
}
bool BestPractices::PreCallValidateBindBufferMemory2(VkDevice device, uint32_t bindInfoCount,
const VkBindBufferMemoryInfo* pBindInfos) const {
char api_name[64];
bool skip = false;
for (uint32_t i = 0; i < bindInfoCount; i++) {
sprintf(api_name, "vkBindBufferMemory2() pBindInfos[%u]", i);
skip |= ValidateBindBufferMemory(pBindInfos[i].buffer, api_name);
}
return skip;
}
bool BestPractices::PreCallValidateBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount,
const VkBindBufferMemoryInfo* pBindInfos) const {
char api_name[64];
bool skip = false;
for (uint32_t i = 0; i < bindInfoCount; i++) {
sprintf(api_name, "vkBindBufferMemory2KHR() pBindInfos[%u]", i);
skip |= ValidateBindBufferMemory(pBindInfos[i].buffer, api_name);
}
return skip;
}
bool BestPractices::ValidateBindImageMemory(VkImage image, const char* api_name) const {
bool skip = false;
const IMAGE_STATE* image_state = GetImageState(image);
if (!image_state->memory_requirements_checked && !image_state->external_memory_handle) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_ImageMemReqNotCalled,
"%s: Binding memory to %s but vkGetImageMemoryRequirements() has not been called on that image.", api_name,
report_data->FormatHandle(image).c_str());
}
return skip;
}
bool BestPractices::PreCallValidateBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory,
VkDeviceSize memoryOffset) const {
bool skip = false;
const char* api_name = "vkBindImageMemory()";
skip |= ValidateBindImageMemory(image, api_name);
return skip;
}
bool BestPractices::PreCallValidateBindImageMemory2(VkDevice device, uint32_t bindInfoCount,
const VkBindImageMemoryInfo* pBindInfos) const {
char api_name[64];
bool skip = false;
for (uint32_t i = 0; i < bindInfoCount; i++) {
sprintf(api_name, "vkBindImageMemory2() pBindInfos[%u]", i);
skip |= ValidateBindImageMemory(pBindInfos[i].image, api_name);
}
return skip;
}
bool BestPractices::PreCallValidateBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount,
const VkBindImageMemoryInfo* pBindInfos) const {
char api_name[64];
bool skip = false;
for (uint32_t i = 0; i < bindInfoCount; i++) {
sprintf(api_name, "vkBindImageMemory2KHR() pBindInfos[%u]", i);
skip |= ValidateBindImageMemory(pBindInfos[i].image, api_name);
}
return skip;
}
bool BestPractices::PreCallValidateCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
const VkGraphicsPipelineCreateInfo* pCreateInfos,
const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines,
void* cgpl_state_data) const {
bool skip = StateTracker::PreCallValidateCreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos,
pAllocator, pPipelines, cgpl_state_data);
if ((createInfoCount > 1) && (!pipelineCache)) {
skip |=
log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_CreatePipelines_MultiplePipelines,
"Performance Warning: This vkCreateGraphicsPipelines call is creating multiple pipelines but is not using a "
"pipeline cache, which may help with performance");
}
return skip;
}
bool BestPractices::PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
const VkComputePipelineCreateInfo* pCreateInfos,
const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines,
void* ccpl_state_data) const {
bool skip = StateTracker::PreCallValidateCreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos,
pAllocator, pPipelines, ccpl_state_data);
if ((createInfoCount > 1) && (!pipelineCache)) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_CreatePipelines_MultiplePipelines,
"Performance Warning: This vkCreateComputePipelines call is creating multiple pipelines but is not using a "
"pipeline cache, which may help with performance");
}
return skip;
}
bool BestPractices::CheckPipelineStageFlags(std::string api_name, const VkPipelineStageFlags flags) const {
bool skip = false;
if (flags & VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_PipelineStageFlags,
"You are using VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT when %s is called\n", api_name.c_str());
} else if (flags & VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_PipelineStageFlags,
"You are using VK_PIPELINE_STAGE_ALL_COMMANDS_BIT when %s is called\n", api_name.c_str());
}
return skip;
}
bool BestPractices::PreCallValidateQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits,
VkFence fence) const {
bool skip = false;
for (uint32_t submit = 0; submit < submitCount; submit++) {
for (uint32_t semaphore = 0; semaphore < pSubmits[submit].waitSemaphoreCount; semaphore++) {
skip |= CheckPipelineStageFlags("vkQueueSubmit", pSubmits[submit].pWaitDstStageMask[semaphore]);
}
}
return skip;
}
bool BestPractices::PreCallValidateCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) const {
bool skip = false;
skip |= CheckPipelineStageFlags("vkCmdSetEvent", stageMask);
return skip;
}
bool BestPractices::PreCallValidateCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event,
VkPipelineStageFlags stageMask) const {
bool skip = false;
skip |= CheckPipelineStageFlags("vkCmdResetEvent", stageMask);
return skip;
}
bool BestPractices::PreCallValidateCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents,
VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask,
uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers) const {
bool skip = false;
skip |= CheckPipelineStageFlags("vkCmdWaitEvents", srcStageMask);
skip |= CheckPipelineStageFlags("vkCmdWaitEvents", dstStageMask);
return skip;
}
bool BestPractices::PreCallValidateCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers) const {
bool skip = false;
skip |= CheckPipelineStageFlags("vkCmdPipelineBarrier", srcStageMask);
skip |= CheckPipelineStageFlags("vkCmdPipelineBarrier", dstStageMask);
return skip;
}
bool BestPractices::PreCallValidateCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage,
VkQueryPool queryPool, uint32_t query) const {
bool skip = false;
skip |= CheckPipelineStageFlags("vkCmdWriteTimestamp", pipelineStage);
return skip;
}
bool BestPractices::PreCallValidateCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount,
uint32_t firstVertex, uint32_t firstInstance) const {
bool skip = false;
if (instanceCount == 0) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_CmdDraw_InstanceCountZero,
"Warning: You are calling vkCmdDraw() with an instanceCount of Zero.");
}
return skip;
}
bool BestPractices::PreCallValidateCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount,
uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) const {
bool skip = false;
if (instanceCount == 0) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_CmdDraw_InstanceCountZero,
"Warning: You are calling vkCmdDrawIndexed() with an instanceCount of Zero.");
}
return skip;
}
bool BestPractices::PreCallValidateCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
uint32_t drawCount, uint32_t stride) const {
bool skip = false;
if (drawCount == 0) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_CmdDraw_DrawCountZero,
"Warning: You are calling vkCmdDrawIndirect() with a drawCount of Zero.");
}
return skip;
}
bool BestPractices::PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
uint32_t drawCount, uint32_t stride) const {
bool skip = false;
if (drawCount == 0) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_CmdDraw_DrawCountZero,
"Warning: You are calling vkCmdDrawIndexedIndirect() with a drawCount of Zero.");
}
return skip;
}
bool BestPractices::PreCallValidateCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY,
uint32_t groupCountZ) const {
bool skip = false;
if ((groupCountX == 0) || (groupCountY == 0) || (groupCountZ == 0)) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_CmdDispatch_GroupCountZero,
"Warning: You are calling vkCmdDispatch() while one or more groupCounts are zero (groupCountX = %" PRIu32
", groupCountY = %" PRIu32 ", groupCountZ = %" PRIu32 ").",
groupCountX, groupCountY, groupCountZ);
}
return skip;
}
bool BestPractices::PreCallValidateGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex,
uint32_t* pDisplayCount, VkDisplayKHR* pDisplays) const {
bool skip = false;
auto physical_device_state = GetPhysicalDeviceState(physicalDevice);
if (physical_device_state->vkGetPhysicalDeviceDisplayPlanePropertiesKHRState != QUERY_DETAILS) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
kVUID_BestPractices_DisplayPlane_PropertiesNotCalled,
"vkGetDisplayPlaneSupportedDisplaysKHR() called before getting diplay plane properties from "
"vkGetPhysicalDeviceDisplayPlanePropertiesKHR().");
}
return skip;
}
bool BestPractices::PreCallValidateGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount,
VkImage* pSwapchainImages) const {
bool skip = false;
auto swapchain_state = GetSwapchainState(swapchain);
if (swapchain_state && pSwapchainImages) {
// Compare the preliminary value of *pSwapchainImageCount with the value this time:
if (swapchain_state->vkGetSwapchainImagesKHRState == UNCALLED) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
HandleToUint64(device), kVUID_Core_Swapchain_PriorCount,
"vkGetSwapchainImagesKHR() called with non-NULL pSwapchainImageCount; but no prior positive value has "
"been seen for pSwapchainImages.");
}
}
return skip;
}
// Common function to handle validation for GetPhysicalDeviceQueueFamilyProperties & 2KHR version
static bool ValidateCommonGetPhysicalDeviceQueueFamilyProperties(debug_report_data* report_data,
const PHYSICAL_DEVICE_STATE* pd_state,
uint32_t requested_queue_family_property_count, bool qfp_null,
const char* caller_name) {
bool skip = false;
if (!qfp_null) {
// Verify that for each physical device, this command is called first with NULL pQueueFamilyProperties in order to get count
if (UNCALLED == pd_state->vkGetPhysicalDeviceQueueFamilyPropertiesState) {
skip |= log_msg(
report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
HandleToUint64(pd_state->phys_device), kVUID_Core_DevLimit_MissingQueryCount,
"%s is called with non-NULL pQueueFamilyProperties before obtaining pQueueFamilyPropertyCount. It is recommended "
"to first call %s with NULL pQueueFamilyProperties in order to obtain the maximal pQueueFamilyPropertyCount.",
caller_name, caller_name);
// Then verify that pCount that is passed in on second call matches what was returned
} else if (pd_state->queue_family_known_count != requested_queue_family_property_count) {
skip |= log_msg(
report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
HandleToUint64(pd_state->phys_device), kVUID_Core_DevLimit_CountMismatch,
"%s is called with non-NULL pQueueFamilyProperties and pQueueFamilyPropertyCount value %" PRIu32
", but the largest previously returned pQueueFamilyPropertyCount for this physicalDevice is %" PRIu32
". It is recommended to instead receive all the properties by calling %s with pQueueFamilyPropertyCount that was "
"previously obtained by calling %s with NULL pQueueFamilyProperties.",
caller_name, requested_queue_family_property_count, pd_state->queue_family_known_count, caller_name, caller_name);
}
}
return skip;
}
bool BestPractices::PreCallValidateBindAccelerationStructureMemoryNV(
VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) const {
bool skip = false;
for (uint32_t i = 0; i < bindInfoCount; i++) {
const ACCELERATION_STRUCTURE_STATE* as_state = GetAccelerationStructureState(pBindInfos[i].accelerationStructure);
if (!as_state->memory_requirements_checked) {
// There's not an explicit requirement in the spec to call vkGetImageMemoryRequirements() prior to calling
// BindAccelerationStructureMemoryNV but it's implied in that memory being bound must conform with
// VkAccelerationStructureMemoryRequirementsInfoNV from vkGetAccelerationStructureMemoryRequirementsNV
skip |= log_msg(
report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, 0,
kVUID_BestPractices_BindAccelNV_NoMemReqQuery,
"vkBindAccelerationStructureMemoryNV(): "
"Binding memory to %s but vkGetAccelerationStructureMemoryRequirementsNV() has not been called on that structure.",
report_data->FormatHandle(pBindInfos[i].accelerationStructure).c_str());
}
}
return skip;
}
bool BestPractices::PreCallValidateGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice,
uint32_t* pQueueFamilyPropertyCount,
VkQueueFamilyProperties* pQueueFamilyProperties) const {
const auto physical_device_state = GetPhysicalDeviceState(physicalDevice);
assert(physical_device_state);
return ValidateCommonGetPhysicalDeviceQueueFamilyProperties(report_data, physical_device_state, *pQueueFamilyPropertyCount,
(nullptr == pQueueFamilyProperties),
"vkGetPhysicalDeviceQueueFamilyProperties()");
}
bool BestPractices::PreCallValidateGetPhysicalDeviceQueueFamilyProperties2(
VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount,
VkQueueFamilyProperties2KHR* pQueueFamilyProperties) const {
const auto physical_device_state = GetPhysicalDeviceState(physicalDevice);
assert(physical_device_state);
return ValidateCommonGetPhysicalDeviceQueueFamilyProperties(report_data, physical_device_state, *pQueueFamilyPropertyCount,
(nullptr == pQueueFamilyProperties),
"vkGetPhysicalDeviceQueueFamilyProperties2()");
}
bool BestPractices::PreCallValidateGetPhysicalDeviceQueueFamilyProperties2KHR(
VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount,
VkQueueFamilyProperties2KHR* pQueueFamilyProperties) const {
auto physical_device_state = GetPhysicalDeviceState(physicalDevice);
assert(physical_device_state);
return ValidateCommonGetPhysicalDeviceQueueFamilyProperties(report_data, physical_device_state, *pQueueFamilyPropertyCount,
(nullptr == pQueueFamilyProperties),
"vkGetPhysicalDeviceQueueFamilyProperties2KHR()");
}
bool BestPractices::PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface,
uint32_t* pSurfaceFormatCount,
VkSurfaceFormatKHR* pSurfaceFormats) const {
if (!pSurfaceFormats) return false;
const auto physical_device_state = GetPhysicalDeviceState(physicalDevice);
const auto& call_state = physical_device_state->vkGetPhysicalDeviceSurfaceFormatsKHRState;
bool skip = false;
if (call_state == UNCALLED) {
// Since we haven't recorded a preliminary value of *pSurfaceFormatCount, that likely means that the application didn't
// previously call this function with a NULL value of pSurfaceFormats:
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
HandleToUint64(physicalDevice), kVUID_Core_DevLimit_MustQueryCount,
"vkGetPhysicalDeviceSurfaceFormatsKHR() called with non-NULL pSurfaceFormatCount; but no prior "
"positive value has been seen for pSurfaceFormats.");
} else {
auto prev_format_count = (uint32_t)physical_device_state->surface_formats.size();
if (*pSurfaceFormatCount > prev_format_count) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
HandleToUint64(physicalDevice), kVUID_Core_DevLimit_CountMismatch,
"vkGetPhysicalDeviceSurfaceFormatsKHR() called with non-NULL pSurfaceFormatCount, and with "
"pSurfaceFormats set to a value (%u) that is greater than the value (%u) that was returned "
"when pSurfaceFormatCount was NULL.",
*pSurfaceFormatCount, prev_format_count);
}
}
return skip;
}
bool BestPractices::PreCallValidateQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo,
VkFence fence) const {
bool skip = false;
for (uint32_t bindIdx = 0; bindIdx < bindInfoCount; bindIdx++) {
const VkBindSparseInfo& bindInfo = pBindInfo[bindIdx];
// Store sparse binding image_state and after binding is complete make sure that any requiring metadata have it bound
std::unordered_set<const IMAGE_STATE*> sparse_images;
// Track images getting metadata bound by this call in a set, it'll be recorded into the image_state
// in RecordQueueBindSparse.
std::unordered_set<const IMAGE_STATE*> sparse_images_with_metadata;
// If we're binding sparse image memory make sure reqs were queried and note if metadata is required and bound
for (uint32_t i = 0; i < bindInfo.imageBindCount; ++i) {
const auto& image_bind = bindInfo.pImageBinds[i];
auto image_state = GetImageState(image_bind.image);
if (!image_state)
continue; // Param/Object validation should report image_bind.image handles being invalid, so just skip here.
sparse_images.insert(image_state);
if (image_state->createInfo.flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) {
if (!image_state->get_sparse_reqs_called || image_state->sparse_requirements.empty()) {
// For now just warning if sparse image binding occurs without calling to get reqs first
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
HandleToUint64(image_state->image), kVUID_Core_MemTrack_InvalidState,
"vkQueueBindSparse(): Binding sparse memory to %s without first calling "
"vkGetImageSparseMemoryRequirements[2KHR]() to retrieve requirements.",
report_data->FormatHandle(image_state->image).c_str());
}
}
if (!image_state->memory_requirements_checked) {
// For now just warning if sparse image binding occurs without calling to get reqs first
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
HandleToUint64(image_state->image), kVUID_Core_MemTrack_InvalidState,
"vkQueueBindSparse(): Binding sparse memory to %s without first calling "
"vkGetImageMemoryRequirements() to retrieve requirements.",
report_data->FormatHandle(image_state->image).c_str());
}
}
for (uint32_t i = 0; i < bindInfo.imageOpaqueBindCount; ++i) {
const auto& image_opaque_bind = bindInfo.pImageOpaqueBinds[i];
auto image_state = GetImageState(bindInfo.pImageOpaqueBinds[i].image);
if (!image_state)
continue; // Param/Object validation should report image_bind.image handles being invalid, so just skip here.
sparse_images.insert(image_state);
if (image_state->createInfo.flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) {
if (!image_state->get_sparse_reqs_called || image_state->sparse_requirements.empty()) {
// For now just warning if sparse image binding occurs without calling to get reqs first
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
HandleToUint64(image_state->image), kVUID_Core_MemTrack_InvalidState,
"vkQueueBindSparse(): Binding opaque sparse memory to %s without first calling "
"vkGetImageSparseMemoryRequirements[2KHR]() to retrieve requirements.",
report_data->FormatHandle(image_state->image).c_str());
}
}
if (!image_state->memory_requirements_checked) {
// For now just warning if sparse image binding occurs without calling to get reqs first
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
HandleToUint64(image_state->image), kVUID_Core_MemTrack_InvalidState,
"vkQueueBindSparse(): Binding opaque sparse memory to %s without first calling "
"vkGetImageMemoryRequirements() to retrieve requirements.",
report_data->FormatHandle(image_state->image).c_str());
}
for (uint32_t j = 0; j < image_opaque_bind.bindCount; ++j) {
if (image_opaque_bind.pBinds[j].flags & VK_SPARSE_MEMORY_BIND_METADATA_BIT) {
sparse_images_with_metadata.insert(image_state);
}
}
}
for (const auto& sparse_image_state : sparse_images) {
if (sparse_image_state->sparse_metadata_required && !sparse_image_state->sparse_metadata_bound &&
sparse_images_with_metadata.find(sparse_image_state) == sparse_images_with_metadata.end()) {
// Warn if sparse image binding metadata required for image with sparse binding, but metadata not bound
skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
HandleToUint64(sparse_image_state->image), kVUID_Core_MemTrack_InvalidState,
"vkQueueBindSparse(): Binding sparse memory to %s which requires a metadata aspect but no "
"binding with VK_SPARSE_MEMORY_BIND_METADATA_BIT set was made.",
report_data->FormatHandle(sparse_image_state->image).c_str());
}
}
}
return skip;
}
void BestPractices::PostCallRecordQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo,
VkFence fence, VkResult result) {
if (result != VK_SUCCESS) return;
for (uint32_t bindIdx = 0; bindIdx < bindInfoCount; bindIdx++) {
const VkBindSparseInfo& bindInfo = pBindInfo[bindIdx];
for (uint32_t i = 0; i < bindInfo.imageOpaqueBindCount; ++i) {
const auto& image_opaque_bind = bindInfo.pImageOpaqueBinds[i];
auto image_state = GetImageState(bindInfo.pImageOpaqueBinds[i].image);
if (!image_state)
continue; // Param/Object validation should report image_bind.image handles being invalid, so just skip here.
for (uint32_t j = 0; j < image_opaque_bind.bindCount; ++j) {
if (image_opaque_bind.pBinds[j].flags & VK_SPARSE_MEMORY_BIND_METADATA_BIT) {
image_state->sparse_metadata_bound = true;
}
}
}
}
}
bool BestPractices::PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
const VkClearAttachment* pAttachments, uint32_t rectCount,
const VkClearRect* pRects) const {
bool skip = false;
const CMD_BUFFER_STATE* cb_node = GetCBState(commandBuffer);
if (!cb_node) return skip;
// Warn if this is issued prior to Draw Cmd and clearing the entire attachment
if (!cb_node->hasDrawCmd && (cb_node->activeRenderPassBeginInfo.renderArea.extent.width == pRects[0].rect.extent.width) &&
(cb_node->activeRenderPassBeginInfo.renderArea.extent.height == pRects[0].rect.extent.height)) {
// There are times where app needs to use ClearAttachments (generally when reusing a buffer inside of a render pass)
// This warning should be made more specific. It'd be best to avoid triggering this test if it's a use that must call
// CmdClearAttachments.
skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
HandleToUint64(commandBuffer), kVUID_Core_DrawState_ClearCmdBeforeDraw,
"vkCmdClearAttachments() issued on %s prior to any Draw Cmds. It is recommended you "
"use RenderPass LOAD_OP_CLEAR on Attachments prior to any Draw.",
report_data->FormatHandle(commandBuffer).c_str());
}
return skip;
}