VPP  0.8
A high-level modern C++ API for Vulkan
vppDebugReporter.hpp
1 /*
2  Copyright 2016-2018 SOFT-ERG, Przemek Kuczmierczyk (www.softerg.com)
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without modification,
6  are permitted provided that the following conditions are met:
7 
8  1. Redistributions of source code must retain the above copyright notice,
9  this list of conditions and the following disclaimer.
10 
11  2. Redistributions in binary form must reproduce the above copyright notice,
12  this list of conditions and the following disclaimer in the documentation
13  and/or other materials provided with the distribution.
14 
15  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26 
27 // -----------------------------------------------------------------------------
28 namespace vpp {
29 // -----------------------------------------------------------------------------
30 
56 {
57 public:
61  enum
62  {
65  PERF,
66  INFO,
69  };
70 
74  DebugReporter ( const Instance& hInstance );
75 
79  DebugReporter ( const Instance& hInstance, VkFlags flags );
80 
84  virtual VkBool32 debugReport (
85  VkDebugReportFlagsEXT flags,
86  VkDebugReportObjectTypeEXT objectType,
87  uint64_t object,
88  size_t location,
89  int32_t messageCode,
90  const char* pLayerPrefix,
91  const char* pMessage );
92 
96  virtual void shaderCompilationLog (
97  const std::string& shaderCode,
98  const char* pShaderType );
99 };
100 
101 // -----------------------------------------------------------------------------
107 {
108 public:
113  std::ostream& out, const Instance& hInstance );
114 
119  std::ostream& out, const Instance& hInstance, VkFlags flags );
120 };
121 
122 // -----------------------------------------------------------------------------
123 } // namespace vpp
124 // -----------------------------------------------------------------------------
Include information messages.
Definition: vppDebugReporter.hpp:66
Include error messages.
Definition: vppDebugReporter.hpp:63
StreamDebugReporter(std::ostream &out, const Instance &hInstance)
Constructs the debug reporter with default flags.
The VPP namespace.
Definition: main.hpp:1
Include shader translation dumps.
Definition: vppDebugReporter.hpp:68
Base class for debug report generators.
Definition: vppDebugReporter.hpp:55
Include debug messages.
Definition: vppDebugReporter.hpp:67
virtual VkBool32 debugReport(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char *pLayerPrefix, const char *pMessage)
Override this method for custom message processing.
Represents the instance of Vulkan system.
Definition: vppInstance.hpp:115
A debug reporter class working with C++ output streams.
Definition: vppDebugReporter.hpp:106
Include warning messages.
Definition: vppDebugReporter.hpp:64
Include performance messages.
Definition: vppDebugReporter.hpp:65
virtual void shaderCompilationLog(const std::string &shaderCode, const char *pShaderType)
Override this method for custom handling of shader translation dumps.
DebugReporter(const Instance &hInstance)
Constructs the debug reporter with default flags.