|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
17 | | -#include "containers/custom_containers.h" |
18 | 17 | #include "containers/limits.h" |
19 | 18 | #include "gpu_dump_state.h" |
20 | 19 | #include "gpu_dump.h" |
|
36 | 35 | #include "state_tracker/shader_object_state.h" |
37 | 36 | #include "state_tracker/shader_stage_state.h" |
38 | 37 | #include "state_tracker/state_tracker.h" |
| 38 | +#include "utils/vk_api_utils.h" |
39 | 39 |
|
40 | 40 | namespace gpudump { |
41 | 41 |
|
42 | | -static size_t GetDescriptorBufferSize(const VkPhysicalDeviceDescriptorBufferPropertiesEXT& props, bool robust, |
43 | | - VkDescriptorType type) { |
44 | | - switch (type) { |
45 | | - case VK_DESCRIPTOR_TYPE_SAMPLER: |
46 | | - return props.samplerDescriptorSize; |
47 | | - case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: |
48 | | - return props.combinedImageSamplerDescriptorSize; |
49 | | - case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: |
50 | | - return props.sampledImageDescriptorSize; |
51 | | - case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: |
52 | | - return props.storageImageDescriptorSize; |
53 | | - case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: |
54 | | - return robust ? props.robustUniformTexelBufferDescriptorSize : props.uniformTexelBufferDescriptorSize; |
55 | | - case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: |
56 | | - return robust ? props.robustStorageTexelBufferDescriptorSize : props.storageTexelBufferDescriptorSize; |
57 | | - case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: |
58 | | - return robust ? props.robustUniformBufferDescriptorSize : props.uniformBufferDescriptorSize; |
59 | | - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: |
60 | | - return robust ? props.robustStorageBufferDescriptorSize : props.storageBufferDescriptorSize; |
61 | | - case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: |
62 | | - return props.inputAttachmentDescriptorSize; |
63 | | - case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR: |
64 | | - return props.accelerationStructureDescriptorSize; |
65 | | - default: |
66 | | - break; |
67 | | - } |
68 | | - return 0; |
69 | | -} |
70 | | - |
71 | | -static const char* DescribeDescriptorBufferSize(bool robust, VkDescriptorType type) { |
72 | | - switch (type) { |
73 | | - case VK_DESCRIPTOR_TYPE_SAMPLER: |
74 | | - return "samplerDescriptorSize"; |
75 | | - case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: |
76 | | - return "combinedImageSamplerDescriptorSize"; |
77 | | - case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: |
78 | | - return "sampledImageDescriptorSize"; |
79 | | - case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: |
80 | | - return "storageImageDescriptorSize"; |
81 | | - case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: |
82 | | - return robust ? "robustUniformTexelBufferDescriptorSize" : "uniformTexelBufferDescriptorSize"; |
83 | | - case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: |
84 | | - return robust ? "robustStorageTexelBufferDescriptorSize" : "storageTexelBufferDescriptorSize"; |
85 | | - case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: |
86 | | - return robust ? "robustUniformBufferDescriptorSize" : "uniformBufferDescriptorSize"; |
87 | | - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: |
88 | | - return robust ? "robustStorageBufferDescriptorSize" : "storageBufferDescriptorSize"; |
89 | | - case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: |
90 | | - return "inputAttachmentDescriptorSize"; |
91 | | - case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR: |
92 | | - return "accelerationStructureDescriptorSize"; |
93 | | - default: |
94 | | - break; |
95 | | - } |
96 | | - return "[Unknown]"; |
97 | | -} |
98 | | - |
99 | 42 | void CommandBufferSubState::DumpDescriptorBuffer(std::ostringstream& ss, const LastBound& last_bound) const { |
100 | 43 | const vvl::CommandBuffer& cb_state = last_bound.cb_state; |
101 | 44 | ss << "vkCmdBindDescriptorBuffersEXT last bound the following descriptor buffers:\n"; |
|
0 commit comments