Commit 429ee7cd authored by Alastair Bridgewater's avatar Alastair Bridgewater
Browse files

Fix endianness issues with use of double-floats in GL.

  Double-floats are serialized as 64-bit quantities, but the
setter function operates in two 32-bit chunks.  These chunks
were being written with the low half first, which is incorrect
for big-endian systems.  Fixed.
parent fbcd6531
......@@ -2172,8 +2172,14 @@
(let ((low (sb-kernel:double-float-low-bits value))
(high (sb-kernel:double-float-high-bits value)))
(declare (type (unsigned-byte 32) low high))
(aset-card32 low array index)
(aset-card32 high array (the array-index (+ index 4))))
#+clx-little-endian
(progn
(aset-card32 low array index)
(aset-card32 high array (the array-index (+ index 4))))
#-clx-little-endian
(progn
(aset-card32 low array (the array-index (+ index 4)))
(aset-card32 high array index)))
value)
......@@ -2186,8 +2192,14 @@
(let ((low (kernel:double-float-low-bits value))
(high (kernel:double-float-high-bits value)))
(declare (type (unsigned-byte 32) low high))
(aset-card32 low array index)
(aset-card32 high array (+ index 4)))
#+clx-little-endian
(progn
(aset-card32 low array index)
(aset-card32 high array (+ index 4)))
#-clx-little-endian
(progn
(aset-card32 low array (+ index 4))
(aset-card32 high array index)))
value)
......@@ -2200,8 +2212,14 @@
(multiple-value-bind (low high)
(ccl::double-float-bits value)
(declare (type (unsigned-byte 32) low high))
(aset-card32 low array index)
(aset-card32 high array (the array-index (+ index 4))))
#+clx-little-endian
(progn
(aset-card32 low array index)
(aset-card32 high array (the array-index (+ index 4))))
#-clx-little-endian
(progn
(aset-card32 low array (the array-index (+ index 4)))
(aset-card32 high array index)))
value)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment