cepl
cepl copied to clipboard
[BUG?] Incorrect type on :ivec4 gpu/c-array
I think CEPL is doing something wrong with :ivec4's created as gpu/c-arrays, causing wonky values in my shaders. Observe:
> (type-of
(car
(cepl:pull-g
(cepl:make-gpu-array
`(,(make-array '(4) :element-type '(signed-byte 32) :initial-contents '(1 2 3 4)))
:element-type :ivec4))))
(SIMPLE-VECTOR 4)
Shouldn't the type here be (SIMPLE-ARRAY (SIGNED-BYTE 32) (4))? The :vec4 type returns an array as you might expect:
> (type-of
(car
(cepl:pull-g
(cepl:make-gpu-array
`(,(make-array '(4) :initial-contents '(1 2 3 4)))
:element-type :vec4))))
(SIMPLE-ARRAY SINGLE-FLOAT (4))
Yeah that looks wonky. I'll mark this as a bug. Cheers!
Thanks again for reporting this. There was indeed a bug in CEPL that affected ivecs and uvecs. Was a simple fix though.
In the next release the behavior will be:
CEPL> (type-of
(car
(cepl:pull-g
(cepl:make-gpu-array
`(,(make-array '(4) :element-type '(signed-byte 32) :initial-contents '(1 2 3 4)))
:element-type :ivec4))))
(SIMPLE-ARRAY (SIGNED-BYTE 32) (4))
The fix can be found the https://github.com/cbaggers/cepl/tree/fix/ivec-conversions branch. It will be merged in after some more testing