From e2f843d1a49267715a290ce4475af63bd14208e4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 26 Sep 2023 09:50:39 +0100 Subject: [PATCH] Ran clang-format --- include/vsg/state/ViewDependentState.h | 4 ++-- include/vsg/utils/ShaderSet.h | 3 +-- src/vsg/app/View.cpp | 1 - src/vsg/state/ViewDependentState.cpp | 10 ++++------ src/vsg/utils/AnimationPath.cpp | 2 +- src/vsg/utils/ShaderSet.cpp | 2 +- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/include/vsg/state/ViewDependentState.h b/include/vsg/state/ViewDependentState.h index 77b1eb452..e1bf4fb42 100644 --- a/include/vsg/state/ViewDependentState.h +++ b/include/vsg/state/ViewDependentState.h @@ -14,12 +14,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include +#include #include #include #include #include #include -#include namespace vsg { @@ -110,7 +110,7 @@ namespace vsg static void t_traverse(N& node, V& visitor) { node.descriptorSet->accept(visitor); - if (node.preRenderCommandGraph) node.preRenderCommandGraph->accept(visitor ); + if (node.preRenderCommandGraph) node.preRenderCommandGraph->accept(visitor); } void traverse(Visitor& visitor) override { t_traverse(*this, visitor); } diff --git a/include/vsg/utils/ShaderSet.h b/include/vsg/utils/ShaderSet.h index 6855edb98..41b2da1d3 100644 --- a/include/vsg/utils/ShaderSet.h +++ b/include/vsg/utils/ShaderSet.h @@ -136,8 +136,7 @@ namespace vsg /// add an uniform binding. Not thread safe, should only be called when initially setting up the ShaderSet void addDescriptorBinding(const std::string& name, const std::string& define, uint32_t set, uint32_t binding, VkDescriptorType descriptorType, uint32_t descriptorCount, VkShaderStageFlags stageFlags, ref_ptr data); - [[deprecated("use addDescriptorBinding(..)")]] - void addUniformBinding(const std::string& name, const std::string& define, uint32_t set, uint32_t binding, VkDescriptorType descriptorType, uint32_t descriptorCount, VkShaderStageFlags stageFlags, ref_ptr data) { addDescriptorBinding(name, define, set, binding, descriptorType, descriptorCount, stageFlags, data); } + [[deprecated("use addDescriptorBinding(..)")]] void addUniformBinding(const std::string& name, const std::string& define, uint32_t set, uint32_t binding, VkDescriptorType descriptorType, uint32_t descriptorCount, VkShaderStageFlags stageFlags, ref_ptr data) { addDescriptorBinding(name, define, set, binding, descriptorType, descriptorCount, stageFlags, data); } /// add a push constant range. Not thread safe, should only be called when initially setting up the ShaderSet void addPushConstantRange(const std::string& name, const std::string& define, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size); diff --git a/src/vsg/app/View.cpp b/src/vsg/app/View.cpp index a805b36eb..84fc6974b 100644 --- a/src/vsg/app/View.cpp +++ b/src/vsg/app/View.cpp @@ -84,7 +84,6 @@ View::View(const View& view) : camera->viewportState = view.camera->viewportState; } - viewDependentState = ViewDependentState::create(this, view.viewDependentState->active); // info("View::View(const View&) ", this, ", ", viewDependentState, ", ", viewID); diff --git a/src/vsg/state/ViewDependentState.cpp b/src/vsg/state/ViewDependentState.cpp index 2a241ebc5..143d9c838 100644 --- a/src/vsg/state/ViewDependentState.cpp +++ b/src/vsg/state/ViewDependentState.cpp @@ -183,7 +183,7 @@ void ViewDependentState::init(ResourceRequirements& requirements) uint32_t shadowHeight = 2048; uint32_t maxShadowMaps = 8; - uint32_t lightDataSize = 4 + maxNumberLights * 16 + maxShadowMaps * 16; + uint32_t lightDataSize = 4 + maxNumberLights * 16 + maxShadowMaps * 16; // info("ViewDependentState::init() ", lightDataSize, ", ", maxViewports, ", this = ", this, ", active = ", active); @@ -280,7 +280,6 @@ void ViewDependentState::init(ResourceRequirements& requirements) //write(shadowMapData, "test.vsgt"); } - void ViewDependentState::compile(Context& context) { descriptorSet->compile(context); @@ -301,7 +300,7 @@ void ViewDependentState::compile(Context& context) shadowDepthImage->compile(context); uint32_t layer = 0; - for(auto& shadowMap : shadowMaps) + for (auto& shadowMap : shadowMaps) { // create depth buffer auto depthImageView = ImageView::create(shadowDepthImage, VK_IMAGE_ASPECT_DEPTH_BIT); @@ -485,7 +484,6 @@ void ViewDependentState::traverse(RecordTraversal& rt) const auto light_z = light_direction; auto updateCamera = [&](double clip_near_z, double clip_far_z, const dmat4& clipToWorld) -> void { - auto& shadowMap = shadowMaps[shadowMapIndex]; preRenderSwitch->children[shadowMapIndex].mask = MASK_ALL; @@ -516,8 +514,8 @@ void ViewDependentState::traverse(RecordTraversal& rt) const if (!ortho) { ortho = Orthographic::create(ls_bounds.min.x, ls_bounds.max.x, - ls_bounds.min.y, ls_bounds.max.y, - ls_bounds.min.z, ls_bounds.max.z); + ls_bounds.min.y, ls_bounds.max.y, + ls_bounds.min.z, ls_bounds.max.z); camera->projectionMatrix = ortho; } else diff --git a/src/vsg/utils/AnimationPath.cpp b/src/vsg/utils/AnimationPath.cpp index 4222c9b0a..4e5e57995 100644 --- a/src/vsg/utils/AnimationPath.cpp +++ b/src/vsg/utils/AnimationPath.cpp @@ -77,7 +77,7 @@ void AnimationPath::read(Input& input) if (input.version_greater_equal(1, 0, 10)) input.readValue("mode", mode); - + auto numLocations = input.readValue("NumLocations"); locations.clear(); diff --git a/src/vsg/utils/ShaderSet.cpp b/src/vsg/utils/ShaderSet.cpp index d1de570f8..b459e21d7 100644 --- a/src/vsg/utils/ShaderSet.cpp +++ b/src/vsg/utils/ShaderSet.cpp @@ -10,6 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ +#include #include #include #include @@ -25,7 +26,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include #include -#include #include #include "shaders/flat_ShaderSet.cpp"