From 63cc67298f0bb1d4d9a01e4f9f11d78292d7a105 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 2 Apr 2021 16:25:04 +0100 Subject: [PATCH 1/9] Renamed raytracing directory to rtx to reflect the NVidia specific nature of extensions, and pave way for the addition of mesh shaders --- build/build_all_h.cmake | 4 ++-- include/vsg/all.h | 20 +++++++++---------- .../AccelerationGeometry.h | 0 .../AccelerationStructure.h | 0 .../BottomLevelAccelerationStructure.h | 0 .../BuildAccelerationStructureTraversal.h | 0 .../DescriptorAccelerationStructure.h | 0 include/vsg/{raytracing => rtx}/README.md | 0 .../{raytracing => rtx}/RayTracingPipeline.h | 0 .../RayTracingShaderGroup.h | 0 .../TopLevelAccelerationStructure.h | 0 include/vsg/{raytracing => rtx}/TraceRays.h | 0 src/vsg/CMakeLists.txt | 18 ++++++++--------- .../AccelerationGeometry.cpp | 0 .../AccelerationStructure.cpp | 0 .../BottomLevelAccelerationStructure.cpp | 0 .../BuildAccelerationStructureTraversal.cpp | 0 .../DescriptorAccelerationStructure.cpp | 0 src/vsg/{raytracing => rtx}/README.md | 0 .../RayTracingPipeline.cpp | 0 .../RayTracingShaderGroup.cpp | 0 .../TopLevelAccelerationStructure.cpp | 0 src/vsg/{raytracing => rtx}/TraceRays.cpp | 0 23 files changed, 21 insertions(+), 21 deletions(-) rename include/vsg/{raytracing => rtx}/AccelerationGeometry.h (100%) rename include/vsg/{raytracing => rtx}/AccelerationStructure.h (100%) rename include/vsg/{raytracing => rtx}/BottomLevelAccelerationStructure.h (100%) rename include/vsg/{raytracing => rtx}/BuildAccelerationStructureTraversal.h (100%) rename include/vsg/{raytracing => rtx}/DescriptorAccelerationStructure.h (100%) rename include/vsg/{raytracing => rtx}/README.md (100%) rename include/vsg/{raytracing => rtx}/RayTracingPipeline.h (100%) rename include/vsg/{raytracing => rtx}/RayTracingShaderGroup.h (100%) rename include/vsg/{raytracing => rtx}/TopLevelAccelerationStructure.h (100%) rename include/vsg/{raytracing => rtx}/TraceRays.h (100%) rename src/vsg/{raytracing => rtx}/AccelerationGeometry.cpp (100%) rename src/vsg/{raytracing => rtx}/AccelerationStructure.cpp (100%) rename src/vsg/{raytracing => rtx}/BottomLevelAccelerationStructure.cpp (100%) rename src/vsg/{raytracing => rtx}/BuildAccelerationStructureTraversal.cpp (100%) rename src/vsg/{raytracing => rtx}/DescriptorAccelerationStructure.cpp (100%) rename src/vsg/{raytracing => rtx}/README.md (100%) rename src/vsg/{raytracing => rtx}/RayTracingPipeline.cpp (100%) rename src/vsg/{raytracing => rtx}/RayTracingShaderGroup.cpp (100%) rename src/vsg/{raytracing => rtx}/TopLevelAccelerationStructure.cpp (100%) rename src/vsg/{raytracing => rtx}/TraceRays.cpp (100%) diff --git a/build/build_all_h.cmake b/build/build_all_h.cmake index d1289e2835..0f71ec31a8 100644 --- a/build/build_all_h.cmake +++ b/build/build_all_h.cmake @@ -25,7 +25,7 @@ macro(BUILD_ALL_H) file(GLOB COMMANDS_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/include include/vsg/commands/*.h ) file(GLOB STATE_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/include include/vsg/state/*.h ) file(GLOB TEXT_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/include include/vsg/text/*.h ) - file(GLOB RAYTRACING_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/include include/vsg/raytracing/*.h ) + file(GLOB RTX_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/include include/vsg/rtx/*.h ) file(READ ${CMAKE_CURRENT_SOURCE_DIR}/build/header_license_preamble.txt ALL_H_CONTENTS) APPEND_INCLUDES(ALL_H_CONTENTS CORE_HEADERS "// Core header files\n") @@ -42,7 +42,7 @@ macro(BUILD_ALL_H) APPEND_INCLUDES(ALL_H_CONTENTS UTILS_HEADERS "// Utility header files\n") APPEND_INCLUDES(ALL_H_CONTENTS INTROSPECTION_HEADERS "// Introspection header files\n") APPEND_INCLUDES(ALL_H_CONTENTS TEXT_HEADERS "// Text header files\n") - APPEND_INCLUDES(ALL_H_CONTENTS RAYTRACING_HEADERS "// Raytracing header files\n") + APPEND_INCLUDES(ALL_H_CONTENTS RTX_HEADERS "// RTX mesh and ray tracing header files\n") file(WRITE include/vsg/all.h ${ALL_H_CONTENTS}) diff --git a/include/vsg/all.h b/include/vsg/all.h index 183f85d29c..35a273428a 100644 --- a/include/vsg/all.h +++ b/include/vsg/all.h @@ -216,13 +216,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include -// Raytracing header files -#include -#include -#include -#include -#include -#include -#include -#include -#include +// RTX mesh and ray tracing header files +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/include/vsg/raytracing/AccelerationGeometry.h b/include/vsg/rtx/AccelerationGeometry.h similarity index 100% rename from include/vsg/raytracing/AccelerationGeometry.h rename to include/vsg/rtx/AccelerationGeometry.h diff --git a/include/vsg/raytracing/AccelerationStructure.h b/include/vsg/rtx/AccelerationStructure.h similarity index 100% rename from include/vsg/raytracing/AccelerationStructure.h rename to include/vsg/rtx/AccelerationStructure.h diff --git a/include/vsg/raytracing/BottomLevelAccelerationStructure.h b/include/vsg/rtx/BottomLevelAccelerationStructure.h similarity index 100% rename from include/vsg/raytracing/BottomLevelAccelerationStructure.h rename to include/vsg/rtx/BottomLevelAccelerationStructure.h diff --git a/include/vsg/raytracing/BuildAccelerationStructureTraversal.h b/include/vsg/rtx/BuildAccelerationStructureTraversal.h similarity index 100% rename from include/vsg/raytracing/BuildAccelerationStructureTraversal.h rename to include/vsg/rtx/BuildAccelerationStructureTraversal.h diff --git a/include/vsg/raytracing/DescriptorAccelerationStructure.h b/include/vsg/rtx/DescriptorAccelerationStructure.h similarity index 100% rename from include/vsg/raytracing/DescriptorAccelerationStructure.h rename to include/vsg/rtx/DescriptorAccelerationStructure.h diff --git a/include/vsg/raytracing/README.md b/include/vsg/rtx/README.md similarity index 100% rename from include/vsg/raytracing/README.md rename to include/vsg/rtx/README.md diff --git a/include/vsg/raytracing/RayTracingPipeline.h b/include/vsg/rtx/RayTracingPipeline.h similarity index 100% rename from include/vsg/raytracing/RayTracingPipeline.h rename to include/vsg/rtx/RayTracingPipeline.h diff --git a/include/vsg/raytracing/RayTracingShaderGroup.h b/include/vsg/rtx/RayTracingShaderGroup.h similarity index 100% rename from include/vsg/raytracing/RayTracingShaderGroup.h rename to include/vsg/rtx/RayTracingShaderGroup.h diff --git a/include/vsg/raytracing/TopLevelAccelerationStructure.h b/include/vsg/rtx/TopLevelAccelerationStructure.h similarity index 100% rename from include/vsg/raytracing/TopLevelAccelerationStructure.h rename to include/vsg/rtx/TopLevelAccelerationStructure.h diff --git a/include/vsg/raytracing/TraceRays.h b/include/vsg/rtx/TraceRays.h similarity index 100% rename from include/vsg/raytracing/TraceRays.h rename to include/vsg/rtx/TraceRays.h diff --git a/src/vsg/CMakeLists.txt b/src/vsg/CMakeLists.txt index ab3e237f3f..433af1dd47 100644 --- a/src/vsg/CMakeLists.txt +++ b/src/vsg/CMakeLists.txt @@ -125,15 +125,15 @@ set(SOURCES viewer/WindowResizeHandler.cpp viewer/View.cpp - raytracing/AccelerationGeometry.cpp - raytracing/AccelerationStructure.cpp - raytracing/BottomLevelAccelerationStructure.cpp - raytracing/BuildAccelerationStructureTraversal.cpp - raytracing/DescriptorAccelerationStructure.cpp - raytracing/RayTracingPipeline.cpp - raytracing/RayTracingShaderGroup.cpp - raytracing/TopLevelAccelerationStructure.cpp - raytracing/TraceRays.cpp + rtx/AccelerationGeometry.cpp + rtx/AccelerationStructure.cpp + rtx/BottomLevelAccelerationStructure.cpp + rtx/BuildAccelerationStructureTraversal.cpp + rtx/DescriptorAccelerationStructure.cpp + rtx/RayTracingPipeline.cpp + rtx/RayTracingShaderGroup.cpp + rtx/TopLevelAccelerationStructure.cpp + rtx/TraceRays.cpp ui/UIEvent.cpp ui/ApplicationEvent.cpp diff --git a/src/vsg/raytracing/AccelerationGeometry.cpp b/src/vsg/rtx/AccelerationGeometry.cpp similarity index 100% rename from src/vsg/raytracing/AccelerationGeometry.cpp rename to src/vsg/rtx/AccelerationGeometry.cpp diff --git a/src/vsg/raytracing/AccelerationStructure.cpp b/src/vsg/rtx/AccelerationStructure.cpp similarity index 100% rename from src/vsg/raytracing/AccelerationStructure.cpp rename to src/vsg/rtx/AccelerationStructure.cpp diff --git a/src/vsg/raytracing/BottomLevelAccelerationStructure.cpp b/src/vsg/rtx/BottomLevelAccelerationStructure.cpp similarity index 100% rename from src/vsg/raytracing/BottomLevelAccelerationStructure.cpp rename to src/vsg/rtx/BottomLevelAccelerationStructure.cpp diff --git a/src/vsg/raytracing/BuildAccelerationStructureTraversal.cpp b/src/vsg/rtx/BuildAccelerationStructureTraversal.cpp similarity index 100% rename from src/vsg/raytracing/BuildAccelerationStructureTraversal.cpp rename to src/vsg/rtx/BuildAccelerationStructureTraversal.cpp diff --git a/src/vsg/raytracing/DescriptorAccelerationStructure.cpp b/src/vsg/rtx/DescriptorAccelerationStructure.cpp similarity index 100% rename from src/vsg/raytracing/DescriptorAccelerationStructure.cpp rename to src/vsg/rtx/DescriptorAccelerationStructure.cpp diff --git a/src/vsg/raytracing/README.md b/src/vsg/rtx/README.md similarity index 100% rename from src/vsg/raytracing/README.md rename to src/vsg/rtx/README.md diff --git a/src/vsg/raytracing/RayTracingPipeline.cpp b/src/vsg/rtx/RayTracingPipeline.cpp similarity index 100% rename from src/vsg/raytracing/RayTracingPipeline.cpp rename to src/vsg/rtx/RayTracingPipeline.cpp diff --git a/src/vsg/raytracing/RayTracingShaderGroup.cpp b/src/vsg/rtx/RayTracingShaderGroup.cpp similarity index 100% rename from src/vsg/raytracing/RayTracingShaderGroup.cpp rename to src/vsg/rtx/RayTracingShaderGroup.cpp diff --git a/src/vsg/raytracing/TopLevelAccelerationStructure.cpp b/src/vsg/rtx/TopLevelAccelerationStructure.cpp similarity index 100% rename from src/vsg/raytracing/TopLevelAccelerationStructure.cpp rename to src/vsg/rtx/TopLevelAccelerationStructure.cpp diff --git a/src/vsg/raytracing/TraceRays.cpp b/src/vsg/rtx/TraceRays.cpp similarity index 100% rename from src/vsg/raytracing/TraceRays.cpp rename to src/vsg/rtx/TraceRays.cpp From 69a9608cf3234f37db1d581adf89c6e4a289a774 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 2 Apr 2021 16:34:01 +0100 Subject: [PATCH 2/9] Updated paths for raytracing -> rtx directory rename --- include/vsg/rtx/BottomLevelAccelerationStructure.h | 4 ++-- include/vsg/rtx/BuildAccelerationStructureTraversal.h | 6 +++--- include/vsg/rtx/DescriptorAccelerationStructure.h | 2 +- include/vsg/rtx/RayTracingPipeline.h | 2 +- include/vsg/rtx/TopLevelAccelerationStructure.h | 4 ++-- include/vsg/rtx/TraceRays.h | 2 +- src/vsg/rtx/AccelerationGeometry.cpp | 2 +- src/vsg/rtx/AccelerationStructure.cpp | 2 +- src/vsg/rtx/BottomLevelAccelerationStructure.cpp | 2 +- src/vsg/rtx/BuildAccelerationStructureTraversal.cpp | 2 +- src/vsg/rtx/DescriptorAccelerationStructure.cpp | 2 +- src/vsg/rtx/RayTracingPipeline.cpp | 2 +- src/vsg/rtx/RayTracingShaderGroup.cpp | 2 +- src/vsg/rtx/TopLevelAccelerationStructure.cpp | 2 +- src/vsg/rtx/TraceRays.cpp | 2 +- src/vsg/vk/ShaderCompiler.cpp | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/include/vsg/rtx/BottomLevelAccelerationStructure.h b/include/vsg/rtx/BottomLevelAccelerationStructure.h index eec13c93b1..33b8d43f4a 100644 --- a/include/vsg/rtx/BottomLevelAccelerationStructure.h +++ b/include/vsg/rtx/BottomLevelAccelerationStructure.h @@ -12,8 +12,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ -#include -#include +#include +#include namespace vsg { diff --git a/include/vsg/rtx/BuildAccelerationStructureTraversal.h b/include/vsg/rtx/BuildAccelerationStructureTraversal.h index e01fee8c79..1b197c7a21 100644 --- a/include/vsg/rtx/BuildAccelerationStructureTraversal.h +++ b/include/vsg/rtx/BuildAccelerationStructureTraversal.h @@ -21,9 +21,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include -#include -#include -#include +#include +#include +#include namespace vsg { diff --git a/include/vsg/rtx/DescriptorAccelerationStructure.h b/include/vsg/rtx/DescriptorAccelerationStructure.h index 5438db53e9..26aa7637b6 100644 --- a/include/vsg/rtx/DescriptorAccelerationStructure.h +++ b/include/vsg/rtx/DescriptorAccelerationStructure.h @@ -12,7 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ -#include +#include #include namespace vsg diff --git a/include/vsg/rtx/RayTracingPipeline.h b/include/vsg/rtx/RayTracingPipeline.h index 821726a0bb..290af8ac19 100644 --- a/include/vsg/rtx/RayTracingPipeline.h +++ b/include/vsg/rtx/RayTracingPipeline.h @@ -12,7 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ -#include +#include #include #include #include diff --git a/include/vsg/rtx/TopLevelAccelerationStructure.h b/include/vsg/rtx/TopLevelAccelerationStructure.h index c23286da2e..2b574aee8d 100644 --- a/include/vsg/rtx/TopLevelAccelerationStructure.h +++ b/include/vsg/rtx/TopLevelAccelerationStructure.h @@ -14,8 +14,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include -#include -#include +#include +#include namespace vsg { diff --git a/include/vsg/rtx/TraceRays.h b/include/vsg/rtx/TraceRays.h index b8435d10c2..c351d36a31 100644 --- a/include/vsg/rtx/TraceRays.h +++ b/include/vsg/rtx/TraceRays.h @@ -13,7 +13,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ #include -#include +#include namespace vsg { diff --git a/src/vsg/rtx/AccelerationGeometry.cpp b/src/vsg/rtx/AccelerationGeometry.cpp index 98fdbcd401..2c7c1e798f 100644 --- a/src/vsg/rtx/AccelerationGeometry.cpp +++ b/src/vsg/rtx/AccelerationGeometry.cpp @@ -14,7 +14,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include -#include +#include #include #include #include diff --git a/src/vsg/rtx/AccelerationStructure.cpp b/src/vsg/rtx/AccelerationStructure.cpp index 191fea6366..f10c91ae49 100644 --- a/src/vsg/rtx/AccelerationStructure.cpp +++ b/src/vsg/rtx/AccelerationStructure.cpp @@ -12,7 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include -#include +#include #include #include diff --git a/src/vsg/rtx/BottomLevelAccelerationStructure.cpp b/src/vsg/rtx/BottomLevelAccelerationStructure.cpp index 0d5892d37c..3019ee9f5b 100644 --- a/src/vsg/rtx/BottomLevelAccelerationStructure.cpp +++ b/src/vsg/rtx/BottomLevelAccelerationStructure.cpp @@ -12,7 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include -#include +#include #include #include diff --git a/src/vsg/rtx/BuildAccelerationStructureTraversal.cpp b/src/vsg/rtx/BuildAccelerationStructureTraversal.cpp index b226ecbe1c..bde3d0125f 100644 --- a/src/vsg/rtx/BuildAccelerationStructureTraversal.cpp +++ b/src/vsg/rtx/BuildAccelerationStructureTraversal.cpp @@ -11,7 +11,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ #include -#include +#include using namespace vsg; diff --git a/src/vsg/rtx/DescriptorAccelerationStructure.cpp b/src/vsg/rtx/DescriptorAccelerationStructure.cpp index edf0608822..5bf77dcda3 100644 --- a/src/vsg/rtx/DescriptorAccelerationStructure.cpp +++ b/src/vsg/rtx/DescriptorAccelerationStructure.cpp @@ -10,7 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ -#include +#include #include #include diff --git a/src/vsg/rtx/RayTracingPipeline.cpp b/src/vsg/rtx/RayTracingPipeline.cpp index fadd1d3747..d5e4f0ab33 100644 --- a/src/vsg/rtx/RayTracingPipeline.cpp +++ b/src/vsg/rtx/RayTracingPipeline.cpp @@ -10,7 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ -#include +#include #include #include diff --git a/src/vsg/rtx/RayTracingShaderGroup.cpp b/src/vsg/rtx/RayTracingShaderGroup.cpp index 518b6a977a..79a48bff7e 100644 --- a/src/vsg/rtx/RayTracingShaderGroup.cpp +++ b/src/vsg/rtx/RayTracingShaderGroup.cpp @@ -11,7 +11,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ #include -#include +#include using namespace vsg; diff --git a/src/vsg/rtx/TopLevelAccelerationStructure.cpp b/src/vsg/rtx/TopLevelAccelerationStructure.cpp index 58d5379921..45af50a888 100644 --- a/src/vsg/rtx/TopLevelAccelerationStructure.cpp +++ b/src/vsg/rtx/TopLevelAccelerationStructure.cpp @@ -12,7 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include -#include +#include #include #include diff --git a/src/vsg/rtx/TraceRays.cpp b/src/vsg/rtx/TraceRays.cpp index c5972f635d..c1b17f3dbe 100644 --- a/src/vsg/rtx/TraceRays.cpp +++ b/src/vsg/rtx/TraceRays.cpp @@ -11,7 +11,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ #include -#include +#include #include #include diff --git a/src/vsg/vk/ShaderCompiler.cpp b/src/vsg/vk/ShaderCompiler.cpp index 00781acece..a9030d3f20 100644 --- a/src/vsg/vk/ShaderCompiler.cpp +++ b/src/vsg/vk/ShaderCompiler.cpp @@ -11,7 +11,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ #include -#include +#include #include #include #include From 7b900fbd7af70c4adf2f8e5ae4dafe687aaf8321 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 2 Apr 2021 17:19:31 +0100 Subject: [PATCH 3/9] Added vsg::DrawMeshTasks class to wrap vkCmdDrawMeshTasksNV call. --- include/vsg/all.h | 1 + include/vsg/core/ConstVisitor.h | 6 ++++ include/vsg/core/Visitor.h | 6 ++++ include/vsg/rtx/DrawMeshTasks.h | 37 ++++++++++++++++++++++++ include/vsg/vk/Extensions.h | 21 ++++++++------ src/vsg/CMakeLists.txt | 1 + src/vsg/core/ConstVisitor.cpp | 9 ++++++ src/vsg/core/Visitor.cpp | 9 ++++++ src/vsg/io/ObjectFactory.cpp | 3 ++ src/vsg/rtx/DrawMeshTasks.cpp | 50 +++++++++++++++++++++++++++++++++ src/vsg/vk/Extensions.cpp | 1 + 11 files changed, 135 insertions(+), 9 deletions(-) create mode 100644 include/vsg/rtx/DrawMeshTasks.h create mode 100644 src/vsg/rtx/DrawMeshTasks.cpp diff --git a/include/vsg/all.h b/include/vsg/all.h index 35a273428a..78d961da54 100644 --- a/include/vsg/all.h +++ b/include/vsg/all.h @@ -222,6 +222,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include #include +#include #include #include #include diff --git a/include/vsg/core/ConstVisitor.h b/include/vsg/core/ConstVisitor.h index 1c874b4961..437c157b56 100644 --- a/include/vsg/core/ConstVisitor.h +++ b/include/vsg/core/ConstVisitor.h @@ -70,6 +70,9 @@ namespace vsg class ResourceHints; class ClearAttachments; + // forward declare rtx classes + class DrawMeshTasks; + // forward declare ui events classes class UIEvent; class WindowEvent; @@ -255,6 +258,9 @@ namespace vsg virtual void apply(const DrawIndexed&); virtual void apply(const ClearAttachments&); + // rtx classes + virtual void apply(const DrawMeshTasks&); + // ui events virtual void apply(const UIEvent&); virtual void apply(const WindowEvent&); diff --git a/include/vsg/core/Visitor.h b/include/vsg/core/Visitor.h index fb5477b955..e6a7b2a14c 100644 --- a/include/vsg/core/Visitor.h +++ b/include/vsg/core/Visitor.h @@ -70,6 +70,9 @@ namespace vsg class ResourceHints; class ClearAttachments; + // forward declare rtx classes + class DrawMeshTasks; + // forward declare ui events classes class UIEvent; class WindowEvent; @@ -255,6 +258,9 @@ namespace vsg virtual void apply(DrawIndexed&); virtual void apply(ClearAttachments&); + // rtx classes + virtual void apply(DrawMeshTasks&); + // ui events virtual void apply(UIEvent&); virtual void apply(WindowEvent&); diff --git a/include/vsg/rtx/DrawMeshTasks.h b/include/vsg/rtx/DrawMeshTasks.h new file mode 100644 index 0000000000..7f71288553 --- /dev/null +++ b/include/vsg/rtx/DrawMeshTasks.h @@ -0,0 +1,37 @@ +#pragma once + +/* + +Copyright(c) 2019 Robert Osfield + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + */ + +#include + +namespace vsg +{ + + class VSG_DECLSPEC DrawMeshTasks : public vsg::Inherit + { + public: + DrawMeshTasks(); + + DrawMeshTasks(uint32_t in_taskCount, uint32_t in_firstTask); + + void read(Input& input) override; + void write(Output& output) const override; + + void record(vsg::CommandBuffer& commandBuffer) const override; + + uint32_t taskCount = 0; + uint32_t firstTask = 0; + }; + VSG_type_name(vsg::DrawMeshTasks); + +} // namespace vsg diff --git a/include/vsg/vk/Extensions.h b/include/vsg/vk/Extensions.h index 58d20bc2a4..10bcb86da0 100644 --- a/include/vsg/vk/Extensions.h +++ b/include/vsg/vk/Extensions.h @@ -34,15 +34,18 @@ namespace vsg Extensions(Device* device); // VK_NV_ray_tracing - PFN_vkCreateAccelerationStructureNV vkCreateAccelerationStructureNV; - PFN_vkDestroyAccelerationStructureNV vkDestroyAccelerationStructureNV; - PFN_vkBindAccelerationStructureMemoryNV vkBindAccelerationStructureMemoryNV; - PFN_vkGetAccelerationStructureHandleNV vkGetAccelerationStructureHandleNV; - PFN_vkGetAccelerationStructureMemoryRequirementsNV vkGetAccelerationStructureMemoryRequirementsNV; - PFN_vkCmdBuildAccelerationStructureNV vkCmdBuildAccelerationStructureNV; - PFN_vkCreateRayTracingPipelinesNV vkCreateRayTracingPipelinesNV; - PFN_vkGetRayTracingShaderGroupHandlesNV vkGetRayTracingShaderGroupHandlesNV; - PFN_vkCmdTraceRaysNV vkCmdTraceRaysNV; + PFN_vkCreateAccelerationStructureNV vkCreateAccelerationStructureNV = nullptr; + PFN_vkDestroyAccelerationStructureNV vkDestroyAccelerationStructureNV = nullptr; + PFN_vkBindAccelerationStructureMemoryNV vkBindAccelerationStructureMemoryNV = nullptr; + PFN_vkGetAccelerationStructureHandleNV vkGetAccelerationStructureHandleNV = nullptr; + PFN_vkGetAccelerationStructureMemoryRequirementsNV vkGetAccelerationStructureMemoryRequirementsNV = nullptr; + PFN_vkCmdBuildAccelerationStructureNV vkCmdBuildAccelerationStructureNV = nullptr; + PFN_vkCreateRayTracingPipelinesNV vkCreateRayTracingPipelinesNV = nullptr; + PFN_vkGetRayTracingShaderGroupHandlesNV vkGetRayTracingShaderGroupHandlesNV = nullptr; + PFN_vkCmdTraceRaysNV vkCmdTraceRaysNV = nullptr; + + // VK_NV_mesh_shader + PFN_vkCmdDrawMeshTasksNV vkCmdDrawMeshTasksNV = nullptr; }; } // namespace vsg diff --git a/src/vsg/CMakeLists.txt b/src/vsg/CMakeLists.txt index 433af1dd47..342aeb7c17 100644 --- a/src/vsg/CMakeLists.txt +++ b/src/vsg/CMakeLists.txt @@ -134,6 +134,7 @@ set(SOURCES rtx/RayTracingShaderGroup.cpp rtx/TopLevelAccelerationStructure.cpp rtx/TraceRays.cpp + rtx/DrawMeshTasks.cpp ui/UIEvent.cpp ui/ApplicationEvent.cpp diff --git a/src/vsg/core/ConstVisitor.cpp b/src/vsg/core/ConstVisitor.cpp index 5e2a2aad85..dd605f2fae 100644 --- a/src/vsg/core/ConstVisitor.cpp +++ b/src/vsg/core/ConstVisitor.cpp @@ -595,6 +595,15 @@ void ConstVisitor::apply(const ClearAttachments& value) apply(static_cast(value)); } +//////////////////////////////////////////////////////////////////////////////// +// +// RTX +// +void ConstVisitor::apply(const DrawMeshTasks& dmt) +{ + apply(static_cast(dmt)); +} + //////////////////////////////////////////////////////////////////////////////// // // UI Events diff --git a/src/vsg/core/Visitor.cpp b/src/vsg/core/Visitor.cpp index 3e08db8243..e5a47e3cb8 100644 --- a/src/vsg/core/Visitor.cpp +++ b/src/vsg/core/Visitor.cpp @@ -595,6 +595,15 @@ void Visitor::apply(ClearAttachments& value) apply(static_cast(value)); } +//////////////////////////////////////////////////////////////////////////////// +// +// RTX +// +void Visitor::apply(DrawMeshTasks& dmt) +{ + apply(static_cast(dmt)); +} + //////////////////////////////////////////////////////////////////////////////// // // UI Events diff --git a/src/vsg/io/ObjectFactory.cpp b/src/vsg/io/ObjectFactory.cpp index 4fee64e221..a3ff6b3feb 100644 --- a/src/vsg/io/ObjectFactory.cpp +++ b/src/vsg/io/ObjectFactory.cpp @@ -239,6 +239,9 @@ ObjectFactory::ObjectFactory() VSG_REGISTER_create(vsg::KeyPressEvent); VSG_REGISTER_create(vsg::KeyReleaseEvent); + // rtx + VSG_REGISTER_create(vsg::DrawMeshTasks); + // application VSG_REGISTER_create(vsg::EllipsoidModel); } diff --git a/src/vsg/rtx/DrawMeshTasks.cpp b/src/vsg/rtx/DrawMeshTasks.cpp new file mode 100644 index 0000000000..9a5dcb9fd6 --- /dev/null +++ b/src/vsg/rtx/DrawMeshTasks.cpp @@ -0,0 +1,50 @@ +/* + +Copyright(c) 2018 Robert Osfield + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + */ + +#include +#include +#include +#include +#include + +#include + +using namespace vsg; + +DrawMeshTasks::DrawMeshTasks() +{ +} + +DrawMeshTasks::DrawMeshTasks(uint32_t in_taskCount, uint32_t in_firstTask) : + taskCount(in_taskCount), + firstTask(in_firstTask) +{ +} + +void DrawMeshTasks::read(Input& input) +{ + input.read("taskCount", taskCount); + input.read("firstTask", firstTask); +} + +void DrawMeshTasks::write(Output& output) const +{ + output.write("taskCount", taskCount); + output.write("firstTask", firstTask); +} + +void DrawMeshTasks::record(vsg::CommandBuffer& commandBuffer) const +{ + Device* device = commandBuffer.getDevice(); + Extensions* extensions = Extensions::Get(device, true); + extensions->vkCmdDrawMeshTasksNV(commandBuffer, taskCount, firstTask); +} diff --git a/src/vsg/vk/Extensions.cpp b/src/vsg/vk/Extensions.cpp index 082ba31a0b..5466e6d26a 100644 --- a/src/vsg/vk/Extensions.cpp +++ b/src/vsg/vk/Extensions.cpp @@ -84,4 +84,5 @@ Extensions::Extensions(Device* device) vkCreateRayTracingPipelinesNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkCreateRayTracingPipelinesNV")); vkGetRayTracingShaderGroupHandlesNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkGetRayTracingShaderGroupHandlesNV")); vkCmdTraceRaysNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkCmdTraceRaysNV")); + vkCmdDrawMeshTasksNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkCmdDrawMeshTasksNV")); } From 9e675e804e5f4384ea78018a0034e08fecb0d274 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 2 Apr 2021 19:15:25 +0100 Subject: [PATCH 4/9] Added vsg::DrawMeshTasksIndirect wrapper of vkCmdDrawMeshTasksIndirectNV. --- include/vsg/all.h | 2 + include/vsg/core/ConstVisitor.h | 2 + include/vsg/core/Visitor.h | 2 + include/vsg/rtx/DrawMeshTasks.h | 4 +- include/vsg/rtx/DrawMeshTasksIndirect.h | 48 +++++++++++++ .../vsg/rtx/DrawMeshTasksIndirectCommand.h | 45 ++++++++++++ include/vsg/vk/Extensions.h | 1 + src/vsg/CMakeLists.txt | 1 + src/vsg/core/ConstVisitor.cpp | 4 ++ src/vsg/core/Visitor.cpp | 4 ++ src/vsg/io/ObjectFactory.cpp | 2 + src/vsg/rtx/DrawMeshTasksIndirect.cpp | 71 +++++++++++++++++++ 12 files changed, 184 insertions(+), 2 deletions(-) create mode 100644 include/vsg/rtx/DrawMeshTasksIndirect.h create mode 100644 include/vsg/rtx/DrawMeshTasksIndirectCommand.h create mode 100644 src/vsg/rtx/DrawMeshTasksIndirect.cpp diff --git a/include/vsg/all.h b/include/vsg/all.h index 78d961da54..ce9e57cd6f 100644 --- a/include/vsg/all.h +++ b/include/vsg/all.h @@ -223,6 +223,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include #include +#include +#include #include #include #include diff --git a/include/vsg/core/ConstVisitor.h b/include/vsg/core/ConstVisitor.h index 437c157b56..51bc284b71 100644 --- a/include/vsg/core/ConstVisitor.h +++ b/include/vsg/core/ConstVisitor.h @@ -72,6 +72,7 @@ namespace vsg // forward declare rtx classes class DrawMeshTasks; + class DrawMeshTasksIndirect; // forward declare ui events classes class UIEvent; @@ -260,6 +261,7 @@ namespace vsg // rtx classes virtual void apply(const DrawMeshTasks&); + virtual void apply(const DrawMeshTasksIndirect&); // ui events virtual void apply(const UIEvent&); diff --git a/include/vsg/core/Visitor.h b/include/vsg/core/Visitor.h index e6a7b2a14c..926076cbca 100644 --- a/include/vsg/core/Visitor.h +++ b/include/vsg/core/Visitor.h @@ -72,6 +72,7 @@ namespace vsg // forward declare rtx classes class DrawMeshTasks; + class DrawMeshTasksIndirect; // forward declare ui events classes class UIEvent; @@ -260,6 +261,7 @@ namespace vsg // rtx classes virtual void apply(DrawMeshTasks&); + virtual void apply(DrawMeshTasksIndirect&); // ui events virtual void apply(UIEvent&); diff --git a/include/vsg/rtx/DrawMeshTasks.h b/include/vsg/rtx/DrawMeshTasks.h index 7f71288553..2d8a4e3f5a 100644 --- a/include/vsg/rtx/DrawMeshTasks.h +++ b/include/vsg/rtx/DrawMeshTasks.h @@ -17,7 +17,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI namespace vsg { - class VSG_DECLSPEC DrawMeshTasks : public vsg::Inherit + class VSG_DECLSPEC DrawMeshTasks : public Inherit { public: DrawMeshTasks(); @@ -27,7 +27,7 @@ namespace vsg void read(Input& input) override; void write(Output& output) const override; - void record(vsg::CommandBuffer& commandBuffer) const override; + void record(CommandBuffer& commandBuffer) const override; uint32_t taskCount = 0; uint32_t firstTask = 0; diff --git a/include/vsg/rtx/DrawMeshTasksIndirect.h b/include/vsg/rtx/DrawMeshTasksIndirect.h new file mode 100644 index 0000000000..886e71e672 --- /dev/null +++ b/include/vsg/rtx/DrawMeshTasksIndirect.h @@ -0,0 +1,48 @@ +#pragma once + +/* + +Copyright(c) 2019 Robert Osfield + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + */ + +#include +#include + +namespace vsg +{ + + class VSG_DECLSPEC DrawMeshTasksIndirect : public Inherit + { + public: + DrawMeshTasksIndirect(); + + DrawMeshTasksIndirect(ref_ptr data, uint32_t in_drawCount, uint32_t in_stride) : + bufferInfo(data), + drawCount(in_drawCount), + stride(in_stride) {} + + DrawMeshTasksIndirect(ref_ptr in_buffer, VkDeviceSize in_offset, uint32_t in_drawCount, uint32_t in_stride) : + bufferInfo(in_buffer, in_offset, in_drawCount * in_stride), + drawCount(in_drawCount), + stride(in_stride) {} + + void read(Input& input) override; + void write(Output& output) const override; + + void compile(Context& context) override; + void record(CommandBuffer& commandBuffer) const override; + + BufferInfo bufferInfo; + uint32_t drawCount = 0; + uint32_t stride = 0; + }; + VSG_type_name(vsg::DrawMeshTasksIndirect); + +} // namespace vsg diff --git a/include/vsg/rtx/DrawMeshTasksIndirectCommand.h b/include/vsg/rtx/DrawMeshTasksIndirectCommand.h new file mode 100644 index 0000000000..a38806cd9f --- /dev/null +++ b/include/vsg/rtx/DrawMeshTasksIndirectCommand.h @@ -0,0 +1,45 @@ +#pragma once + +/* + +Copyright(c) 2018 Robert Osfield + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + */ + +#include +#include +#include + +namespace vsg +{ + /// Equivalent to VkDrawMeshTasksIndirectCommandNV that adds read/write support + struct DrawMeshTasksIndirectCommand + { + uint32_t taskCount; + uint32_t firstTask; + + void read(vsg::Input& input) + { + input.read("taskCount", taskCount); + input.read("firstTask", firstTask); + } + + void write(vsg::Output& output) const + { + output.write("taskCount", taskCount); + output.write("firstTask", firstTask); + } + }; + + template<> + constexpr bool has_read_write() { return true; } + + VSG_array(DrawMeshTasksIndirectCommandArray, DrawMeshTasksIndirectCommand); + +} // namespace vsg diff --git a/include/vsg/vk/Extensions.h b/include/vsg/vk/Extensions.h index 10bcb86da0..31638b7e5e 100644 --- a/include/vsg/vk/Extensions.h +++ b/include/vsg/vk/Extensions.h @@ -46,6 +46,7 @@ namespace vsg // VK_NV_mesh_shader PFN_vkCmdDrawMeshTasksNV vkCmdDrawMeshTasksNV = nullptr; + PFN_vkCmdDrawMeshTasksIndirectNV vkCmdDrawMeshTasksIndirectNV = nullptr; }; } // namespace vsg diff --git a/src/vsg/CMakeLists.txt b/src/vsg/CMakeLists.txt index 342aeb7c17..f059cec4be 100644 --- a/src/vsg/CMakeLists.txt +++ b/src/vsg/CMakeLists.txt @@ -135,6 +135,7 @@ set(SOURCES rtx/TopLevelAccelerationStructure.cpp rtx/TraceRays.cpp rtx/DrawMeshTasks.cpp + rtx/DrawMeshTasksIndirect.cpp ui/UIEvent.cpp ui/ApplicationEvent.cpp diff --git a/src/vsg/core/ConstVisitor.cpp b/src/vsg/core/ConstVisitor.cpp index dd605f2fae..b3b4f2c570 100644 --- a/src/vsg/core/ConstVisitor.cpp +++ b/src/vsg/core/ConstVisitor.cpp @@ -603,6 +603,10 @@ void ConstVisitor::apply(const DrawMeshTasks& dmt) { apply(static_cast(dmt)); } +void ConstVisitor::apply(const DrawMeshTasksIndirect& dmti) +{ + apply(static_cast(dmti)); +} //////////////////////////////////////////////////////////////////////////////// // diff --git a/src/vsg/core/Visitor.cpp b/src/vsg/core/Visitor.cpp index e5a47e3cb8..7f94885680 100644 --- a/src/vsg/core/Visitor.cpp +++ b/src/vsg/core/Visitor.cpp @@ -603,6 +603,10 @@ void Visitor::apply(DrawMeshTasks& dmt) { apply(static_cast(dmt)); } +void Visitor::apply(DrawMeshTasksIndirect& dmti) +{ + apply(static_cast(dmti)); +} //////////////////////////////////////////////////////////////////////////////// // diff --git a/src/vsg/io/ObjectFactory.cpp b/src/vsg/io/ObjectFactory.cpp index a3ff6b3feb..3e06c54ec5 100644 --- a/src/vsg/io/ObjectFactory.cpp +++ b/src/vsg/io/ObjectFactory.cpp @@ -241,6 +241,8 @@ ObjectFactory::ObjectFactory() // rtx VSG_REGISTER_create(vsg::DrawMeshTasks); + VSG_REGISTER_create(vsg::DrawMeshTasksIndirect); + VSG_REGISTER_create(vsg::DrawMeshTasksIndirectCommandArray); // application VSG_REGISTER_create(vsg::EllipsoidModel); diff --git a/src/vsg/rtx/DrawMeshTasksIndirect.cpp b/src/vsg/rtx/DrawMeshTasksIndirect.cpp new file mode 100644 index 0000000000..149296866a --- /dev/null +++ b/src/vsg/rtx/DrawMeshTasksIndirect.cpp @@ -0,0 +1,71 @@ +/* + +Copyright(c) 2018 Robert Osfield + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + */ + +#include +#include +#include +#include + +#include + +using namespace vsg; + +DrawMeshTasksIndirect::DrawMeshTasksIndirect() +{ +} + +void DrawMeshTasksIndirect::read(Input& input) +{ + input.readObject("data", bufferInfo.data); + if (!bufferInfo.data) + { + input.read("buffer", bufferInfo.buffer); + input.readValue("offset", bufferInfo.offset); + input.readValue("range", bufferInfo.range); + } + + input.read("drawCount", drawCount); + input.read("stride", stride); +} + +void DrawMeshTasksIndirect::write(Output& output) const +{ + output.writeObject("data", bufferInfo.data); + if (!bufferInfo.data) + { + output.write("buffer", bufferInfo.buffer); + output.writeValue("offset", bufferInfo.offset); + output.writeValue("range", bufferInfo.range); + } + + output.write("drawCount", drawCount); + output.write("stride", stride); +} + +void DrawMeshTasksIndirect::compile(Context& context) +{ + if (!bufferInfo.buffer && bufferInfo.data) + { + auto bufferInfoList = vsg::createBufferAndTransferData(context, {bufferInfo.data}, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, VK_SHARING_MODE_EXCLUSIVE); + if (!bufferInfoList.empty()) + { + bufferInfo = bufferInfoList.back(); + } + } +} + +void DrawMeshTasksIndirect::record(vsg::CommandBuffer& commandBuffer) const +{ + Device* device = commandBuffer.getDevice(); + Extensions* extensions = Extensions::Get(device, true); + extensions->vkCmdDrawMeshTasksIndirectNV(commandBuffer, bufferInfo.buffer->vk(commandBuffer.deviceID), bufferInfo.offset, drawCount, stride); +} From c15026069150fbad4b9fb75f5fe9864cd1f9ec13 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 2 Apr 2021 19:21:35 +0100 Subject: [PATCH 5/9] Added vkCmdDrawMeshTasksIndirectNV extension initialization. --- src/vsg/vk/Extensions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vsg/vk/Extensions.cpp b/src/vsg/vk/Extensions.cpp index 5466e6d26a..c05576f342 100644 --- a/src/vsg/vk/Extensions.cpp +++ b/src/vsg/vk/Extensions.cpp @@ -84,5 +84,8 @@ Extensions::Extensions(Device* device) vkCreateRayTracingPipelinesNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkCreateRayTracingPipelinesNV")); vkGetRayTracingShaderGroupHandlesNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkGetRayTracingShaderGroupHandlesNV")); vkCmdTraceRaysNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkCmdTraceRaysNV")); + + // VK_NV_mesh_shader vkCmdDrawMeshTasksNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkCmdDrawMeshTasksNV")); + vkCmdDrawMeshTasksIndirectNV = reinterpret_cast(vkGetDeviceProcAddr(*device,"vkCmdDrawMeshTasksIndirectNV")); } From 95b40d64aa3708bfbd676a51cb61ed54805a1928 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 3 Apr 2021 14:20:23 +0100 Subject: [PATCH 6/9] Cleaned up naming --- include/vsg/rtx/DrawMeshTasksIndirect.h | 6 ++--- src/vsg/rtx/DrawMeshTasksIndirect.cpp | 30 ++++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/vsg/rtx/DrawMeshTasksIndirect.h b/include/vsg/rtx/DrawMeshTasksIndirect.h index 886e71e672..71b7431138 100644 --- a/include/vsg/rtx/DrawMeshTasksIndirect.h +++ b/include/vsg/rtx/DrawMeshTasksIndirect.h @@ -24,12 +24,12 @@ namespace vsg DrawMeshTasksIndirect(); DrawMeshTasksIndirect(ref_ptr data, uint32_t in_drawCount, uint32_t in_stride) : - bufferInfo(data), + buffer(data), drawCount(in_drawCount), stride(in_stride) {} DrawMeshTasksIndirect(ref_ptr in_buffer, VkDeviceSize in_offset, uint32_t in_drawCount, uint32_t in_stride) : - bufferInfo(in_buffer, in_offset, in_drawCount * in_stride), + buffer(in_buffer, in_offset, in_drawCount * in_stride), drawCount(in_drawCount), stride(in_stride) {} @@ -39,7 +39,7 @@ namespace vsg void compile(Context& context) override; void record(CommandBuffer& commandBuffer) const override; - BufferInfo bufferInfo; + BufferInfo buffer; uint32_t drawCount = 0; uint32_t stride = 0; }; diff --git a/src/vsg/rtx/DrawMeshTasksIndirect.cpp b/src/vsg/rtx/DrawMeshTasksIndirect.cpp index 149296866a..7e40e29492 100644 --- a/src/vsg/rtx/DrawMeshTasksIndirect.cpp +++ b/src/vsg/rtx/DrawMeshTasksIndirect.cpp @@ -25,12 +25,12 @@ DrawMeshTasksIndirect::DrawMeshTasksIndirect() void DrawMeshTasksIndirect::read(Input& input) { - input.readObject("data", bufferInfo.data); - if (!bufferInfo.data) + input.readObject("buffer.data", buffer.data); + if (!buffer.data) { - input.read("buffer", bufferInfo.buffer); - input.readValue("offset", bufferInfo.offset); - input.readValue("range", bufferInfo.range); + input.read("buffer.buffer", buffer.buffer); + input.readValue("buffer.offset", buffer.offset); + input.readValue("buffer.range", buffer.range); } input.read("drawCount", drawCount); @@ -39,12 +39,12 @@ void DrawMeshTasksIndirect::read(Input& input) void DrawMeshTasksIndirect::write(Output& output) const { - output.writeObject("data", bufferInfo.data); - if (!bufferInfo.data) + output.writeObject("buffer.data", buffer.data); + if (!buffer.data) { - output.write("buffer", bufferInfo.buffer); - output.writeValue("offset", bufferInfo.offset); - output.writeValue("range", bufferInfo.range); + output.write("buffer.buffer", buffer.buffer); + output.writeValue("buffer.offset", buffer.offset); + output.writeValue("buffer.range", buffer.range); } output.write("drawCount", drawCount); @@ -53,12 +53,12 @@ void DrawMeshTasksIndirect::write(Output& output) const void DrawMeshTasksIndirect::compile(Context& context) { - if (!bufferInfo.buffer && bufferInfo.data) + if (!buffer.buffer && buffer.data) { - auto bufferInfoList = vsg::createBufferAndTransferData(context, {bufferInfo.data}, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, VK_SHARING_MODE_EXCLUSIVE); - if (!bufferInfoList.empty()) + auto bufferList = vsg::createBufferAndTransferData(context, {buffer.data}, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, VK_SHARING_MODE_EXCLUSIVE); + if (!bufferList.empty()) { - bufferInfo = bufferInfoList.back(); + buffer = bufferList.back(); } } } @@ -67,5 +67,5 @@ void DrawMeshTasksIndirect::record(vsg::CommandBuffer& commandBuffer) const { Device* device = commandBuffer.getDevice(); Extensions* extensions = Extensions::Get(device, true); - extensions->vkCmdDrawMeshTasksIndirectNV(commandBuffer, bufferInfo.buffer->vk(commandBuffer.deviceID), bufferInfo.offset, drawCount, stride); + extensions->vkCmdDrawMeshTasksIndirectNV(commandBuffer, buffer.buffer->vk(commandBuffer.deviceID), buffer.offset, drawCount, stride); } From 4de9eb18730299956e5f850763a501e006303214 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 3 Apr 2021 14:20:52 +0100 Subject: [PATCH 7/9] Added vsg::DrawMeshTasksIndirectCount wrapper of vkCmdDrawMeshTasksIndirectCountNV --- include/vsg/all.h | 1 + include/vsg/rtx/DrawMeshTasksIndirectCount.h | 45 +++++++++++ include/vsg/vk/Extensions.h | 1 + src/vsg/CMakeLists.txt | 1 + src/vsg/rtx/DrawMeshTasksIndirectCount.cpp | 80 ++++++++++++++++++++ src/vsg/vk/Extensions.cpp | 1 + 6 files changed, 129 insertions(+) create mode 100644 include/vsg/rtx/DrawMeshTasksIndirectCount.h create mode 100644 src/vsg/rtx/DrawMeshTasksIndirectCount.cpp diff --git a/include/vsg/all.h b/include/vsg/all.h index ce9e57cd6f..0966c16b03 100644 --- a/include/vsg/all.h +++ b/include/vsg/all.h @@ -225,6 +225,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include #include +#include #include #include #include diff --git a/include/vsg/rtx/DrawMeshTasksIndirectCount.h b/include/vsg/rtx/DrawMeshTasksIndirectCount.h new file mode 100644 index 0000000000..58f652f376 --- /dev/null +++ b/include/vsg/rtx/DrawMeshTasksIndirectCount.h @@ -0,0 +1,45 @@ +#pragma once + +/* + +Copyright(c) 2019 Robert Osfield + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + */ + +#include +#include + +namespace vsg +{ + + class VSG_DECLSPEC DrawMeshTasksIndirectCount : public Inherit + { + public: + DrawMeshTasksIndirectCount(); + + DrawMeshTasksIndirectCount(ref_ptr in_bufferData, ref_ptr in_countBufferData, uint32_t in_maxDrawCount, uint32_t in_stride) : + buffer(in_bufferData), + countBuffer(in_countBufferData), + maxDrawCount(in_maxDrawCount), + stride(in_stride) {} + + void read(Input& input) override; + void write(Output& output) const override; + + void compile(Context& context) override; + void record(CommandBuffer& commandBuffer) const override; + + BufferInfo buffer; + BufferInfo countBuffer; + uint32_t maxDrawCount = 0; + uint32_t stride = 0; + }; + VSG_type_name(vsg::DrawMeshTasksIndirectCount); + +} // namespace vsg diff --git a/include/vsg/vk/Extensions.h b/include/vsg/vk/Extensions.h index 31638b7e5e..b57aef3d81 100644 --- a/include/vsg/vk/Extensions.h +++ b/include/vsg/vk/Extensions.h @@ -47,6 +47,7 @@ namespace vsg // VK_NV_mesh_shader PFN_vkCmdDrawMeshTasksNV vkCmdDrawMeshTasksNV = nullptr; PFN_vkCmdDrawMeshTasksIndirectNV vkCmdDrawMeshTasksIndirectNV = nullptr; + PFN_vkCmdDrawMeshTasksIndirectCountNV vkCmdDrawMeshTasksIndirectCountNV = nullptr; }; } // namespace vsg diff --git a/src/vsg/CMakeLists.txt b/src/vsg/CMakeLists.txt index f059cec4be..32045eed58 100644 --- a/src/vsg/CMakeLists.txt +++ b/src/vsg/CMakeLists.txt @@ -136,6 +136,7 @@ set(SOURCES rtx/TraceRays.cpp rtx/DrawMeshTasks.cpp rtx/DrawMeshTasksIndirect.cpp + rtx/DrawMeshTasksIndirectCount.cpp ui/UIEvent.cpp ui/ApplicationEvent.cpp diff --git a/src/vsg/rtx/DrawMeshTasksIndirectCount.cpp b/src/vsg/rtx/DrawMeshTasksIndirectCount.cpp new file mode 100644 index 0000000000..b81c82de19 --- /dev/null +++ b/src/vsg/rtx/DrawMeshTasksIndirectCount.cpp @@ -0,0 +1,80 @@ +/* + +Copyright(c) 2018 Robert Osfield + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + */ + +#include +#include +#include +#include + +#include + +using namespace vsg; + +DrawMeshTasksIndirectCount::DrawMeshTasksIndirectCount() +{ +} + +void DrawMeshTasksIndirectCount::read(Input& input) +{ + input.readObject("buffer.data", buffer.data); + if (!buffer.data) + { + input.read("buffer.buffer", buffer.buffer); + input.readValue("buffer.offset", buffer.offset); + input.readValue("buffer.range", buffer.range); + } + + input.read("maxDrawCount", maxDrawCount); + input.read("stride", stride); +} + +void DrawMeshTasksIndirectCount::write(Output& output) const +{ + output.writeObject("buffer.data", buffer.data); + if (!buffer.data) + { + output.write("buffer,buffer", buffer.buffer); + output.writeValue("buffer.offset", buffer.offset); + output.writeValue("buffer.range", buffer.range); + } + + output.writeObject("countBuffer.data", countBuffer.data); + if (!countBuffer.data) + { + output.write("countBuffer.buffer", countBuffer.buffer); + output.writeValue("countBuffer.offset", countBuffer.offset); + output.writeValue("countBuffer.range", countBuffer.range); + } + + output.write("maxDrawCount", maxDrawCount); + output.write("stride", stride); +} + +void DrawMeshTasksIndirectCount::compile(Context& context) +{ + if ((!buffer.buffer && buffer.data) || (!countBuffer.buffer && countBuffer.data)) + { + auto bufferInfoList = vsg::createBufferAndTransferData(context, {buffer.data, countBuffer.data}, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, VK_SHARING_MODE_EXCLUSIVE); + if (bufferInfoList.size()==2) + { + buffer = bufferInfoList[0]; + countBuffer = bufferInfoList[1]; + } + } +} + +void DrawMeshTasksIndirectCount::record(vsg::CommandBuffer& commandBuffer) const +{ + Device* device = commandBuffer.getDevice(); + Extensions* extensions = Extensions::Get(device, true); + extensions->vkCmdDrawMeshTasksIndirectCountNV(commandBuffer, buffer.buffer->vk(commandBuffer.deviceID), buffer.offset, countBuffer.buffer->vk(commandBuffer.deviceID), countBuffer.offset, maxDrawCount, stride); +} diff --git a/src/vsg/vk/Extensions.cpp b/src/vsg/vk/Extensions.cpp index c05576f342..c9e31e8ceb 100644 --- a/src/vsg/vk/Extensions.cpp +++ b/src/vsg/vk/Extensions.cpp @@ -88,4 +88,5 @@ Extensions::Extensions(Device* device) // VK_NV_mesh_shader vkCmdDrawMeshTasksNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkCmdDrawMeshTasksNV")); vkCmdDrawMeshTasksIndirectNV = reinterpret_cast(vkGetDeviceProcAddr(*device,"vkCmdDrawMeshTasksIndirectNV")); + vkCmdDrawMeshTasksIndirectCountNV = reinterpret_cast(vkGetDeviceProcAddr(*device,"vkCmdDrawMeshTasksIndirectCountNV")); } From 57baa4dc8c9f4ccdf129bcab322ca7f8f924c1b8 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 3 Apr 2021 14:21:41 +0100 Subject: [PATCH 8/9] Ran clang-format --- src/vsg/rtx/DrawMeshTasks.cpp | 2 +- src/vsg/rtx/DrawMeshTasksIndirectCount.cpp | 2 +- src/vsg/vk/Extensions.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vsg/rtx/DrawMeshTasks.cpp b/src/vsg/rtx/DrawMeshTasks.cpp index 9a5dcb9fd6..b68fbccf1c 100644 --- a/src/vsg/rtx/DrawMeshTasks.cpp +++ b/src/vsg/rtx/DrawMeshTasks.cpp @@ -13,8 +13,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include #include -#include #include +#include #include diff --git a/src/vsg/rtx/DrawMeshTasksIndirectCount.cpp b/src/vsg/rtx/DrawMeshTasksIndirectCount.cpp index b81c82de19..723fc3df57 100644 --- a/src/vsg/rtx/DrawMeshTasksIndirectCount.cpp +++ b/src/vsg/rtx/DrawMeshTasksIndirectCount.cpp @@ -64,7 +64,7 @@ void DrawMeshTasksIndirectCount::compile(Context& context) if ((!buffer.buffer && buffer.data) || (!countBuffer.buffer && countBuffer.data)) { auto bufferInfoList = vsg::createBufferAndTransferData(context, {buffer.data, countBuffer.data}, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, VK_SHARING_MODE_EXCLUSIVE); - if (bufferInfoList.size()==2) + if (bufferInfoList.size() == 2) { buffer = bufferInfoList[0]; countBuffer = bufferInfoList[1]; diff --git a/src/vsg/vk/Extensions.cpp b/src/vsg/vk/Extensions.cpp index c9e31e8ceb..e8b31ba77e 100644 --- a/src/vsg/vk/Extensions.cpp +++ b/src/vsg/vk/Extensions.cpp @@ -87,6 +87,6 @@ Extensions::Extensions(Device* device) // VK_NV_mesh_shader vkCmdDrawMeshTasksNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkCmdDrawMeshTasksNV")); - vkCmdDrawMeshTasksIndirectNV = reinterpret_cast(vkGetDeviceProcAddr(*device,"vkCmdDrawMeshTasksIndirectNV")); - vkCmdDrawMeshTasksIndirectCountNV = reinterpret_cast(vkGetDeviceProcAddr(*device,"vkCmdDrawMeshTasksIndirectCountNV")); + vkCmdDrawMeshTasksIndirectNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkCmdDrawMeshTasksIndirectNV")); + vkCmdDrawMeshTasksIndirectCountNV = reinterpret_cast(vkGetDeviceProcAddr(*device, "vkCmdDrawMeshTasksIndirectCountNV")); } From 55470a667eae7401515d63332e25f56d18283a4a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 4 Apr 2021 16:57:58 +0100 Subject: [PATCH 9/9] Updated refrences to RTX class --- include/vsg/README.md | 2 +- include/vsg/core/ConstVisitor.h | 2 ++ include/vsg/core/Visitor.h | 2 ++ include/vsg/rtx/README.md | 6 +++++- include/vsg/vk/Context.h | 2 +- src/vsg/README.md | 2 +- src/vsg/core/ConstVisitor.cpp | 4 ++++ src/vsg/core/Visitor.cpp | 4 ++++ 8 files changed, 20 insertions(+), 4 deletions(-) diff --git a/include/vsg/README.md b/include/vsg/README.md index 5ba1750444..c222769adc 100644 --- a/include/vsg/README.md +++ b/include/vsg/README.md @@ -22,7 +22,7 @@ The headers that provide the library classes and definitions are organized in su ## Scene graphs nodes * [include/vsg/nodes](nodes/) - Scene graph node classes * [include/vsg/text](text/) - Scene graph node classes that provide high quality Text support -* [include/vsg/raytracing](raytracing/) - Raytracing related scene graph classes +* [include/vsg/rtx](rtx/) - RTX Raytracing and mesh shader related scene graph classes ## Application level * [include/vsg/traversals](traversals/) - Graph traversals diff --git a/include/vsg/core/ConstVisitor.h b/include/vsg/core/ConstVisitor.h index 51bc284b71..b1b06840f4 100644 --- a/include/vsg/core/ConstVisitor.h +++ b/include/vsg/core/ConstVisitor.h @@ -73,6 +73,7 @@ namespace vsg // forward declare rtx classes class DrawMeshTasks; class DrawMeshTasksIndirect; + class DrawMeshTasksIndirectCount; // forward declare ui events classes class UIEvent; @@ -262,6 +263,7 @@ namespace vsg // rtx classes virtual void apply(const DrawMeshTasks&); virtual void apply(const DrawMeshTasksIndirect&); + virtual void apply(const DrawMeshTasksIndirectCount&); // ui events virtual void apply(const UIEvent&); diff --git a/include/vsg/core/Visitor.h b/include/vsg/core/Visitor.h index 926076cbca..6ab1c65665 100644 --- a/include/vsg/core/Visitor.h +++ b/include/vsg/core/Visitor.h @@ -73,6 +73,7 @@ namespace vsg // forward declare rtx classes class DrawMeshTasks; class DrawMeshTasksIndirect; + class DrawMeshTasksIndirectCount; // forward declare ui events classes class UIEvent; @@ -262,6 +263,7 @@ namespace vsg // rtx classes virtual void apply(DrawMeshTasks&); virtual void apply(DrawMeshTasksIndirect&); + virtual void apply(DrawMeshTasksIndirectCount&); // ui events virtual void apply(UIEvent&); diff --git a/include/vsg/rtx/README.md b/include/vsg/rtx/README.md index 68f48b7d34..e72798f6d4 100644 --- a/include/vsg/rtx/README.md +++ b/include/vsg/rtx/README.md @@ -8,4 +8,8 @@ * [RayTracingPipeline.h](RayTracingPipeline.h) - * [RayTracingShaderGroup.h](RayTracingShaderGroup.h) - * [TopLevelAccelerationStructure.h](TopLevelAccelerationStructure.h) - -* [TraceRays.h](TraceRays.h) - +* [TraceRays.h](TraceRays.h) - encapsulation of vkCmdTraceRaysNV + +* [DrawMeshTasks.h](DrawMeshTasks.h) - encapsulation of vkCmdDrawMeshTasksNV +* [DrawMeshTasksIndirect.h](DrawMeshTasksIndirect.h) -encapsulation of vkCmdDrawMeshTasksIndirectNV +* [DrawMeshTasksIndirectCount.h](DrawMeshTasksIndirectCount.h) - encapsulation of vkCmdDrawMeshTasksIndirectCountNV diff --git a/include/vsg/vk/Context.h b/include/vsg/vk/Context.h index 3bbf50f36b..8a7f548390 100644 --- a/include/vsg/vk/Context.h +++ b/include/vsg/vk/Context.h @@ -114,7 +114,7 @@ namespace vsg ref_ptr deviceMemoryBufferPools; ref_ptr stagingMemoryBufferPools; - // raytracing + // RTX ray tracing VkDeviceSize scratchBufferSize; std::vector> buildAccelerationStructureCommands; }; diff --git a/src/vsg/README.md b/src/vsg/README.md index f53c461797..b5414a18cc 100644 --- a/src/vsg/README.md +++ b/src/vsg/README.md @@ -13,7 +13,7 @@ The implementations provided by the src/vsg directories mirror the structure of * [src/vsg/vk](vk) - classes that provide wrappers to high level Vulkan objects, providing robust resource management and convinient C++ style setup. * [src/vsg/state](state) - scene graph level classes that provude wrappers Vulkan object with setting Vulkan state such as Pipelines, Unfirorms and Textures. * [src/vsg/commands](commands) - scene graph level classes that proviide wrappers to vkCmd* Vulkan API calls. -* [src/vsg/raytracing](raytracing) - scene graph level classes that provide wrappes to Vulkan ray tracing extensions. +* [src/vsg/rtx](rtx) - scene graph level classes that provide wrappes to Vulkan RTX ray tracing and mesh shader extensions. ## Scene graphs nodes * [src/vsg/nodes](nodes) - scene graph node classes that provide the internal structure to the scene graph. diff --git a/src/vsg/core/ConstVisitor.cpp b/src/vsg/core/ConstVisitor.cpp index b3b4f2c570..13222dec4e 100644 --- a/src/vsg/core/ConstVisitor.cpp +++ b/src/vsg/core/ConstVisitor.cpp @@ -607,6 +607,10 @@ void ConstVisitor::apply(const DrawMeshTasksIndirect& dmti) { apply(static_cast(dmti)); } +void ConstVisitor::apply(const DrawMeshTasksIndirectCount& dmtic) +{ + apply(static_cast(dmtic)); +} //////////////////////////////////////////////////////////////////////////////// // diff --git a/src/vsg/core/Visitor.cpp b/src/vsg/core/Visitor.cpp index 7f94885680..8905ddc018 100644 --- a/src/vsg/core/Visitor.cpp +++ b/src/vsg/core/Visitor.cpp @@ -607,6 +607,10 @@ void Visitor::apply(DrawMeshTasksIndirect& dmti) { apply(static_cast(dmti)); } +void Visitor::apply(DrawMeshTasksIndirectCount& dmtic) +{ + apply(static_cast(dmtic)); +} //////////////////////////////////////////////////////////////////////////////// //