From c1458fc42074111b3bccd091e3e90a844c2c56bb Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Mon, 1 Apr 2024 18:55:59 +0100 Subject: [PATCH] Fix handling of UScaled, SScaled in DecodeFormattedComponents Only UInt and SInt data is stored in integer representation in return from DecodePixelData --- renderdoc/maths/formatpacking.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renderdoc/maths/formatpacking.cpp b/renderdoc/maths/formatpacking.cpp index 5e6a0b05b..d8614b211 100644 --- a/renderdoc/maths/formatpacking.cpp +++ b/renderdoc/maths/formatpacking.cpp @@ -325,14 +325,14 @@ FloatVector DecodeFormattedComponents(const ResourceFormat &fmt, const byte *dat DecodePixelData(fmt, data, val, success); FloatVector ret; - if(fmt.compType == CompType::UInt || fmt.compType == CompType::UScaled) + if(fmt.compType == CompType::UInt) { ret.x = (float)val.uintValue[0]; ret.y = (float)val.uintValue[1]; ret.z = (float)val.uintValue[2]; ret.w = (float)val.uintValue[3]; } - else if(fmt.compType == CompType::SInt || fmt.compType == CompType::SScaled) + else if(fmt.compType == CompType::SInt) { ret.x = (float)val.intValue[0]; ret.y = (float)val.intValue[1];