File: sync_error_messages.h

package info (click to toggle)
vulkan-validationlayers 1.4.321.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,412 kB
  • sloc: cpp: 594,175; python: 11,321; sh: 24; makefile: 20; xml: 14
file content (146 lines) | stat: -rw-r--r-- 10,237 bytes parent folder | download | duplicates (5)
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
/* Copyright (c) 2025 The Khronos Group Inc.
 * Copyright (c) 2025 Valve Corporation
 * Copyright (c) 2025 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.
 */

#pragma once

#include "sync/sync_common.h"
#include "sync/sync_reporting.h"
#include <vulkan/vulkan.h>
#include <string>

class CommandBufferAccessContext;
class CommandExecutionContext;
class HazardResult;
class QueueBatchContext;
class SyncValidator;
struct Location;
struct SyncImageMemoryBarrier;

namespace vvl {
class DescriptorSet;
class Pipeline;
}  // namespace vvl

namespace syncval {

class ErrorMessages {
  public:
    explicit ErrorMessages(SyncValidator& validator);

    std::string Error(const HazardResult& hazard, const CommandExecutionContext& context, vvl::Func command,
                      const std::string& resource_description, const char* message_type,
                      const AdditionalMessageInfo& additional_info = {}) const;

    std::string BufferError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, vvl::Func command,
                            const std::string& resource_description, const ResourceAccessRange range,
                            AdditionalMessageInfo additional_info = {}) const;

    std::string BufferCopyError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, const vvl::Func command,
                                const std::string& resouce_description, uint32_t region_index, ResourceAccessRange range) const;

    std::string AccelerationStructureError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context,
                                           const vvl::Func command, const std::string& resource_description,
                                           const ResourceAccessRange range, VkAccelerationStructureKHR as,
                                           const Location& as_location) const;

    std::string ImageCopyResolveBlitError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context,
                                          vvl::Func command, const std::string& resource_description, uint32_t region_index,
                                          const VkOffset3D& offset, const VkExtent3D& extent,
                                          const VkImageSubresourceLayers& subresource) const;

    std::string ImageClearError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, vvl::Func command,
                                const std::string& resource_description, uint32_t subresource_range_index,
                                const VkImageSubresourceRange& subresource_range) const;

    std::string BufferDescriptorError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, vvl::Func command,
                                      const std::string& resource_description, const vvl::Pipeline& pipeline, uint32_t set_number,
                                      const vvl::DescriptorSet& descriptor_set, VkDescriptorType descriptor_type,
                                      uint32_t descriptor_binding, uint32_t descriptor_array_element,
                                      VkShaderStageFlagBits shader_stage) const;

    std::string ImageDescriptorError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, vvl::Func command,
                                     const std::string& resource_description, const vvl::Pipeline& pipeline, uint32_t set_number,
                                     const vvl::DescriptorSet& descriptor_set, VkDescriptorType descriptor_type,
                                     uint32_t descriptor_binding, uint32_t descriptor_array_element,
                                     VkShaderStageFlagBits shader_stage, VkImageLayout image_layout) const;

    std::string AccelerationStructureDescriptorError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context,
                                                     vvl::Func command, const std::string& resource_description,
                                                     const vvl::Pipeline& pipeline, uint32_t set_number,
                                                     const vvl::DescriptorSet& descriptor_set, VkDescriptorType descriptor_type,
                                                     uint32_t descriptor_binding, uint32_t descriptor_array_element,
                                                     VkShaderStageFlagBits shader_stage) const;

    std::string ClearAttachmentError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, vvl::Func command,
                                     const std::string& resource_description, VkImageAspectFlagBits aspect,
                                     uint32_t clear_rect_index, const VkClearRect& clear_rect) const;

    std::string RenderPassAttachmentError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context,
                                          vvl::Func command, const std::string& resource_description) const;

    std::string BeginRenderingError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, vvl::Func command,
                                    const std::string& resource_description, VkAttachmentLoadOp load_op) const;
    std::string EndRenderingResolveError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context,
                                         vvl::Func command, const std::string& resource_description,
                                         VkResolveModeFlagBits resolve_mode, bool resolve_write) const;
    std::string EndRenderingStoreError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, vvl::Func command,
                                       const std::string& resource_description, VkAttachmentStoreOp store_op) const;

    std::string RenderPassLoadOpError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, vvl::Func command,
                                      const std::string& resource_description, uint32_t subpass, uint32_t attachment,
                                      VkAttachmentLoadOp load_op, bool is_color) const;
    std::string RenderPassLoadOpVsLayoutTransitionError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context,
                                                        vvl::Func command, const std::string& resource_description,
                                                        VkAttachmentLoadOp load_op, bool is_color) const;
    std::string RenderPassResolveError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, vvl::Func command,
                                       const std::string& resource_description) const;
    std::string RenderPassStoreOpError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, vvl::Func command,
                                       const std::string& resource_description, VkAttachmentStoreOp store_op) const;

    std::string RenderPassLayoutTransitionError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context,
                                                vvl::Func command, const std::string& resource_description,
                                                VkImageLayout old_layout, VkImageLayout new_layout) const;
    std::string RenderPassLayoutTransitionVsStoreOrResolveError(const HazardResult& hazard,
                                                                const CommandBufferAccessContext& cb_context, vvl::Func command,
                                                                const std::string& resource_description, VkImageLayout old_layout,
                                                                VkImageLayout new_layout, uint32_t store_resolve_subpass) const;
    std::string RenderPassFinalLayoutTransitionError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context,
                                                     vvl::Func command, const std::string& resource_description,
                                                     VkImageLayout old_layout, VkImageLayout new_layout) const;
    std::string RenderPassFinalLayoutTransitionVsStoreOrResolveError(const HazardResult& hazard,
                                                                     const CommandBufferAccessContext& cb_context,
                                                                     vvl::Func command, const std::string& resource_description,
                                                                     VkImageLayout old_layout, VkImageLayout new_layout,
                                                                     uint32_t store_resolve_subpass) const;

    std::string ImageBarrierError(const HazardResult& hazard, const CommandExecutionContext& context, vvl::Func command,
                                  const std::string& resource_description, const SyncImageMemoryBarrier& barrier) const;

    std::string FirstUseError(const HazardResult& hazard, const CommandExecutionContext& exec_context,
                              const CommandBufferAccessContext& recorded_context, uint32_t command_buffer_index) const;

    std::string PresentError(const HazardResult& hazard, const QueueBatchContext& batch_context, vvl::Func command,
                             const std::string& resource_description, uint32_t swapchain_index) const;

    std::string VideoError(const HazardResult& hazard, const CommandBufferAccessContext& cb_context, vvl::Func command,
                           const std::string& resource_description) const;

  private:
    SyncValidator& validator_;
};

}  // namespace syncval