summaryrefslogtreecommitdiff
path: root/src/tests/test_uniform_helper.cc
blob: cc1bf59a2906e991f8fc90e5a97491cb0fc002be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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;
}