-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3efb7a0
commit ab54c57
Showing
19 changed files
with
20,872 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/cmake/ | ||
/cmake-build-debug/ | ||
/cmake-build-release/ | ||
/tests | ||
/cmake-build-release/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include <gtest/gtest.h> | ||
|
||
#include <limitless/core/context.hpp> | ||
#include <limitless/core/state_buffer.hpp> | ||
#include <limitless/core/state_query.hpp> | ||
|
||
TEST(BufferTest, StateBufferFunctions) { | ||
using namespace Limitless; | ||
|
||
Context context {"test context", {1, 1}, {{WindowHint::Visible, false}}}; | ||
|
||
// bind, bindAs, bindBase, bindBaseAs works as expected | ||
// * state is right when its used | ||
// * state is right when move constructor is invoked | ||
// * state is right when buffer was resized | ||
// * state is right when buffer was cloned | ||
// * state is right when buffer was deleted | ||
// * and map method returned success | ||
|
||
// test every above scenario with complicated state (binding points in particular) | ||
{ | ||
const auto BUFFER_SIZE = 1024; | ||
StateBuffer buffer {Buffer::Type::Array, BUFFER_SIZE, nullptr, Buffer::Usage::StaticDraw, Buffer::MutableAccess::None}; | ||
StateQuery query; | ||
|
||
buffer.bind(); | ||
|
||
ASSERT_EQ(buffer.getId(), context.getBufferTargets().at(Buffer::Type::Array)); | ||
ASSERT_EQ(context.getBufferTargets().at(Buffer::Type::Array), query.geti(QueryState::ArrayBufferBinding)); | ||
} | ||
|
||
{ | ||
const auto BUFFER_SIZE = 1024; | ||
StateBuffer buffer {Buffer::Type::Array, BUFFER_SIZE, nullptr, Buffer::Storage::Static, Buffer::ImmutableAccess::None}; | ||
StateQuery query; | ||
|
||
buffer.bind(); | ||
buffer.resize(2048); | ||
buffer.bind(); | ||
|
||
ASSERT_EQ(buffer.getId(), context.getBufferTargets().at(Buffer::Type::Array)); | ||
ASSERT_EQ(context.getBufferTargets().at(Buffer::Type::Array), query.geti(QueryState::ArrayBufferBinding)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#version 330 | ||
|
||
void main() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Limitless::GLSL_VERSION | ||
|
||
void main() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Limitless::GLSL_VERSION | ||
|
||
Limitless::Extensions | ||
|
||
void main() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Limitless::GLSL_VERSION | ||
|
||
Limitless::Extensions | ||
|
||
#include "./test_include.glsl" | ||
|
||
void main() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Limitless::GLSL_VERSION | ||
|
||
Limitless::Extensions | ||
|
||
#include "./test_dir/test_include.glsl" | ||
|
||
void main() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Limitless::GLSL_VERSION | ||
|
||
Limitless::Extensions | ||
|
||
#include "./test_dir/test_include.glsl" | ||
|
||
void main() { | ||
SOME_STATEMENT | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Limitless::GLSL_VERSION | ||
|
||
Limitless::Extensions | ||
|
||
#include "./test_dir/not_found.glsl" | ||
|
||
void main() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Limitless::GLSL_VERSION | ||
|
||
Limitless::Extensions | ||
|
||
void main() { | ||
kek shrek | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "../test_include.glsl" | ||
|
||
int test_function1() { | ||
return 42; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
int test_function() { | ||
return 42; | ||
} |
Oops, something went wrong.