diff --git a/MobileGL/Includes.h b/MobileGL/Includes.h index c2a0237e..c8cec43f 100644 --- a/MobileGL/Includes.h +++ b/MobileGL/Includes.h @@ -91,9 +91,9 @@ int __android_log_print(int prio, const char *tag, const char *fmt, ...); #include #include -#include "MG_Util/Miscellany/IndexGenerator.h" #include "MG_Util/GLExtensions.h" #include "MG_Util/Types.h" +#include "MG_Util/Miscellany/IndexGenerator.h" #include "MG_Util/Debug/Log.h" #include "MG_Util/Converters/GLToStr/GLEnumConverter.h" #include "MG_Util/Converters/MGToStr/GLExtensionConverter.h" diff --git a/MobileGL/MG_State/GLState/BufferState/BufferState.cpp b/MobileGL/MG_State/GLState/BufferState/BufferState.cpp index 720423cf..60fc399c 100644 --- a/MobileGL/MG_State/GLState/BufferState/BufferState.cpp +++ b/MobileGL/MG_State/GLState/BufferState/BufferState.cpp @@ -14,7 +14,7 @@ namespace MobileGL { m_size = size; m_data.reserve(std::bit_ceil(size)); // power-of-2 reserve m_data.resize(size); - m_dirtyRange.Update(0, 0); + m_dirtyRange = { 0, 0 }; } void BufferObject::UploadData(DataPtr data, SizeT atOffset) { @@ -40,7 +40,6 @@ namespace MobileGL { } m_stagingData.clear(); - m_stagingData.shrink_to_fit(); } m_isMapped = false; diff --git a/MobileGL/MG_Test/Buffer/BufferTest.cpp b/MobileGL/MG_Test/Buffer/BufferTest.cpp index a6df4ec2..cd682c8f 100644 --- a/MobileGL/MG_Test/Buffer/BufferTest.cpp +++ b/MobileGL/MG_Test/Buffer/BufferTest.cpp @@ -48,19 +48,21 @@ TEST_F(BufferTest, PingPong) { Vector data { 1, 2, 3, 4, 5 }; - SizeT byte_size = data.size() * sizeof(Int); + SizeT byteSize = data.size() * sizeof(Int); // Write data - bufWrite->Resize(byte_size); - DataPtr ptr { .data = data.data(), .size = byte_size }; + bufWrite->Resize(byteSize); + DataPtr ptr { .data = data.data(), .size = byteSize }; bufWrite->UploadData(ptr, 0); // Readback auto bufRead = readSlot.GetBoundObject(); void* p = bufRead->AcquireMemory(true, true, false); - ASSERT_TRUE(memcmp(data.data(), p, byte_size) == 0); + Vector bufdata(data.size()); + memcpy(bufdata.data(), p, byteSize); + ASSERT_EQ(data, bufdata); auto range = bufRead->GetDirtyRange(); ASSERT_EQ(range.start, 0); - ASSERT_EQ(range.end, byte_size); + ASSERT_EQ(range.end, byteSize); } TEST_F(BufferTest, GenerateManyNames_NoPrematureCreation) { diff --git a/MobileGL/MG_Util/Miscellany/IndexGenerator.h b/MobileGL/MG_Util/Miscellany/IndexGenerator.h index 18238c50..01b1a976 100644 --- a/MobileGL/MG_Util/Miscellany/IndexGenerator.h +++ b/MobileGL/MG_Util/Miscellany/IndexGenerator.h @@ -52,7 +52,7 @@ namespace MobileGL { private: IndexType next_index_ = 0; std::vector freed_indices_; - std::vector is_valid_; + std::vector is_valid_; }; }