Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
200d7b0
Small include changes.
Dandielo Jul 15, 2021
836416e
Updated the root scripts.
Dandielo Jul 16, 2021
734e05e
Updated validation setup.
Dandielo Jul 16, 2021
4928b7c
Updated conan profiles and workspace script.
Dandielo Sep 16, 2021
b83069b
Update codebase to use Clang-12
Dandielo Sep 20, 2021
e52f289
Use new ice-build-tools version.
Dandielo Sep 20, 2021
fa60d03
Set C++ standard to C++20 for clang builds.
Dandielo Sep 20, 2021
b9d6815
Merge branch 'linux-platform' of github.com:iceshard-engine/engine in…
Dandielo Sep 20, 2021
706c2ca
Update ice-build-tools version.
Dandielo Sep 20, 2021
05caf69
Merge branch 'master' into linux-platform
Dandielo Oct 1, 2021
a49be21
Merge remote-tracking branch 'origin/master' into linux-platform
Dandielo Oct 1, 2021
b553949
Merge branch 'master' into linux-platform
Dandielo Oct 1, 2021
6cec9a4
Merge branch 'master' into branch 'linux-platform' (#78)
Dandielo Oct 29, 2021
50294cf
Merge branch 'master' into linux-platform
Dandielo Dec 10, 2021
c0d22af
Updated configuration files. [skip ci]
Dandielo Dec 13, 2021
68b1aae
First round of code fixes. [skip ci]
Dandielo Dec 14, 2021
fc3ad2c
Second round of fixes. [skip CI]
Dandielo Dec 14, 2021
ea06307
Finished fixes for Linux. [linux]
Dandielo Dec 14, 2021
5bf8608
Update README.md
Dandielo Dec 14, 2021
7da28c5
Switch to GCC on validation builds. [linux]
Dandielo Dec 14, 2021
804019a
Merge branch 'linux-platform' of ssh://github.com/iceshard-engine/eng…
Dandielo Dec 14, 2021
a87410a
Use the 'linux-platform' as sub-workflow source branch. [linux]
Dandielo Dec 14, 2021
5b24598
Update cw_build_parallel.yaml
Dandielo Dec 15, 2021
8ad8951
Update cw_build_single.yaml
Dandielo Dec 15, 2021
386d46f
Update validate.yaml
Dandielo Dec 15, 2021
4778a71
Update cw_build_single.yaml
Dandielo Dec 15, 2021
575800c
Update ICB tools.
Dandielo Dec 15, 2021
a416f3b
Update cw_build_single.yaml
Dandielo Dec 15, 2021
589d111
Update cw_build_single.yaml
Dandielo Dec 15, 2021
8ff2a55
Update ICB tools.
Dandielo Dec 15, 2021
c745c8a
Merge branch 'linux-platform' of ssh://github.com/iceshard-engine/eng…
Dandielo Dec 15, 2021
291080b
Revert changes to cw_build_single.yaml.
Dandielo Dec 15, 2021
b728a51
Update cw_build_single.yaml
Dandielo Dec 15, 2021
9fc3b2b
Update cw_build_single.yaml
Dandielo Dec 15, 2021
14032cb
Update cw_build_single.yaml
Dandielo Dec 15, 2021
3a796c9
Fix '-Wformat-security' issues.
Dandielo Dec 15, 2021
30ca393
Merge branch 'linux-platform' of ssh://github.com/iceshard-engine/eng…
Dandielo Dec 15, 2021
861eb8a
Update cw_build_single.yaml
Dandielo Dec 16, 2021
ee734f9
Updated project configuration.
Dandielo Dec 20, 2021
9a96221
Fixed intellisense compiletime errors.
Dandielo Jan 6, 2022
4c9fc19
Merge remote-tracking branch 'origin/master' into milestone-0501290322
Dandielo Jan 6, 2022
eba014f
Added version to workflow references.
Dandielo Jan 6, 2022
153e007
Falling back to the master version of the workflow reference.
Dandielo Jan 6, 2022
7ad20b5
Started work on the public API.
Dandielo Jan 6, 2022
b47d285
Another set of changes.
Dandielo Jan 9, 2022
705d02e
Compile fix.
Dandielo Jan 9, 2022
2eb2571
Fix unix builds.
Dandielo Jan 9, 2022
e3a2c63
Forgot to move constant variable into #if/#endif.
Dandielo Jan 9, 2022
e7043ee
Another typo.
Dandielo Jan 9, 2022
f89b85f
Updating .natvis files.
Dandielo Jan 11, 2022
66ac062
Simplified the API.
Dandielo Jan 11, 2022
3049e4e
Update test due to changes in Metadata loading.
Dandielo Jan 11, 2022
9f571e4
Renaming file for new requirements.
Dandielo Jan 11, 2022
38087c0
Added test file with special characters in name and content.
Dandielo Jan 11, 2022
94e674d
Update .editorconfig
Dandielo Jan 11, 2022
137a10a
Fixing iclude names.
Dandielo Jan 11, 2022
ac3385e
Changed encoding.
Dandielo Jan 11, 2022
469b58a
Fixed the test meta file.
Dandielo Jan 11, 2022
d73e670
Keep the resource objects we found.
Dandielo Jan 11, 2022
83dbdac
Updated core project.
Dandielo Jan 16, 2022
cdfb9d7
Initial implementation of the new Resource API.
Dandielo Jan 16, 2022
81c581d
A few more changes to smaller projects. Mostly replacing old strings …
Dandielo Jan 16, 2022
d37fc24
Introduced new API in the task project.
Dandielo Jan 16, 2022
2b0775f
Updated the AssetSystem to work with the refactored Resource system.
Dandielo Jan 16, 2022
637148e
Load modules using the windows Unicode API.
Dandielo Jan 16, 2022
8385bd9
Updated all locations with hard-coded asset strings, because the new …
Dandielo Jan 16, 2022
a86fcf1
Updated .editorconfig
Dandielo Jan 16, 2022
7d90f38
Removing dead code.
Dandielo Jan 16, 2022
a368c39
Fixing intellisense issues in stringid.
Dandielo Jan 16, 2022
455ea31
Start to fix warnings and other issues.
Dandielo Jan 16, 2022
2714bc9
Removing unnecessary code.
Dandielo Jan 16, 2022
28acb45
A few more fixes to Release builds.
Dandielo Jan 17, 2022
291bbde
Extended the resource tracker to find resources using relative paths.
Dandielo Jan 17, 2022
e8de21d
Renaming new Resource types removing the '_v2' suffix.
Dandielo Jan 17, 2022
c01c896
Implemented basic support for providing sub-resource data tied to spe…
Dandielo Jan 18, 2022
0e84237
Making the flags better and a bit more customisable.
Dandielo Jan 18, 2022
5bbaf53
Add '_str' suffix operator to create Utf8 strings.
Dandielo Jan 18, 2022
8e1780f
Updated how URI and URN are defined and how to find resources by usin…
Dandielo Jan 18, 2022
93ce275
Build fix.
Dandielo Jan 19, 2022
0d29757
Test warning fixes.
Dandielo Mar 29, 2022
2d53240
Updated murmur3 to work for both ASCI and utf8 character types.
Dandielo Mar 29, 2022
9ed8964
Implementation of hash32 for utf8 strings.
Dandielo Mar 29, 2022
9533575
Small function pointer type.
Dandielo Mar 29, 2022
dcb570e
A few more changes to Data and Span types.
Dandielo Mar 29, 2022
86f6144
Added Resource Flag: Status_Baked.
Dandielo Mar 29, 2022
3aa30eb
Moving default builds to vs2022 and toolset v143.
Dandielo Mar 29, 2022
d6de466
New implementation for the AssetSystem.
Dandielo Mar 29, 2022
da1461a
Removed all asset types. [breaking change][skip ci]
Dandielo Mar 29, 2022
403b7d5
Implemented Texture Loader gfx trait.
Dandielo Apr 4, 2022
168e35a
Finished updating current traits after Asset API change.
Dandielo Apr 10, 2022
0cf3d09
Compilation fix.
Dandielo Apr 10, 2022
e76c770
Small cleanup.
Dandielo Apr 10, 2022
615be0c
Fixed compilation on Linux.
Dandielo Apr 11, 2022
fe1e205
A few fixed warnings.
Dandielo Apr 11, 2022
34bd493
Merged origin/master into milestone-0501290322
Dandielo Apr 11, 2022
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
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@
# top-most EditorConfig file
root = true

[*.{natvis,xml}]
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.{c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true


# Visual C++ Code Style settings

Expand Down
8 changes: 5 additions & 3 deletions source/code/core/collections/natvis/collections.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@

<!-- Native Visualization for the ice::pod::Hash::Entry type -->
<Type Name="ice::pod::Hash&lt;*&gt;::Entry">
<DisplayString IncludeView="ValueOnly">{value}</DisplayString>
<DisplayString>Hash::Entry {{ key={key,X}, value={value} }} : {"$T1",sb}</DisplayString>
<Expand>
<Item Name="[key]">key,X</Item>
<Item Name="[next]" Condition="next != 0xffffffff">next</Item>
<Item Name="[value]">value</Item>
<Item ExcludeView="ValueOnly" Name="[key]">key,X</Item>
<Item ExcludeView="ValueOnly" Name="[next]" Condition="next != 0xffffffff">next</Item>
<Item ExcludeView="ValueOnly" Name="[value]">value</Item>
<ExpandedItem IncludeView="ValueOnly">value</ExpandedItem>
</Expand>
</Type>

Expand Down
30 changes: 21 additions & 9 deletions source/code/core/collections/public/ice/heap_string.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,6 @@ namespace ice
return *this;
}

template<typename CharType>
inline HeapString<CharType>::operator ice::BasicString<CharType>() const noexcept
{
return { _data, _size };
}

template<typename CharType>
inline auto operator==(HeapString<CharType> const& left, CharType const* right) noexcept
{
Expand All @@ -215,6 +209,24 @@ namespace ice
return ice::string::equals(left.operator ice::String(), right.operator ice::String());
}

template<typename CharType>
inline auto HeapString<CharType>::operator[](uint32_t index) noexcept -> CharType&
{
return _data[index];
}

template<typename CharType>
inline auto HeapString<CharType>::operator[](uint32_t index) const noexcept -> CharType const&
{
return _data[index];
}

template<typename CharType>
inline HeapString<CharType>::operator ice::BasicString<CharType>() const noexcept
{
return { _data, _size };
}

namespace string
{

Expand Down Expand Up @@ -272,7 +284,7 @@ namespace ice
template<typename CharType>
inline void resize(ice::HeapString<CharType>& str, uint32_t new_size) noexcept
{
if (new_size > str._capacity - 1)
if ((new_size + 1) > str._capacity)
{
ice::string::grow(str, new_size + 1);
}
Expand Down Expand Up @@ -328,7 +340,7 @@ namespace ice
ice::string::grow(str, new_size + 1);
}

ice::memcpy(ice::string::end(str), ice::string::data(other), ice::string::size(other));
ice::memcpy(ice::string::end(str), ice::string::data(other), ice::string::size(other) * sizeof(CharType));
str._size = new_size;
str._data[str._size] = 0;
}
Expand Down Expand Up @@ -445,7 +457,7 @@ namespace ice
template<typename CharType>
inline auto substr(ice::HeapString<CharType> const& str, uint32_t pos, uint32_t len) noexcept -> ice::BasicString<CharType>
{
return ice::string::substr(str.operator ice::String(), pos, len);
return ice::string::substr(ice::BasicString<CharType>{ str }, pos, len);
}

template<typename CharType>
Expand Down
8 changes: 4 additions & 4 deletions source/code/core/collections/public/ice/pod/array.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,14 @@ namespace ice::pod
template<typename T>
inline void push_back(ice::pod::Array<T>& arr, ice::Span<T const> items) noexcept
{
uint32_t const required_capacity = arr._size + items.size(); // #todo free-function APi
uint32_t const required_capacity = arr._size + ice::size(items);
if (required_capacity > arr._capacity)
{
ice::pod::array::grow(arr, required_capacity);
}

ice::memcpy(ice::pod::array::end(arr), items.data(), items.size_bytes()); // #todo free-function API
arr._size += items.size(); // #todo free-function API
ice::memcpy(ice::pod::array::end(arr), items.data(), items.size_bytes());
arr._size += ice::size(items);
}

template<typename T>
Expand Down Expand Up @@ -357,7 +357,7 @@ namespace ice::pod
template<typename T>
inline auto span(ice::pod::Array<T> const& arr, ice::u32 offset, ice::u32 count) noexcept -> ice::Span<T const>
{
return ice::Span<T const>{ arr }.subspan(offset, (count == ~0) ? std::dynamic_extent : size_t{ count });
return ice::Span<T const>{ arr }.subspan(offset, (count == ~ice::u32{}) ? (arr._size - offset) : size_t{ count });
}

template<typename T>
Expand Down
15 changes: 15 additions & 0 deletions source/code/core/collections/public/ice/pod/collections.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ namespace ice::pod
template<typename T>
struct Array final
{
static_assert(
::std::is_trivially_copyable_v<T>,
"ice::pod::Hash only accepts trivially copyable objects."
);

using ValueType = T;
using Iterator = T*;
using ReverSeIterator = std::reverse_iterator<T*>;
Expand Down Expand Up @@ -37,6 +42,11 @@ namespace ice::pod
template<typename T>
struct Queue final
{
static_assert(
::std::is_trivially_copyable_v<T>,
"ice::pod::Hash only accepts trivially copyable objects."
);

using ValueType = T;

explicit Queue(ice::Allocator& alloc) noexcept;
Expand All @@ -53,6 +63,11 @@ namespace ice::pod
template<typename T>
struct Hash final
{
static_assert(
::std::is_trivially_copyable_v<T>,
"ice::pod::Hash only accepts trivially copyable objects."
);

struct Entry
{
uint64_t key;
Expand Down
11 changes: 10 additions & 1 deletion source/code/core/collections/public/ice/pod/hash.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ namespace ice::pod
inline void remove(ice::pod::Hash<T>& hsh, uint64_t key) noexcept;


template<typename T>
inline bool empty(ice::pod::Hash<T> const& hsh) noexcept;

template<typename T>
inline bool has(ice::pod::Hash<T> const& hsh, uint64_t key) noexcept;

Expand Down Expand Up @@ -276,7 +279,7 @@ namespace ice::pod
{
ice::pod::Hash<T> nh{ *hsh._hash._allocator };
ice::pod::array::resize(nh._hash, new_size);
ice::pod::array::reserve(nh._data, ice::pod::array::size(nh._hash) * (Constant_MaxLoadFactor + 0.05f));
ice::pod::array::reserve(nh._data, static_cast<ice::u32>(ice::pod::array::size(nh._hash) * (Constant_MaxLoadFactor + 0.05f)));
for (uint32_t i = 0; i < new_size; ++i)
{
nh._hash[i] = Constant_EndOfList;
Expand Down Expand Up @@ -345,6 +348,12 @@ namespace ice::pod
}


template<typename T>
inline bool empty(ice::pod::Hash<T> const& hsh) noexcept
{
return ice::pod::array::empty(hsh._data);
}

template<typename T>
inline bool has(ice::pod::Hash<T> const& hsh, uint64_t key) noexcept
{
Expand Down
33 changes: 30 additions & 3 deletions source/code/core/collections/public/ice/span.hxx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#pragma once
#include <ice/base.hxx>
#include <ice/data.hxx>
#include <span>

namespace ice
{

template<typename T, std::size_t Extent = std::dynamic_extent>
using Span = std::span<T, Extent>;
template<typename T, ::std::size_t Extent = ::std::dynamic_extent>
using Span = ::std::span<T, Extent>;

template<typename T>
constexpr auto size(ice::Span<T> const& span) noexcept -> ice::u32
Expand All @@ -20,10 +21,36 @@ namespace ice
return { cont.data(), cont.size() };
}

template<typename T, std::size_t Size, template<typename, std::size_t> typename Container>
template<typename T, ::std::size_t Size, template<typename, ::std::size_t> typename Container>
constexpr auto make_span(Container<T, Size> const& cont) noexcept -> ice::Span<T const, Size>
{
return cont;
}

template<typename T, ::std::size_t Size>
constexpr auto make_span(T(&array_obj)[Size]) noexcept -> ice::Span<T const, Size>
{
return { array_obj };
}

template<typename T>
constexpr auto data_view(ice::Span<T> span, ice::u32 alignment = alignof(T)) noexcept -> ice::Data
{
return Data{
.location = span.data(),
.size = static_cast<ice::u32>(span.size_bytes()),
.alignment = alignment,
};
}

template<typename T>
constexpr auto data_view(ice::Span<T const> span, ice::u32 alignment = alignof(T)) noexcept -> ice::Data
{
return Data{
.location = span.data(),
.size = static_cast<ice::u32>(span.size_bytes()),
.alignment = alignment,
};
}

} // namespace ice
12 changes: 12 additions & 0 deletions source/code/core/collections/public/ice/string_types.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ namespace ice

using String = BasicString<char>;

using Utf8String = BasicString<char8_t>;
using AsciiString = BasicString<char>;

#if ISP_WINDOWS
using WString = BasicString<wchar_t>;
#endif

template<typename CharType = char>
struct HeapString
{
Expand Down Expand Up @@ -79,4 +86,9 @@ namespace ice

static constexpr uint32_t string_npos = std::numeric_limits<uint32_t>::max();

static constexpr auto operator""_str(char8_t const* str, std::size_t size) noexcept
{
return ice::Utf8String{ str, size };
}

} // namespace ice
49 changes: 49 additions & 0 deletions source/code/core/collections/tests/test_data_memory.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include <catch2/catch.hpp>
#include <ice/data.hxx>
#include <ice/span.hxx>

SCENARIO("ice :: Data")
{
ice::Data data{ };

WHEN("Empty")
{
CHECK(data.location == nullptr);
CHECK(data.size == 0);
CHECK(data.alignment == 0);
}

WHEN("Creating a view to a regular value")
{
ice::u64 const value = 0x42069;

data = ice::data_view(value);

CHECK(data.location == &value);
CHECK(data.size == sizeof(ice::u64));
CHECK(data.alignment == alignof(ice::u64));
}

WHEN("Creating a view to a span")
{
ice::u64 const values[]{
0,
0x32,
0x42069,
0,
0x32,
0x42069,
0,
0x32,
0x42069,
};

ice::Span<ice::u64 const> values_span = ice::make_span(values);

data = ice::data_view(values_span);

CHECK(data.location == values_span.data());
CHECK(data.size == values_span.size_bytes());
CHECK(data.alignment == alignof(ice::u64));
}
}
6 changes: 3 additions & 3 deletions source/code/core/collections/tests/test_shard_container.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ SCENARIO("ice :: shard :: ShardContainer")
constexpr ice::i32 test_i32_payload_value1 = 0x103232;
constexpr ice::i32 test_i32_payload_value2 = -0x103232;
constexpr ice::u32 test_u32_payload_value1 = 0x103232;
constexpr ice::u32 test_u32_payload_value2 = -0x103232;
constexpr ice::u32 test_u32_payload_value2 = ~0x103232u;
constexpr ice::i64 test_i64_payload_value1 = 0x7f000000'000000ff;
constexpr ice::i64 test_i64_payload_value2 = 0xff000000'000000ff;
constexpr ice::vec2f test_vec2f_payload_value1 = { 0.16, -0.32 };
constexpr ice::vec2f test_vec2f_payload_value2 = { 0.32, -0.16 };
constexpr ice::vec2f test_vec2f_payload_value1 = { 0.16f, -0.32f };
constexpr ice::vec2f test_vec2f_payload_value2 = { 0.32f, -0.16f };

static constexpr ice::Shard test_shard_3 = "shard_3"_shard;
static constexpr ice::Shard test_shard_4 = "shard_4"_shard;
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/core/private/clock.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace ice
void update(CustomClock& c) noexcept
{
c.previous_timestamp = c.latest_timestamp;
c.latest_timestamp += (c.base_clock->latest_timestamp - c.base_clock->previous_timestamp) * c.modifier;
c.latest_timestamp += static_cast<ice::i64>((c.base_clock->latest_timestamp - c.base_clock->previous_timestamp) * c.modifier);
}

void update_max_delta(CustomClock& c, float max_elapsed_seconds)
Expand Down
15 changes: 15 additions & 0 deletions source/code/core/core/public/ice/base.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,18 @@ namespace ice
using clean_type = clear_type_t<T>;

} // namespace ice

//! \brief This macro is required for a bug apprearing in the MSVC compile when generating optimized code with /O2
Comment thread
Dandielo marked this conversation as resolved.
//! It code affected is generally tied to coroutine functions / methods and seems to only occur when working with loops.
//! A workaround for this problem is to separate the logic of such a coroutine into a separate function and mark it as 'noinline'
//! Once the bug is fixed this macro should be removed.
//!
//! GitHub Issue: #108
#define ISATTR_NOINLINE

#if ISP_WINDOWS

#undef ISATTR_NOINLINE
#define ISATTR_NOINLINE __declspec(noinline)

#endif // #if ISP_WINDOWS
2 changes: 2 additions & 0 deletions source/code/core/core/public/ice/build/platform.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ namespace ice::build
return "msvc";
case Compiler::Clang:
return "clang";
case Compiler::GCC:
return "gcc";
default:
return "<invalid>";
}
Expand Down
Loading