15#include <vsg/core/Inherit.h>
16#include <vsg/core/Version.h>
17#include <vsg/io/Logger.h>
18#include <vsg/maths/vec4.h>
31 uint8_t b = 255, g = 255, r = 255, a = 255;
33 constexpr uint_color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) :
34 b(blue), g(green), r(red), a(alpha) {}
57 virtual void setThreadName(
const std::string& )
const {};
71 virtual void finish()
const {};
89 instr(in_instr), sl(in_sl), reference(0), object(in_object)
91 if (instr) instr->enter(sl, reference,
object);
95 if (instr) instr->leave(sl, reference,
object);
108 instr(in_instr), sl(in_sl), reference(0), commandBuffer(in_commandBuffer), object(in_object)
110 if (instr) instr->enter(sl, reference, commandBuffer,
object);
114 if (instr) instr->leave(sl, reference, commandBuffer,
object);
126 instr(in_instr), sl(in_sl), reference(0), commandBuffer(in_commandBuffer)
128 if (instr) instr->enterCommandBuffer(sl, reference, commandBuffer);
132 if (instr) instr->leaveCommandBuffer(sl, reference, commandBuffer);
137#define COLOR_DEFAULT vsg::uint_color(255, 255, 255, 255)
138#define COLOR_VIEWER vsg::uint_color(127, 240, 240, 255)
139#define COLOR_UPDATE vsg::uint_color(0, 255, 0, 255)
140#define COLOR_GPU vsg::uint_color(255, 127, 0, 255)
141#define COLOR_RECORD_L1 vsg::uint_color(140, 247, 0, 255)
142#define COLOR_RECORD_L2 vsg::uint_color(176, 176, 0, 255)
143#define COLOR_RECORD_L3 COLOR_GPU
144#define COLOR_RECORD COLOR_RECORD_L1
145#define COLOR_COMPILE vsg::uint_color(255, 249, 64, 255)
146#define COLOR_PAGER vsg::uint_color(240, 255, 64, 255)
147#define COLOR_READ vsg::uint_color(0, 255, 128, 255)
148#define COLOR_WRITE vsg::uint_color(0, 128, 255, 255)
150#if defined(__clang__) || defined(__GNUC__)
151# define VsgFunctionName __PRETTY_FUNCTION__
152#elif defined(_MSC_VER)
153# define VsgFunctionName __FUNCSIG__
156#define __CPU_INSTRUMENTATION(level, instrumentation, name, color, object) \
157 static constexpr vsg::SourceLocation s_cpu_source_location_##__LINE__{name, VsgFunctionName, __FILE__, __LINE__, color, level}; \
158 vsg::CpuInstrumentation __cpu_scoped_instrumentation_##__LINE__(instrumentation, &(s_cpu_source_location_##__LINE__), object);
160#define __GPU_INSTRUMENTATION(level, instrumentation, cg, name, color, object) \
161 static constexpr vsg::SourceLocation s_gpu_source_location_##__LINE__{name, VsgFunctionName, __FILE__, __LINE__, color, level}; \
162 vsg::GpuInstrumentation __gpu_scoped_instrumentation_##__LINE__(instrumentation, &(s_gpu_source_location_##__LINE__), cg, object);
164#define __COMMAND_BUFFER_INSTRUMENTATION(level, instrumentation, cg, name, color) \
165 static constexpr vsg::SourceLocation s_cg_source_location_##__LINE__{name, VsgFunctionName, __FILE__, __LINE__, color, level}; \
166 vsg::CommandBufferInstrumentation __cg_scoped_instrumentation_##__LINE__(instrumentation, &(s_cg_source_location_##__LINE__), cg);
168#if VSG_MAX_INSTRUMENTATION_LEVEL >= 1
170# define CPU_INSTRUMENTATION_L1(instrumentation) __CPU_INSTRUMENTATION(1, instrumentation, nullptr, COLOR_DEFAULT, nullptr)
171# define CPU_INSTRUMENTATION_L1_N(instrumentation, name) __CPU_INSTRUMENTATION(1, instrumentation, name, COLOR_DEFAULT, nullptr)
172# define CPU_INSTRUMENTATION_L1_C(instrumentation, color) __CPU_INSTRUMENTATION(1, instrumentation, nullptr, color, nullptr)
173# define CPU_INSTRUMENTATION_L1_NC(instrumentation, name, color) __CPU_INSTRUMENTATION(1, instrumentation, name, color, nullptr)
175# define GPU_INSTRUMENTATION_L1(instrumentation, cg) __GPU_INSTRUMENTATION(1, instrumentation, cg, nullptr, COLOR_DEFAULT, nullptr)
176# define GPU_INSTRUMENTATION_L1_N(instrumentation, cg, name) __GPU_INSTRUMENTATION(1, instrumentation, cg, name, COLOR_DEFAULT, nullptr)
177# define GPU_INSTRUMENTATION_L1_C(instrumentation, cg, color) __GPU_INSTRUMENTATION(1, instrumentation, cg, nullptr, color, nullptr)
178# define GPU_INSTRUMENTATION_L1_NC(instrumentation, cg, name, color) __GPU_INSTRUMENTATION(1, instrumentation, cg, name, color, nullptr)
180# define CPU_INSTRUMENTATION_L1_O(instrumentation, object) __CPU_INSTRUMENTATION(1, instrumentation, nullptr, COLOR_DEFAULT, object)
181# define CPU_INSTRUMENTATION_L1_NO(instrumentation, name, object) __CPU_INSTRUMENTATION(1, instrumentation, name, COLOR_DEFAULT, object)
182# define CPU_INSTRUMENTATION_L1_CO(instrumentation, color, object) __CPU_INSTRUMENTATION(1, instrumentation, nullptr, color, object)
183# define CPU_INSTRUMENTATION_L1_NCO(instrumentation, name, color, object) __CPU_INSTRUMENTATION(1, instrumentation, name, color, object)
185# define GPU_INSTRUMENTATION_L1_O(instrumentation, cg, object) __GPU_INSTRUMENTATION(1, instrumentation, cg, nullptr, COLOR_DEFAULT, object)
186# define GPU_INSTRUMENTATION_L1_NO(instrumentation, cg, name, object) __GPU_INSTRUMENTATION(1, instrumentation, cg, name, COLOR_DEFAULT, object)
187# define GPU_INSTRUMENTATION_L1_CO(instrumentation, cg, color, object) __GPU_INSTRUMENTATION(1, instrumentation, cg, nullptr, color, object)
188# define GPU_INSTRUMENTATION_L1_NCO(instrumentation, cg, name, color, object) __GPU_INSTRUMENTATION(1, instrumentation, cg, name, color, object)
190# define COMMAND_BUFFER_INSTRUMENTATION(instrumentation, cg, name, color) __COMMAND_BUFFER_INSTRUMENTATION(1, instrumentation, cg, name, color)
194# define CPU_INSTRUMENTATION_L1(instrumentation)
195# define CPU_INSTRUMENTATION_L1_N(instrumentation, name)
196# define CPU_INSTRUMENTATION_L1_C(instrumentation, color)
197# define CPU_INSTRUMENTATION_L1_NC(instrumentation, name, color)
199# define GPU_INSTRUMENTATION_L1(instrumentation, cg)
200# define GPU_INSTRUMENTATION_L1_N(instrumentation, cg, name)
201# define GPU_INSTRUMENTATION_L1_C(instrumentation, cg, color)
202# define GPU_INSTRUMENTATION_L1_NC(instrumentation, cg, name, color)
204# define CPU_INSTRUMENTATION_L1_O(instrumentation, object)
205# define CPU_INSTRUMENTATION_L1_NO(instrumentation, name, object)
206# define CPU_INSTRUMENTATION_L1_CO(instrumentation, color, object)
207# define CPU_INSTRUMENTATION_L1_NCO(instrumentation, name, color, object)
209# define GPU_INSTRUMENTATION_L1_O(instrumentation, cg, object)
210# define GPU_INSTRUMENTATION_L1_NO(instrumentation, cg, name, object)
211# define GPU_INSTRUMENTATION_L1_CO(instrumentation, cg, color, object)
212# define GPU_INSTRUMENTATION_L1_NCO(instrumentation, cg, name, color, object)
214# define COMMAND_BUFFER_INSTRUMENTATION(instrumentation, cg, name, color)
218#if VSG_MAX_INSTRUMENTATION_LEVEL >= 2
220# define CPU_INSTRUMENTATION_L2(instrumentation) __CPU_INSTRUMENTATION(2, instrumentation, nullptr, COLOR_DEFAULT, nullptr)
221# define CPU_INSTRUMENTATION_L2_N(instrumentation, name) __CPU_INSTRUMENTATION(2, instrumentation, name, COLOR_DEFAULT, nullptr)
222# define CPU_INSTRUMENTATION_L2_C(instrumentation, color) __CPU_INSTRUMENTATION(2, instrumentation, nullptr, color, nullptr)
223# define CPU_INSTRUMENTATION_L2_NC(instrumentation, name, color) __CPU_INSTRUMENTATION(2, instrumentation, name, color, nullptr)
225# define GPU_INSTRUMENTATION_L2(instrumentation, cg) __GPU_INSTRUMENTATION(2, instrumentation, cg, nullptr, COLOR_DEFAULT, nullptr)
226# define GPU_INSTRUMENTATION_L2_N(instrumentation, cg, name) __GPU_INSTRUMENTATION(2, instrumentation, cg, name, COLOR_DEFAULT, nullptr)
227# define GPU_INSTRUMENTATION_L2_C(instrumentation, cg, color) __GPU_INSTRUMENTATION(2, instrumentation, cg, nullptr, color, nullptr)
228# define GPU_INSTRUMENTATION_L2_NC(instrumentation, cg, name, color) __GPU_INSTRUMENTATION(2, instrumentation, cg, name, color, nullptr)
230# define CPU_INSTRUMENTATION_L2_O(instrumentation, object) __CPU_INSTRUMENTATION(2, instrumentation, nullptr, COLOR_DEFAULT, object)
231# define CPU_INSTRUMENTATION_L2_NO(instrumentation, name, object) __CPU_INSTRUMENTATION(2, instrumentation, name, COLOR_DEFAULT, object)
232# define CPU_INSTRUMENTATION_L2_CO(instrumentation, color, object) __CPU_INSTRUMENTATION(2, instrumentation, nullptr, color, object)
233# define CPU_INSTRUMENTATION_L2_NCO(instrumentation, name, color, object) __CPU_INSTRUMENTATION(2, instrumentation, name, color, object)
235# define GPU_INSTRUMENTATION_L2_O(instrumentation, cg, object) __GPU_INSTRUMENTATION(2, instrumentation, cg, nullptr, COLOR_DEFAULT, object)
236# define GPU_INSTRUMENTATION_L2_NO(instrumentation, cg, name, object) __GPU_INSTRUMENTATION(2, instrumentation, cg, name, COLOR_DEFAULT, object)
237# define GPU_INSTRUMENTATION_L2_CO(instrumentation, cg, color, object) __GPU_INSTRUMENTATION(2, instrumentation, cg, nullptr, color, object)
238# define GPU_INSTRUMENTATION_L2_NCO(instrumentation, cg, name, color, object) __GPU_INSTRUMENTATION(2, instrumentation, cg, name, color, object)
242# define CPU_INSTRUMENTATION_L2(instrumentation)
243# define CPU_INSTRUMENTATION_L2_N(instrumentation, name)
244# define CPU_INSTRUMENTATION_L2_C(instrumentation, color)
245# define CPU_INSTRUMENTATION_L2_NC(instrumentation, name, color)
247# define GPU_INSTRUMENTATION_L2(instrumentation, cg)
248# define GPU_INSTRUMENTATION_L2_N(instrumentation, cg, name)
249# define GPU_INSTRUMENTATION_L2_C(instrumentation, cg, color)
250# define GPU_INSTRUMENTATION_L2_NC(instrumentation, cg, name, color)
252# define CPU_INSTRUMENTATION_L2_O(instrumentation, object)
253# define CPU_INSTRUMENTATION_L2_NO(instrumentation, name, object)
254# define CPU_INSTRUMENTATION_L2_CO(instrumentation, color, object)
255# define CPU_INSTRUMENTATION_L2_NCO(instrumentation, name, color, object)
257# define GPU_INSTRUMENTATION_L2_O(instrumentation, cg, object)
258# define GPU_INSTRUMENTATION_L2_NO(instrumentation, cg, name, object)
259# define GPU_INSTRUMENTATION_L2_CO(instrumentation, cg, color, object)
260# define GPU_INSTRUMENTATION_L2_NCO(instrumentation, cg, name, color, object)
264#if VSG_MAX_INSTRUMENTATION_LEVEL >= 3
266# define CPU_INSTRUMENTATION_L3(instrumentation) __CPU_INSTRUMENTATION(3, instrumentation, nullptr, COLOR_DEFAULT, nullptr)
267# define CPU_INSTRUMENTATION_L3_N(instrumentation, name) __CPU_INSTRUMENTATION(3, instrumentation, name, COLOR_DEFAULT, nullptr)
268# define CPU_INSTRUMENTATION_L3_C(instrumentation, color) __CPU_INSTRUMENTATION(3, instrumentation, nullptr, color, nullptr)
269# define CPU_INSTRUMENTATION_L3_NC(instrumentation, name, color) __CPU_INSTRUMENTATION(3, instrumentation, name, color, nullptr)
271# define GPU_INSTRUMENTATION_L3(instrumentation, cg) __GPU_INSTRUMENTATION(3, instrumentation, cg, nullptr, COLOR_DEFAULT, nullptr)
272# define GPU_INSTRUMENTATION_L3_N(instrumentation, cg, name) __GPU_INSTRUMENTATION(3, instrumentation, cg, name, COLOR_DEFAULT, nullptr)
273# define GPU_INSTRUMENTATION_L3_C(instrumentation, cg, color) __GPU_INSTRUMENTATION(3, instrumentation, cg, nullptr, color, nullptr)
274# define GPU_INSTRUMENTATION_L3_NC(instrumentation, cg, name, color) __GPU_INSTRUMENTATION(3, instrumentation, cg, name, color, nullptr)
276# define CPU_INSTRUMENTATION_L3_O(instrumentation, object) __CPU_INSTRUMENTATION(3, instrumentation, nullptr, COLOR_DEFAULT, object)
277# define CPU_INSTRUMENTATION_L3_NO(instrumentation, name, object) __CPU_INSTRUMENTATION(3, instrumentation, name, COLOR_DEFAULT, object)
278# define CPU_INSTRUMENTATION_L3_CO(instrumentation, color, object) __CPU_INSTRUMENTATION(3, instrumentation, nullptr, color, object)
279# define CPU_INSTRUMENTATION_L3_NCO(instrumentation, name, color, object) __CPU_INSTRUMENTATION(3, instrumentation, name, color, object)
281# define GPU_INSTRUMENTATION_L3_O(instrumentation, cg, object) __GPU_INSTRUMENTATION(3, instrumentation, cg, nullptr, COLOR_DEFAULT, object)
282# define GPU_INSTRUMENTATION_L3_NO(instrumentation, cg, name, object) __GPU_INSTRUMENTATION(3, instrumentation, cg, name, COLOR_DEFAULT, object)
283# define GPU_INSTRUMENTATION_L3_CO(instrumentation, cg, color, object) __GPU_INSTRUMENTATION(3, instrumentation, cg, nullptr, color, object)
284# define GPU_INSTRUMENTATION_L3_NCO(instrumentation, cg, name, color, object) __GPU_INSTRUMENTATION(3, instrumentation, cg, name, color, object)
288# define CPU_INSTRUMENTATION_L3(instrumentation)
289# define CPU_INSTRUMENTATION_L3_N(instrumentation, name)
290# define CPU_INSTRUMENTATION_L3_C(instrumentation, color)
291# define CPU_INSTRUMENTATION_L3_NC(instrumentation, name, color)
293# define GPU_INSTRUMENTATION_L3(instrumentation, cg)
294# define GPU_INSTRUMENTATION_L3_N(instrumentation, cg, name)
295# define GPU_INSTRUMENTATION_L3_C(instrumentation, cg, color)
296# define GPU_INSTRUMENTATION_L3_NC(instrumentation, cg, name, color)
298# define CPU_INSTRUMENTATION_L3_O(instrumentation, object)
299# define CPU_INSTRUMENTATION_L3_NO(instrumentation, name, object)
300# define CPU_INSTRUMENTATION_L3_CO(instrumentation, color, object)
301# define CPU_INSTRUMENTATION_L3_NCO(instrumentation, name, color, object)
303# define GPU_INSTRUMENTATION_L3_O(instrumentation, cg, object)
304# define GPU_INSTRUMENTATION_L3_NO(instrumentation, cg, name, object)
305# define GPU_INSTRUMENTATION_L3_CO(instrumentation, cg, color, object)
306# define GPU_INSTRUMENTATION_L3_NCO(instrumentation, cg, name, color, object)
CommandBuffer encapsulates VkCommandBuffer.
Definition CommandBuffer.h:27
FrameStamp represents the time and frame count of a specific frame.
Definition FrameStamp.h:22
base class for Instrumentation implentations
Definition Instrumentation.h:51
Definition Instrumentation.h:119
Definition Instrumentation.h:82
Definition Instrumentation.h:100
Definition Instrumentation.h:40
uint_color struct used to provide a {r, g, b, a} interface a colors assigned as uint32_t
Definition Instrumentation.h:29