Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
03213a9
Added vsgtracyinstrumentation example to demonstrate use of Tracy + s…
robertosfield Dec 17, 2023
b7eb552
Added handling of TRACY_ON_DEMAND being enabled/disabled
robertosfield Dec 18, 2023
2e43bdb
Added --cpu <level> and --gpu <level> command line controls to vsgtra…
robertosfield Dec 18, 2023
be7c188
Added runtime adjustment of cpu and gpu_instrumentation_levels
robertosfield Dec 19, 2023
d689eea
Updates to work with latest vsg::TracyInstrumentation changes and ena…
robertosfield Dec 20, 2023
d33eafb
Added support for building against Tracy version without TRACY_ENABLE
robertosfield Dec 21, 2023
5b18c37
Added GpuAnnotation support to vsgviewer
robertosfield Dec 21, 2023
e381339
Added support for selecting SourceLocation::function as the label for…
robertosfield Dec 21, 2023
16b21c1
Added TracyInstrumentation and GpuAnnoation support to vsgshadow
robertosfield Dec 21, 2023
cf7c261
Added TracyInstrumentation and GpuAnnoation to vsgshadow
robertosfield Dec 21, 2023
2cacda9
Merge branch 'master' into Instrumentation
robertosfield Dec 27, 2023
158a82c
Merge branch 'master' into Instrumentation
robertosfield Jan 4, 2024
678376d
Merge branch 'master' into Instrumentation
robertosfield Jan 4, 2024
cc8444c
Bumped version to 1.1.1
robertosfield Jan 4, 2024
212308f
Added --calibrated command line parameter and setup of required exten…
robertosfield Jan 5, 2024
5a7e25a
Added support for vsg::InstrumentationNode
robertosfield Jan 8, 2024
6fc5f87
Added test of vsg::InstrumentationNode
robertosfield Jan 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.7)

project(vsgExamples
VERSION 1.1.0
VERSION 1.1.1
DESCRIPTION "Set of example programs that test and illustrate how to use the VulkanSceneGraph"
LANGUAGES CXX C
)
Expand All @@ -21,7 +21,7 @@ if (VULKAN_SDK)
set(ENV{VULKAN_SDK} ${VULKAN_SDK})
endif()

find_package(vsg 1.1.0)
find_package(vsg 1.1.1)

vsg_setup_dir_vars()
vsg_setup_build_vars()
Expand All @@ -32,6 +32,8 @@ find_package(vsgXchange 1.0.5 QUIET)
# find the optional vsgImGui that can be used for GUI elements added into graphics windows.
find_package(vsgImGui QUIET)

find_package(Tracy QUIET)

# set the use of C++17 globally as all examples require it
set(CMAKE_CXX_STANDARD 17)

Expand Down
16 changes: 16 additions & 0 deletions examples/app/vsgviewer/vsgviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ int main(int argc, char** argv)

if (int log_level = 0; arguments.read("--log-level", log_level)) vsg::Logger::instance()->level = vsg::Logger::Level(log_level);

vsg::ref_ptr<vsg::Instrumentation> instrumentation;
if (arguments.read({"--gpu-annotation", "--ga"}) && vsg::isExtensionSupported(VK_EXT_DEBUG_UTILS_EXTENSION_NAME))
{
windowTraits->debugUtils = true;

auto gpu_instrumentation = vsg::GpuAnnotation::create();
if (arguments.read("--name")) gpu_instrumentation->labelType = vsg::GpuAnnotation::SourceLocation_name;
else if (arguments.read("--className")) gpu_instrumentation->labelType = vsg::GpuAnnotation::Object_className;
else if (arguments.read("--func")) gpu_instrumentation->labelType = vsg::GpuAnnotation::SourceLocation_function;

instrumentation = gpu_instrumentation;
}


if (arguments.errors()) return arguments.writeErrorMessages(std::cerr);

if (argc <= 1)
Expand Down Expand Up @@ -227,6 +241,8 @@ int main(int argc, char** argv)
auto commandGraph = vsg::createCommandGraphForView(window, camera, vsg_scene);
viewer->assignRecordAndSubmitTaskAndPresentation({commandGraph});

if (instrumentation) viewer->assignInstrumentation(instrumentation);

viewer->compile();

if (maxPagedLOD > 0)
Expand Down
5 changes: 5 additions & 0 deletions examples/nodes/vsgshadow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ if (vsgXchange_FOUND)
target_link_libraries(vsgshadow vsgXchange::vsgXchange)
endif()

if (Tracy_FOUND)
target_compile_definitions(vsgshadow PRIVATE Tracy_FOUND)
target_link_libraries(vsgshadow Tracy::TracyClient)
endif()

install(TARGETS vsgshadow RUNTIME DESTINATION bin)
28 changes: 28 additions & 0 deletions examples/nodes/vsgshadow/vsgshadow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# include <vsgXchange/all.h>
#endif

#ifdef Tracy_FOUND
# include <vsg/utils/TracyInstrumentation.h>
#endif

#include <iostream>

struct ModelSettings
Expand Down Expand Up @@ -210,6 +214,28 @@ int main(int argc, char** argv)
windowTraits->decoration = false;
}

vsg::ref_ptr<vsg::Instrumentation> instrumentation;
if (arguments.read({"--gpu-annotation", "--ga"}) && vsg::isExtensionSupported(VK_EXT_DEBUG_UTILS_EXTENSION_NAME))
{
windowTraits->debugUtils = true;

auto gpu_instrumentation = vsg::GpuAnnotation::create();
if (arguments.read("--func")) gpu_instrumentation->labelType = vsg::GpuAnnotation::SourceLocation_function;

instrumentation = gpu_instrumentation;
}
#ifdef Tracy_FOUND
else if (arguments.read("--tracy"))
{
windowTraits->deviceExtensionNames.push_back(VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME);

auto tracy_instrumentation = vsg::TracyInstrumentation::create();
arguments.read("--cpu", tracy_instrumentation->settings->cpu_instumentation_level);
arguments.read("--gpu", tracy_instrumentation->settings->gpu_instumentation_level);
instrumentation = tracy_instrumentation;
}
#endif

double maxShadowDistance = arguments.value<double>(1e8, "--sd");
double shadowMapBias = arguments.value<double>(0.005, "--sb");
double lambda = arguments.value<double>(0.5, "--lambda");
Expand Down Expand Up @@ -523,6 +549,8 @@ int main(int argc, char** argv)
auto commandGraph = vsg::CommandGraph::create(window, renderGraph);
viewer->assignRecordAndSubmitTaskAndPresentation({commandGraph});

if (instrumentation) viewer->assignInstrumentation(instrumentation);

viewer->compile(resourceHints);

auto startTime = vsg::clock::now();
Expand Down
4 changes: 4 additions & 0 deletions examples/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ add_subdirectory(vsgshaderset)
add_subdirectory(vsgintersection)
add_subdirectory(vsgstoragebuffer)
add_subdirectory(vsgcustomshaderset)

if (Tracy_FOUND)
add_subdirectory(vsgtracyinstrumentation)
endif()
14 changes: 14 additions & 0 deletions examples/utils/vsgtracyinstrumentation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set(SOURCES
vsgtracyinstrumentation.cpp
)

add_executable(vsgtracyinstrumentation ${SOURCES})

target_link_libraries(vsgtracyinstrumentation vsg::vsg Tracy::TracyClient)

if (vsgXchange_FOUND)
target_compile_definitions(vsgtracyinstrumentation PRIVATE vsgXchange_FOUND)
target_link_libraries(vsgtracyinstrumentation vsgXchange::vsgXchange)
endif()

install(TARGETS vsgtracyinstrumentation RUNTIME DESTINATION bin)
Loading