gprt-org / GPRT

MIT License
22 stars 6 forks source link

Feature Request: Check that the sizeof VarDecl type matches struct field #55

Closed natevm closed 1 year ago

natevm commented 1 year ago

I just ran into this tricky bug...

Here, we were using a uint64_t to represent the pointer of a vertex buffer, however, the type should have been gprt::Buffer, which is actually a uint64_t2. image

The end result currently is a rather ambiguous "DEVICE LOST" error when trying to launch any kernel using these types.

It would be great to do some sort of compile time check that the type of the variable in the GPRTVarDecl list matches--in size at the very least--with the given GPRT_TYPE enumeration.

natevm commented 1 year ago

This issue is addressed with PR #56