mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
fix unpackData bug when unpacking UNorm and SNorm data
This commit is contained in:
@@ -115,10 +115,10 @@ For normalised formats - :py:attr:`~renderdoc.CompType.UNorm` and :py:attr:`~ren
|
||||
|
||||
# If the format needs post-processing such as normalisation, do that now
|
||||
if fmt.compType == rd.CompType.UNorm:
|
||||
divisor = float((1 << fmt.compByteWidth) - 1)
|
||||
divisor = float((2 ** (fmt.compByteWidth * 8)) - 1)
|
||||
value = tuple(float(i) / divisor for i in value)
|
||||
elif fmt.compType == rd.CompType.SNorm:
|
||||
maxNeg = -(1 << (fmt.compByteWidth - 1))
|
||||
maxNeg = -float((2 ** (fmt.compByteWidth * 8)) - 1) / 2
|
||||
divisor = float(-(maxNeg-1))
|
||||
value = tuple((float(i) if (i == maxNeg) else (float(i) / divisor)) for i in value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user