MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / QueuePresentKHR

Function QueuePresentKHR

layers/chassis/chassis_manual.cpp:1148–1212  ·  view source on GitHub ↗

This API needs to ensure that per-swapchain VkResult results are available

Source from the content-addressed store, hash-verified

1146
1147// This API needs to ensure that per-swapchain VkResult results are available
1148VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) {
1149 VVL_ZoneScoped;
1150
1151 auto device_dispatch = vvl::GetDispatchDevice(queue);
1152 bool skip = false;
1153 ErrorObject error_obj(vvl::Func::vkQueuePresentKHR, VulkanTypedHandle(queue, kVulkanObjectTypeQueue));
1154 {
1155 VVL_ZoneScopedN("PreCallValidate_QueuePresentKHR");
1156 for (const auto& vo : device_dispatch->intercept_vectors[InterceptIdPreCallValidateQueuePresentKHR]) {
1157 if (!vo) {
1158 continue;
1159 }
1160 auto lock = vo->ReadLock();
1161 skip |= vo->PreCallValidateQueuePresentKHR(queue, pPresentInfo, error_obj);
1162 if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
1163 }
1164 }
1165 RecordObject record_obj(vvl::Func::vkQueuePresentKHR);
1166 {
1167 VVL_ZoneScopedN("PreCallRecord_QueuePresentKHR");
1168 for (auto& vo : device_dispatch->intercept_vectors[InterceptIdPreCallRecordQueuePresentKHR]) {
1169 if (!vo) {
1170 continue;
1171 }
1172 auto lock = vo->WriteLock();
1173 vo->PreCallRecordQueuePresentKHR(queue, pPresentInfo, record_obj);
1174 }
1175 }
1176
1177 // Track per-swapchain results when there is more than one swapchain and VkPresentInfoKHR::pResults is null
1178 small_vector<VkResult, 2> present_results;
1179 VkPresentInfoKHR modified_present_info;
1180 if (pPresentInfo && pPresentInfo->swapchainCount > 1 && pPresentInfo->pResults == nullptr) {
1181 present_results.resize(pPresentInfo->swapchainCount);
1182 modified_present_info = *pPresentInfo;
1183 modified_present_info.pResults = present_results.data();
1184 pPresentInfo = &modified_present_info;
1185 }
1186
1187 VkResult result;
1188 {
1189 VVL_ZoneScopedN("Dispatch_QueuePresentKHR");
1190 result = device_dispatch->QueuePresentKHR(queue, pPresentInfo);
1191 }
1192 VVL_TracyCFrameMark;
1193#if defined(VVL_TRACY_GPU)
1194 TracyVkCollector::GetTracyVkCollector(queue).Collect();
1195#endif
1196 record_obj.result = result;
1197 {
1198 VVL_ZoneScopedN("PostCallRecord_QueuePresentKHR");
1199 for (auto& vo : device_dispatch->intercept_vectors[InterceptIdPostCallRecordQueuePresentKHR]) {
1200 if (!vo) {
1201 continue;
1202 }
1203 auto lock = vo->WriteLock();
1204
1205 if (result == VK_ERROR_DEVICE_LOST) {

Callers 3

PresentMethod · 0.50
TEST_FFunction · 0.50
TEST_FFunction · 0.50

Calls 11

GetDispatchDeviceFunction · 0.85
VulkanTypedHandleClass · 0.85
QueuePresentKHRMethod · 0.80
CollectMethod · 0.80
ReadLockMethod · 0.45
WriteLockMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected