From 3b797f57850fdf9a84c3631305b3778f0daf7d45 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sat, 9 Jul 2022 20:35:36 +0200 Subject: [PATCH] Debug code --- libraries/gpu/src/gpu/Texture_ktx.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/gpu/src/gpu/Texture_ktx.cpp b/libraries/gpu/src/gpu/Texture_ktx.cpp index 6845aeb55b..a7e7844d0b 100644 --- a/libraries/gpu/src/gpu/Texture_ktx.cpp +++ b/libraries/gpu/src/gpu/Texture_ktx.cpp @@ -47,12 +47,15 @@ struct GPUKTXPayload { ser << CURRENT_VERSION; ser << _samplerDesc; + qCWarning(gpulogging) << "Offsets: " << offsetof(struct GPUKTXPayload, _samplerDesc) << offsetof(struct GPUKTXPayload, _usage) << offsetof(struct GPUKTXPayload, _usageType) << offsetof(struct GPUKTXPayload, _originalSize); uint32 usageData = _usage._flags.to_ulong(); ser << usageData; ser << (char)_usageType; ser << _originalSize; ser.addPadding(PADDING); + + assert(ser.length() == GPUKTXPayload::SIZE); } bool unserialize(DataDeserializer &dsr) { @@ -65,6 +68,9 @@ struct GPUKTXPayload { if (version > CURRENT_VERSION) { // If we try to load a version that we don't know how to parse, // it will render incorrectly + qCWarning(gpulogging) << "KTX version" << version << "is newer than our own," << CURRENT_VERSION; + qCWarning(gpulogging) << "Offsets: " << offsetof(struct GPUKTXPayload, _samplerDesc) << offsetof(struct GPUKTXPayload, _usage) << offsetof(struct GPUKTXPayload, _usageType) << offsetof(struct GPUKTXPayload, _originalSize); + qCWarning(gpulogging) << dsr; return false; }