From e3ef115804b46e8bfc594987b04b1059aed5e002 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 1 Feb 2026 18:56:47 +0100 Subject: 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. --- src/tests/test_assets.cc | 16 ++++++++++------ src/tests/test_sequence.cc | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src/tests') 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) { diff --git a/src/tests/test_sequence.cc b/src/tests/test_sequence.cc index a48c733..788e0b1 100644 --- a/src/tests/test_sequence.cc +++ b/src/tests/test_sequence.cc @@ -99,7 +99,7 @@ class DummyPostProcessEffect : public PostProcessEffect { void test_effect_lifecycle() { printf(" test_effect_lifecycle...\n"); MainSequence main_seq; - main_seq.init(dummy_device, dummy_queue, dummy_format, 320, 200); + main_seq.init_test(dummy_device, dummy_queue, dummy_format); auto effect1 = std::make_shared(dummy_device, dummy_queue); auto seq1 = std::make_shared(); @@ -145,7 +145,7 @@ void test_simulate_until() { #if !defined(STRIP_ALL) printf(" test_simulate_until...\n"); MainSequence main_seq; - main_seq.init(dummy_device, dummy_queue, dummy_format, 320, 240); + main_seq.init_test(dummy_device, dummy_queue, dummy_format); auto effect1 = std::make_shared(dummy_device, dummy_queue); auto seq1 = std::make_shared(); -- cgit v1.2.3