From 8e41908e49f845e5937768b9631886e1de37787b Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sat, 31 Dec 2022 19:32:33 +0100 Subject: [PATCH] Partial spherical harmonics tests --- tests/ktx/src/KtxTests.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/tests/ktx/src/KtxTests.cpp b/tests/ktx/src/KtxTests.cpp index 25ab15f5db..cac9690b5c 100644 --- a/tests/ktx/src/KtxTests.cpp +++ b/tests/ktx/src/KtxTests.cpp @@ -16,7 +16,9 @@ #include #include #include - +#include "SerDes.h" +#include "KTX.h" +#include "Texture_ktx.cpp" QTEST_GUILESS_MAIN(KtxTests) @@ -31,6 +33,19 @@ QString getRootPath() { return result; } +#if 0 +ktx::Byte* serializeSPH(ktx::Byte* data, const gpu::IrradianceKTXPayload &payload) const { + *(ktx::IrradianceKTXPayload::Version*)data = IrradianceKTXPayload::CURRENT_VERSION; + data += sizeof(ktx::IrradianceKTXPayload::Version); + + memcpy(data, &payload._irradianceSH, sizeof(ktx::SphericalHarmonics)); + data += sizeof(SphericalHarmonics); + + return data + PADDING; +} +#endif + + void KtxTests::initTestCase() { } @@ -147,6 +162,14 @@ void KtxTests::testKtxSerialization() { testTexture->setKtxBacking(TEST_IMAGE_KTX.fileName().toStdString()); } + +void KtxTests::testKtxNewSerializationSphericalHarmonics() { + DataSerializer ser; + + +} + + #if 0 static const QString TEST_FOLDER { "H:/ktx_cacheold" };