MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / DrawEnd

Method DrawEnd

Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.cpp:897–957  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

895}
896
897void GPUDeviceDX11::DrawEnd()
898{
899 GPUDeviceDX::DrawEnd();
900
901#if GPU_ENABLE_DIAGNOSTICS && LOG_ENABLE
902 // Flush debug messages queue
903 ComPtr<ID3D11InfoQueue> infoQueue;
904 VALIDATE_DIRECTX_CALL(_device->QueryInterface(IID_PPV_ARGS(&infoQueue)));
905 if (infoQueue)
906 {
907 Array<uint8> data;
908 const uint64 messagesCount = infoQueue->GetNumStoredMessagesAllowedByRetrievalFilter();
909 for (uint64 i = 0; i < messagesCount; i++)
910 {
911 SIZE_T length = 0;
912 if (SUCCEEDED(infoQueue->GetMessage(i, nullptr, &length)))
913 {
914 data.Resize((int32)length);
915 auto messageData = (D3D11_MESSAGE*)data.Get();
916 if (SUCCEEDED(infoQueue->GetMessage(i, messageData, &length)))
917 {
918 LogType logType;
919 switch (messageData->Severity)
920 {
921 case D3D11_MESSAGE_SEVERITY_CORRUPTION:
922 logType = LogType::Fatal;
923 break;
924 case D3D11_MESSAGE_SEVERITY_ERROR:
925 logType = LogType::Error;
926 break;
927 case D3D11_MESSAGE_SEVERITY_WARNING:
928 logType = LogType::Warning;
929 break;
930 case D3D11_MESSAGE_SEVERITY_INFO:
931 case D3D11_MESSAGE_SEVERITY_MESSAGE:
932 default:
933 logType = LogType::Info;
934 break;
935 }
936 Log::Logger::Write(logType, String(messageData->pDescription));
937 }
938 }
939 }
940 infoQueue->ClearStoredMessages();
941 }
942#endif
943
944 // Auto-return finished queries back to the pool
945 auto* queries = _queries.Get();
946 int32 queriesCount = _queries.Count();
947 for (int32 i = 0; i < queriesCount; i++)
948 {
949 auto& query = queries[i];
950 if (query.State == GPUQueryDataDX11::Finished)
951 {
952 query.State = GPUQueryDataDX11::Ready;
953 query.Result = 0;
954 _readyQueries[(int32)query.Type].Push(i);

Callers

nothing calls this directly

Calls 8

GetMessageMethod · 0.80
WriteFunction · 0.50
StringClass · 0.50
QueryInterfaceMethod · 0.45
ResizeMethod · 0.45
GetMethod · 0.45
CountMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected