Aloha dear community,
I started playing around with nv_command_list and was wondering about the methods that lwjgl exposes.
My questions are:
1) if the DrawCommandsStatesNV takes (uint buffer, const intptr* indirects, ...)
why does the lwjgl version take (int buffer, PointerBuffer indirects, ...) instead of (int buffer, IntBuffer indirects, ...)
am I supposed to provide a PointerBuffer that contains as many IntBuffers as needed where each of those
IntBuffers only contains a single offset or did I misunderstand how to provide the offsets?
2) ListDrawCommandsStatesClientNV expects (..., const sizei* sizes, ...) and the lwjgl version expects a PointerBuffer here, too
Again I am wondering how to setup the PointerBuffer to contain the sizes
Specifically it is about these commands from the extension:
void ListDrawCommandsStatesClientNV(uint list, uint segment, const void** indirects,
const sizei* sizes, const uint* states, const uint* fbos,
uint count);
and the lwjgl method is
public static void glListDrawCommandsStatesClientNV(int list, int segment, PointerBuffer indirects,
PointerBuffer sizes, IntBuffer states, IntBuffer fbos)
while the spec of the extension says about this command:
A list has multiple segments and each segment enqueues an ordered list of
command sequences. This command enqueues the equivalent of the DrawCommandsStatesNV
commands into the list indicated by <list> on the segment indicated by <segment>
except that the sequence data is copied from the sequences pointed to by the <indirects>
pointer. The <indirects> pointer should point to a list of size <count> of pointers,
each of which should point to a command sequence.
[...]
ListDrawCommandsStatesClientNV performs a by-value copy of the
indirect data based on the provided client-side pointers. In this case
the content is fully immutable, while the buffer-based versions can
change the content of the buffers at any later time.
now the mentioned DrawCommandsStatesNV has the following signature:
void DrawCommandsStatesNV(uint buffer, const intptr* indirects, const sizei* sizes,
const uint* states, const uint* fbos, uint count);
as well as a version taking addresses:
void DrawCommandsStatesAddressNV(const uint64* indirects, const sizei* sizes,
const uint* states, const uint* fbos, uint count);
and the spec states:
These commands accept arrays of buffer addresses (either an array of
offsets <indirects> into a buffer named by <buffer>, or an array of GPU
addresses <indirects>), an array of sequence lengths in <sizes>, and an
array of state object names in <states>, of which all names must be non-zero.
Frame buffer object names are stored in <fbos> and can
be either zero or non-zero. All arrays have <count> entries.
the lwjgl methods for those are:
public static void glDrawCommandsStatesNV(int buffer, PointerBuffer indirects, IntBuffer sizes,
IntBuffer states, IntBuffer fbos)
and the version taking addresses:
public static void glDrawCommandsStatesAddressNV(LongBuffer indirects, IntBuffer sizes,
IntBuffer states, IntBuffer fbos)
Thanks a lot in advance and many greetings from the shire,
sumwise