Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master into 1.0 branch #853

Merged
merged 29 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fbd14d3
Update Keyboard.cpp to handle repeat key presses in windows
jamierobertson1 May 30, 2023
7332dc0
Added links to vsgPoints
robertosfield Jun 1, 2023
b57fc4a
Added bool operator to vsg::box and vsg::sphere
robertosfield Jun 1, 2023
5383bfb
Merge pull request #836 from jamierobertson1/jamierobertson1-Keyboard…
vsg-dev Jun 2, 2023
964bcdd
fix mouse double click issue for vsgImgui
aiekick Jun 4, 2023
4624fe7
Merge pull request #839 from aiekick/master
vsg-dev Jun 4, 2023
9ea8d12
Fixed typo and add more info about vsgPoints
robertosfield Jun 4, 2023
662171d
Added 64bit atomic to cmake build test
robertosfield Jun 5, 2023
50a7e09
Added vsg:wstringValue support.
robertosfield Jun 9, 2023
46230aa
Added read/write support for wstring
robertosfield Jun 9, 2023
7ba57f4
Merge pull request #845 from vsg-dev/wstringValue
robertosfield Jun 10, 2023
b88790d
[FIXED] threaded command graph submission order
Jun 10, 2023
f27c54a
Merge pull request #846 from siystar/submit
vsg-dev Jun 10, 2023
92702ea
Bumped version to 1.0.7 rc1 to differentiate with 1.0.6
robertosfield Jun 10, 2023
61e9107
Added color buffer only versions of vsg::createRenderPass(..) and vsg…
robertosfield Jun 12, 2023
7796b62
Removed debug message
robertosfield Jun 12, 2023
fe76afd
Ran clang-format
robertosfield Jun 12, 2023
946c223
Merge branch 'master' into atomic
robertosfield Jun 13, 2023
7e91c22
Moved the include CheckCXXSourceCompiles to local to where it's used.
robertosfield Jun 13, 2023
dab189e
Merge pull request #850 from vsg-dev/atomic
vsg-dev Jun 13, 2023
fce7e60
Added links to header
robertosfield Jun 13, 2023
6079883
Added QuadGroup and Switch::compare(..) implemntations
robertosfield Jun 14, 2023
187b7a2
Added t_sphere ==, != and < operators
robertosfield Jun 14, 2023
4b92f40
Added ==, != and < operators
robertosfield Jun 14, 2023
7c061e5
Added compare(..) implementations
robertosfield Jun 14, 2023
ab2f72d
Moved priority to make it clearer what does what
robertosfield Jun 14, 2023
e4f192f
Fixed brackets
robertosfield Jun 14, 2023
de6bb61
Quitened cppcheck warning
robertosfield Jun 14, 2023
0d3d469
Merge pull request #852 from vsg-dev/compare
vsg-dev Jun 14, 2023
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
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.7)

project(vsg
VERSION 1.0.6
VERSION 1.0.7
DESCRIPTION "VulkanSceneGraph library"
LANGUAGES CXX
)
set(VSG_SOVERSION 13)
SET(VSG_RELEASE_CANDIDATE 0)
SET(VSG_RELEASE_CANDIDATE 1)
set(Vulkan_MIN_VERSION 1.1.70.0)

set(VSG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Root source directory of VulkanSceneGraph.")
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Hosted as part of the [vsg-dev](https://github.com/vsg-dev):
* [osg2vsg](https://github.com/vsg-dev/osg2vsg) OpenSceneGraph integration library that enables converting of OSG to VSG scene graph and use of OpenSceneGraph loaders.
* [vsgImGui](https://github.com/vsg-dev/vsgImGui) ImGui integration enabling UI in graphics window.
* [vsgQt](https://github.com/vsg-dev/vsgQt) Qt integration with VulkanSceneGraph.
* [vsgPoints](https://github.com/vsg-dev/vsgPoints) 3d point cloud loading and rendering for VulkanSceneGraph with database paging support and scalability up to billions of ponts.
* [vsgUnity](https://github.com/vsg-dev/vsgUnity) plugin for Unity that provides export to native VulkanSceneGraph binary/ascii format.
* [MyFirstVsgApplication](https://github.com/vsg-dev/MyFirstVsgApplication) simple standalone VSG application that can be used as a template for your own applications.
* [vsgFramework](https://github.com/vsg-dev/vsgFramework) template project that uses CMake FetchContent to pull in all the main libraries associated with VulkanSceneGraph and dependencies and builds them together.
Expand Down
1 change: 1 addition & 0 deletions include/vsg/core/ConstVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ namespace vsg

// Values
virtual void apply(const stringValue&);
virtual void apply(const wstringValue&);
virtual void apply(const boolValue&);
virtual void apply(const intValue&);
virtual void apply(const uintValue&);
Expand Down
1 change: 1 addition & 0 deletions include/vsg/core/Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ namespace vsg
}

VSG_value(stringValue, std::string);
VSG_value(wstringValue, std::wstring);

VSG_value(boolValue, bool);
VSG_value(intValue, int);
Expand Down
1 change: 1 addition & 0 deletions include/vsg/core/Visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ namespace vsg

// Values
virtual void apply(stringValue&);
virtual void apply(wstringValue&);
virtual void apply(boolValue&);
virtual void apply(intValue&);
virtual void apply(uintValue&);
Expand Down
6 changes: 6 additions & 0 deletions include/vsg/io/AsciiInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,15 @@ namespace vsg
// read in an individual string
void _read(std::string& value);

// read in an individual string
void _read(std::wstring& value);

/// read one or more strings
void read(size_t num, std::string* value) override;

/// read one or more strings
void read(size_t num, std::wstring* value) override;

/// read one or more strings
void read(size_t num, Path* value) override;

Expand Down
3 changes: 3 additions & 0 deletions include/vsg/io/AsciiOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ namespace vsg
_output << '"';
}

void _write(const std::wstring& str);

void write(size_t num, const std::string* value) override;
void write(size_t num, const std::wstring* value) override;
void write(size_t num, const Path* value) override;

/// write object
Expand Down
6 changes: 6 additions & 0 deletions include/vsg/io/BinaryInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ namespace vsg
/// read one or more strings
void read(size_t num, std::string* value) override;

// read in an individual string
void _read(std::wstring& value);

/// read one or more strings
void read(size_t num, std::wstring* value) override;

/// read one or more paths
void read(size_t num, Path* value) override;

Expand Down
9 changes: 3 additions & 6 deletions include/vsg/io/BinaryOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,11 @@ namespace vsg
void write(size_t num, const float* value) override { _write(num, value); }
void write(size_t num, const double* value) override { _write(num, value); }

void _write(const std::string& str)
{
uint32_t size = static_cast<uint32_t>(str.size());
_output.write(reinterpret_cast<const char*>(&size), sizeof(uint32_t));
_output.write(str.c_str(), size);
}
void _write(const std::string& str);
void _write(const std::wstring& str);

void write(size_t num, const std::string* value) override;
void write(size_t num, const std::wstring* value) override;
void write(size_t num, const Path* value) override;

/// write object
Expand Down
1 change: 1 addition & 0 deletions include/vsg/io/Input.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ namespace vsg
virtual void read(size_t num, float* value) = 0;
virtual void read(size_t num, double* value) = 0;
virtual void read(size_t num, std::string* value) = 0;
virtual void read(size_t num, std::wstring* value) = 0;
virtual void read(size_t num, Path* value) = 0;

// read object
Expand Down
1 change: 1 addition & 0 deletions include/vsg/io/Output.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ namespace vsg
virtual void write(size_t num, const float* value) = 0;
virtual void write(size_t num, const double* value) = 0;
virtual void write(size_t num, const std::string* value) = 0;
virtual void write(size_t num, const std::wstring* value) = 0;
virtual void write(size_t num, const Path* value) = 0;

/// write object
Expand Down
23 changes: 23 additions & 0 deletions include/vsg/maths/box.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ namespace vsg

bool valid() const { return min.x <= max.x; }

explicit operator bool() const noexcept { return valid(); }

T* data() { return min.data(); }
const T* data() const { return min.data(); }

Expand Down Expand Up @@ -91,4 +93,25 @@ namespace vsg

VSG_type_name(vsg::box);
VSG_type_name(vsg::dbox);

template<typename T>
constexpr bool operator==(const t_box<T>& lhs, const t_box<T>& rhs)
{
return (lhs.min == rhs.min) && (lhs.max == rhs.max);
}

template<typename T>
constexpr bool operator!=(const t_box<T>& lhs, const t_box<T>& rhs)
{
return (lhs.min != rhs.min) || (lhs.max != rhs.max);
}

template<typename T>
constexpr bool operator<(const t_box<T>& lhs, const t_box<T>& rhs)
{
if (lhs.min < rhs.min) return true;
if (rhs.min < lhs.min) return false;
return lhs.max < rhs.max;
}

} // namespace vsg
24 changes: 24 additions & 0 deletions include/vsg/maths/plane.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,30 @@ namespace vsg
VSG_type_name(vsg::plane);
VSG_type_name(vsg::dplane);

template<typename T>
constexpr bool operator==(const t_plane<T>& lhs, const t_plane<T>& rhs)
{
return lhs[0] == rhs[0] && lhs[1] == rhs[1] && lhs[2] == rhs[2] && lhs[3] == rhs[3];
}

template<typename T>
constexpr bool operator!=(const t_plane<T>& lhs, const t_plane<T>& rhs)
{
return lhs[0] != rhs[0] || lhs[1] != rhs[1] || lhs[2] != rhs[2] || lhs[3] != rhs[3];
}

template<typename T>
constexpr bool operator<(const t_plane<T>& lhs, const t_plane<T>& rhs)
{
if (lhs[0] < rhs[0]) return true;
if (lhs[0] > rhs[0]) return false;
if (lhs[1] < rhs[1]) return true;
if (lhs[1] > rhs[1]) return false;
if (lhs[2] < rhs[2]) return true;
if (lhs[2] > rhs[2]) return false;
return lhs[3] < rhs[3];
}

template<typename T>
constexpr T distance(const t_plane<T>& pl, const t_vec3<T>& v)
{
Expand Down
23 changes: 23 additions & 0 deletions include/vsg/maths/sphere.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ namespace vsg

bool valid() const { return radius >= 0.0; }

explicit operator bool() const noexcept { return valid(); }

T* data() { return value; }
const T* data() const { return value; }

Expand All @@ -123,6 +125,27 @@ namespace vsg

VSG_type_name(vsg::sphere);
VSG_type_name(vsg::dsphere);

template<typename T>
constexpr bool operator==(const t_sphere<T>& lhs, const t_sphere<T>& rhs)
{
return (lhs.center == rhs.center) && (lhs.radius == rhs.radius);
}

template<typename T>
constexpr bool operator!=(const t_sphere<T>& lhs, const t_sphere<T>& rhs)
{
return (lhs.center != rhs.center) || (lhs.radius != rhs.radius);
}

template<typename T>
constexpr bool operator<(const t_sphere<T>& lhs, const t_sphere<T>& rhs)
{
if (lhs.center < rhs.center) return true;
if (rhs.center < lhs.center) return false;
return lhs.radius < rhs.radius;
}

} // namespace vsg

#if defined(__clang__)
Expand Down
2 changes: 2 additions & 0 deletions include/vsg/nodes/LOD.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ namespace vsg
void traverse(ConstVisitor& visitor) const override { t_traverse(*this, visitor); }
void traverse(RecordTraversal& visitor) const override { t_traverse(*this, visitor); }

int compare(const Object& rhs) const override;

void read(Input& input) override;
void write(Output& output) const override;

Expand Down
8 changes: 5 additions & 3 deletions include/vsg/nodes/PagedLOD.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ namespace vsg
void traverse(ConstVisitor& visitor) const override { t_traverse(*this, visitor); }
void traverse(RecordTraversal& visitor) const override { t_traverse(*this, visitor); }

int compare(const Object& rhs) const override;

void read(Input& input) override;
void write(Output& output) const override;

Expand All @@ -62,9 +64,6 @@ namespace vsg
// external file to load when child 0 is null.
Path filename;

// priority value assigned by record traversal as a guide to how important the external child is for loading.
mutable std::atomic<double> priority{0.0};

dsphere bound;

using Children = std::array<Child, 2>;
Expand All @@ -81,6 +80,9 @@ namespace vsg
public:
ref_ptr<Options> options;

// priority value assigned by record traversal as a guide to how important the external child is for loading.
mutable std::atomic<double> priority{0.0};

mutable std::atomic_uint64_t frameHighResLastUsed{0};
mutable std::atomic_uint requestCount{0};

Expand Down
2 changes: 2 additions & 0 deletions include/vsg/nodes/QuadGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ namespace vsg
void traverse(ConstVisitor& visitor) const override { t_traverse(*this, visitor); }
void traverse(RecordTraversal& visitor) const override { t_traverse(*this, visitor); }

int compare(const Object& rhs) const override;

void read(Input& input) override;
void write(Output& output) const override;

Expand Down
2 changes: 2 additions & 0 deletions include/vsg/nodes/Switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ namespace vsg
void traverse(ConstVisitor& visitor) const override { t_traverse(*this, visitor); }
void traverse(RecordTraversal& visitor) const override { t_traverse(*this, visitor); }

int compare(const Object& rhs) const override;

void read(Input& input) override;
void write(Output& output) const override;

Expand Down
1 change: 1 addition & 0 deletions include/vsg/text/Text.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ namespace vsg
size_t count = 0;

void apply(const stringValue& text) override;
void apply(const wstringValue& text) override;
void apply(const ubyteArray& text) override;
void apply(const ushortArray& text) override;
void apply(const uintArray& text) override;
Expand Down
9 changes: 9 additions & 0 deletions include/vsg/vk/RenderPass.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,16 @@ namespace vsg
extern VSG_DECLSPEC AttachmentDescription defaultColorAttachment(VkFormat imageFormat);
extern VSG_DECLSPEC AttachmentDescription defaultDepthAttachment(VkFormat depthFormat);

/// create RenderPass with color and depth buffers
extern VSG_DECLSPEC ref_ptr<RenderPass> createRenderPass(Device* device, VkFormat imageFormat, VkFormat depthFormat, bool requiresDepthRead = false);

/// create RenderPass with multisampled color and depth buffers
extern VSG_DECLSPEC ref_ptr<RenderPass> createMultisampledRenderPass(Device* device, VkFormat imageFormat, VkFormat depthFormat, VkSampleCountFlagBits samples, bool requiresDepthRead = false);

/// create RenderPass with color buffers
extern VSG_DECLSPEC ref_ptr<RenderPass> createRenderPass(Device* device, VkFormat imageFormat);

/// create RenderPass with multisampled color buffer
extern VSG_DECLSPEC ref_ptr<RenderPass> createMultisampledRenderPass(Device* device, VkFormat imageFormat, VkSampleCountFlagBits samples);

} // namespace vsg
16 changes: 12 additions & 4 deletions src/vsg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(CheckCXXSourceCompiles)

# collect all the headers in the source directory
file(GLOB HEADERS ${VSG_SOURCE_DIR}/include/vsg/*.h ${VSG_SOURCE_DIR}/include/vsg/*/*.h)

Expand Down Expand Up @@ -241,10 +239,20 @@ set(LIBRARIES PUBLIC

# Check for std::atomic
if(NOT MSVC AND NOT ANDROID AND NOT APPLE)
include(CheckCXXSourceCompiles)

check_cxx_source_compiles("
#include <atomic>
std::atomic<int> a;
int main() { return a; }"
int main()
{
std::atomic_uint64_t a64(1);
auto orig_value = a64.load();

uint64_t new_value = 1;
auto r = a64.compare_exchange_weak(orig_value, new_value);

return 0;
}"
HAVE_CXX_ATOMIC_WITHOUT_LIB
)
if(NOT HAVE_CXX_ATOMIC_WITHOUT_LIB)
Expand Down
Loading