You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So it looks like, in theory, glBufferData and glNamedBufferDatasupport passing a null pointer to the data argument, which tells the driver to orphan the old data and allocate new space. Doing this seems to be a performance optimization in some cases (when you want to update a buffer the gpu is currently reading for a draw call)
Right now in glow, these functions are replaced by type-explicit ones, ie. named_buffer_data_u8_slice, so it doesn't look like there's a way for me to try out this orphaning concept yet. Would this be something okay to add to glow?
I imagine it would have to be some new function like named_buffer_data_null, or outright including named_buffer_data but making the data argument Option<&[u8]> - working similar to how glow handles buffer_storage. I definitely wouldn't want to introduce a breaking change to the API though, I'm just curious if either of these would be a fine addition?
The text was updated successfully, but these errors were encountered:
twuky
changed the title
passing null values to glBufferData/glBufferNamedData (orphaning)
passing null pointers to glBufferData/glBufferNamedData (orphaning)
Aug 21, 2023
A small breaking change to the API to support Option would probably be ok. We could add the extra null functions but maybe it would be slightly more consistent to accept Option
So it looks like, in theory,
glBufferData
andglNamedBufferData
support passing a null pointer to the data argument, which tells the driver to orphan the old data and allocate new space. Doing this seems to be a performance optimization in some cases (when you want to update a buffer the gpu is currently reading for a draw call)Right now in glow, these functions are replaced by type-explicit ones, ie.
named_buffer_data_u8_slice
, so it doesn't look like there's a way for me to try out this orphaning concept yet. Would this be something okay to add to glow?I imagine it would have to be some new function like
named_buffer_data_null
, or outright includingnamed_buffer_data
but making the data argumentOption<&[u8]>
- working similar to how glow handlesbuffer_storage
. I definitely wouldn't want to introduce a breaking change to the API though, I'm just curious if either of these would be a fine addition?The text was updated successfully, but these errors were encountered: