Skip to content
Snippets Groups Projects
Commit 61a7f69f authored by Philip Trettner's avatar Philip Trettner
Browse files
parents 79b2fc34 3c80d322
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,9 @@ project(GlowTests) ...@@ -5,7 +5,9 @@ project(GlowTests)
file(GLOB_RECURSE TEST_SOURCES "src/*.cc" "src/*.hh") file(GLOB_RECURSE TEST_SOURCES "src/*.cc" "src/*.hh")
add_executable(GlowTests ${TEST_SOURCES}) add_executable(GlowTests ${TEST_SOURCES})
target_include_directories(GlowTests PRIVATE "src") target_include_directories(GlowTests PRIVATE "src")
if (NOT MSVC)
target_compile_options(GlowTests PRIVATE -Wall -Werror) target_compile_options(GlowTests PRIVATE -Wall -Werror)
endif()
# Add aion lib # Add aion lib
add_subdirectory(libs/aion) add_subdirectory(libs/aion)
...@@ -18,6 +20,9 @@ add_subdirectory(libs/assimp-lean) ...@@ -18,6 +20,9 @@ add_subdirectory(libs/assimp-lean)
# Add glow-extras lib # Add glow-extras lib
add_subdirectory(libs/glow-extras) add_subdirectory(libs/glow-extras)
# WORKAROUND: Add glm to polymesh
target_include_directories(polymesh PUBLIC ../glow/extern/glm)
# Add GLFW lib (with disabled spam) # Add GLFW lib (with disabled spam)
option(GLFW_BUILD_EXAMPLES "" OFF) option(GLFW_BUILD_EXAMPLES "" OFF)
option(GLFW_BUILD_TESTS "" OFF) option(GLFW_BUILD_TESTS "" OFF)
......
polymesh @ e790aae5
Subproject commit 36326d8416e171b51c4c6782b835c4ae891756e4 Subproject commit e790aae57a7c1af3a9cd5f903fc348b1fdeb23d4
...@@ -11,7 +11,8 @@ GLOW_TEST(Texture2D, Data) ...@@ -11,7 +11,8 @@ GLOW_TEST(Texture2D, Data)
auto tex = Texture2D::create(); auto tex = Texture2D::create();
auto t = tex->bind(); auto t = tex->bind();
t.setData(GL_RGBA32I, 1, 1, (glm::ivec4[]){{1, 2, 3, 4}}); glm::ivec4 d[] = { {1,2,3,4} };
t.setData(GL_RGBA32I, 1, 1, d);
ASSERT_EQ(t.getData<glm::ivec4>()[0], glm::ivec4(1, 2, 3, 4)); ASSERT_EQ(t.getData<glm::ivec4>()[0], glm::ivec4(1, 2, 3, 4));
t.setData<uint8_t>(GL_R8, 4, 2, {1, 2, 3, 4, 5, 6, 7, 8}); t.setData<uint8_t>(GL_R8, 4, 2, {1, 2, 3, 4, 5, 6, 7, 8});
......
...@@ -16,7 +16,8 @@ GLOW_TEST(Texture2DArray, Data) ...@@ -16,7 +16,8 @@ GLOW_TEST(Texture2DArray, Data)
auto tex = Texture2DArray::create(); auto tex = Texture2DArray::create();
auto t = tex->bind(); auto t = tex->bind();
t.setData(GL_RGBA32I, 1, 1, 1, (glm::ivec4[]){{1, 2, 3, 4}}); glm::ivec4 d[] = { {1,2,3,4} };
t.setData(GL_RGBA32I, 1, 1, 1, d);
ASSERT_EQ(t.getData<glm::ivec4>()[0], glm::ivec4(1, 2, 3, 4)); ASSERT_EQ(t.getData<glm::ivec4>()[0], glm::ivec4(1, 2, 3, 4));
t.setData(GL_R32I, 2, 2, 2, std::vector<int>({1, 2, 3, 4, 5, 6, 7, 8})); t.setData(GL_R32I, 2, 2, 2, std::vector<int>({1, 2, 3, 4, 5, 6, 7, 8}));
......
#include "tests.hh" #include "tests.hh"
#include <glow/std140.hh> #include <glow/std140.hh>
#if !GLOW_COMPILER_MSVC
typedef glm::vec4 std140vec4b __attribute__((__aligned__(4 * 4))); typedef glm::vec4 std140vec4b __attribute__((__aligned__(4 * 4)));
typedef glm::vec4 std140vec4c __attribute__((__aligned__(4 * 4))); typedef glm::vec4 std140vec4c __attribute__((__aligned__(4 * 4)));
typedef glm::vec3 std140vec3c __attribute__((__aligned__(4 * 4))); typedef glm::vec3 std140vec3c __attribute__((__aligned__(4 * 4)));
#endif
#include <glow/objects/UniformBuffer.hh> #include <glow/objects/UniformBuffer.hh>
#include <glow/objects/Shader.hh> #include <glow/objects/Shader.hh>
#include <glow/objects/Program.hh> #include <glow/objects/Program.hh>
#if !GLOW_COMPILER_MSVC
typedef glm::vec4 std140vec4d __attribute__((__aligned__(4 * 4))); typedef glm::vec4 std140vec4d __attribute__((__aligned__(4 * 4)));
typedef glm::vec3 std140vec3b __attribute__((__aligned__(4 * 4))); typedef glm::vec3 std140vec3b __attribute__((__aligned__(4 * 4)));
#endif
using namespace glow; using namespace glow;
...@@ -268,7 +272,6 @@ TEST(Std140, Vec3) ...@@ -268,7 +272,6 @@ TEST(Std140, Vec3)
ASSERT_EQ(offsetof(t4b, a), 0 * sizeof(float)); ASSERT_EQ(offsetof(t4b, a), 0 * sizeof(float));
ASSERT_EQ(offsetof(t4b, b), 4 * sizeof(float)); ASSERT_EQ(offsetof(t4b, b), 4 * sizeof(float));
} }
#endif
typedef glm::vec4 v4eUB1 __attribute__((aligned(4 * 4))); typedef glm::vec4 v4eUB1 __attribute__((aligned(4 * 4)));
...@@ -351,6 +354,7 @@ GLOW_TEST(Std140, UB1) ...@@ -351,6 +354,7 @@ GLOW_TEST(Std140, UB1)
auto prog = Program::create(shader); auto prog = Program::create(shader);
ASSERT_TRUE(prog->verifyUniformBuffer("Buffer", ub)); ASSERT_TRUE(prog->verifyUniformBuffer("Buffer", ub));
} }
#endif
GLOW_TEST(Std140, UB2) GLOW_TEST(Std140, UB2)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment