summaryrefslogtreecommitdiff
path: root/src/tests/test_uniform_helper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/test_uniform_helper.cc')
-rw-r--r--src/tests/test_uniform_helper.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tests/test_uniform_helper.cc b/src/tests/test_uniform_helper.cc
new file mode 100644
index 0000000..cc1bf59
--- /dev/null
+++ b/src/tests/test_uniform_helper.cc
@@ -0,0 +1,32 @@
+// This file is part of the 64k demo project.
+// It tests the UniformHelper template.
+
+#include "gpu/uniform_helper.h"
+#include <cassert>
+#include <cmath>
+
+// Test uniform struct
+struct TestUniforms {
+ float time;
+ float intensity;
+ float color[3];
+ float _pad;
+};
+
+void test_uniform_buffer_init() {
+ // This test requires WebGPU device initialization
+ // For now, just verify the template compiles
+ UniformBuffer<TestUniforms> buffer;
+ (void)buffer;
+}
+
+void test_uniform_buffer_sizeof() {
+ // Verify sizeof works correctly
+ static_assert(sizeof(TestUniforms) == 24, "TestUniforms should be 24 bytes");
+}
+
+int main() {
+ test_uniform_buffer_init();
+ test_uniform_buffer_sizeof();
+ return 0;
+}