summaryrefslogtreecommitdiff
path: root/src/tests/test_assets.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-01 18:56:47 +0100
committerskal <pascal.massimino@gmail.com>2026-02-01 18:56:47 +0100
commite3ef115804b46e8bfc594987b04b1059aed5e002 (patch)
tree3670f718ee23cf34e94984568900eac23022d1f0 /src/tests/test_assets.cc
parent7fab8880cca269621cd32610b22f2820567771f2 (diff)
feat(gpu/assets): Fix tests, integrate bumpy 3D renderer and procedural assets
- Fixed test_sequence by restoring MainSequence::init_test for mocking. - Corrected CMakeLists.txt dependencies and source groupings to prevent duplicate symbols. - standardizing Effect constructor signature for seq_compiler compatibility. - Implemented Hybrid3DEffect using bumpy Renderer3D and procedural NOISE_TEX. - Updated MainSequence to support depth buffer for 3D elements. - Formatted all source files with clang-format.
Diffstat (limited to 'src/tests/test_assets.cc')
-rw-r--r--src/tests/test_assets.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/tests/test_assets.cc b/src/tests/test_assets.cc
index dd77b73..c7d41e5 100644
--- a/src/tests/test_assets.cc
+++ b/src/tests/test_assets.cc
@@ -51,11 +51,13 @@ int main() {
// Test procedural asset
printf("\nRunning Procedural Asset test...\n");
size_t proc_size = 0;
- const uint8_t* proc_data_1 = GetAsset(AssetId::ASSET_PROC_NOISE_256, &proc_size);
+ const uint8_t* proc_data_1 =
+ GetAsset(AssetId::ASSET_PROC_NOISE_256, &proc_size);
assert(proc_data_1 != nullptr);
assert(proc_size == 256 * 256 * 4); // 256x256 RGBA8
-
- // Verify first few bytes are not all zero (noise should produce non-zero data)
+
+ // Verify first few bytes are not all zero (noise should produce non-zero
+ // data)
bool non_zero_data = false;
for (size_t i = 0; i < 16; ++i) { // Check first 16 bytes
if (proc_data_1[i] != 0) {
@@ -69,10 +71,12 @@ int main() {
// Test DropAsset for procedural asset and re-generation
DropAsset(AssetId::ASSET_PROC_NOISE_256, proc_data_1);
// After dropping, GetAsset should generate new data
- const uint8_t* proc_data_2 = GetAsset(AssetId::ASSET_PROC_NOISE_256, &proc_size);
+ const uint8_t* proc_data_2 =
+ GetAsset(AssetId::ASSET_PROC_NOISE_256, &proc_size);
assert(proc_data_2 != nullptr);
- // assert(proc_data_1 != proc_data_2); // Removed: Allocator might reuse the same address
-
+ // assert(proc_data_1 != proc_data_2); // Removed: Allocator might reuse the
+ // same address
+
// Verify content again to ensure it was re-generated correctly
non_zero_data = false;
for (size_t i = 0; i < 16; ++i) {