cepl icon indicating copy to clipboard operation
cepl copied to clipboard

Improve UBO user experience

Open cbaggers opened this issue 8 years ago • 3 comments

UBOs still feel too hacky. Mainly because of the gpu-array with 1 element thing.

Work out how to make this feel nicer.

I feel tempted to make the interface block have 1 arrayed element. Then our gpu-arrays just work..however I think this would stop us doing the 'last member of block can be unsized array' thing that glsl likes

cbaggers avatar Nov 24 '17 14:11 cbaggers

I'm trying to use arrays as SSBOs and CEPL complains that these SSBOs must be structs. Along the instruction, I made a struct with a single element, an array of other structs.

However, here is where the problem starts. The size of the array as a slot of the single slot struct is too limited for my uses. Creating this struct with command (setf *model* (make-gpu-array (make-dummy-data) :dimensions 1 :element-type 'single-slot-struct)) fails with this error

the value 80000 is not of type (unsigned-byte 16)

with the backtrace showing (%cepl.types:%make-carray :pointer :dimensions (1) :element-type :single-slot-struct :element-byte-size 80000 :struct-element-typep T :row-byte-size 80000)

I'm able to create arrays holding upwards from 100000 nodes and there appears the question of how to get these rather large models onto the compute shader, if I'm limited by the SSBOs having to be structs and that the struct cant be large enough.

What I'm trying to accomplish is to use cepl as a part of my thesis in financial genetic programming on the gpu and the models that I need to get there are in the size class of >10000 nodes. Each of these nodes holds 20 integers and the single-slot-struct holds that whole model.

ghost avatar Mar 03 '18 13:03 ghost

I was able to hack my way through it for now so it is not an urgent issue. For anyone else experiencing similar size limitations, here is what I did.

in cepl/core/types/cepl-types.lisp changed

(deftype elem-byte-size () '(unsigned-byte 16)) to (deftype elem-byte-size () '(unsigned-byte 32))

This allowed me to have 65000 nodes per model and so far nothing seems to have broken.

ghost avatar Mar 04 '18 12:03 ghost

Thanks @tsili this is the correct fix. Sorry for the mistake, this will be out in the next release

Also your project sounds very cool, I hope CEPL works enough that you. The bug reports are very welcome so please keep them coming :)

cbaggers avatar Mar 05 '18 09:03 cbaggers