good try but not good enoughOriginally Posted by Alfonse Reinheart
preventing the programmer from making mistakes is not the purpose of glTexStorage at all.
its purpose is to relieve the driver from the burden i explained, which is unavoidable otherwise.
when you call glBufferData second time on the same object, you effectively destroy the old one and create a new one.Because it makes it impossible to change the usage flags later. If you can only call glBufferStorage one time, then the implementation knows that this object name will be forever associated with a block of memory of known size and will always have a particular usage pattern. The driver doesn't have to be written to deal with changing this usage pattern in the future.
why should not you be allowed to specify new parameters for the new object? does not make any sense.
the only difference between glBufferData on existing object and first destroying it and then creating new one is that in the first case you keep the same object id. do you really think this alone has any overhead or is in any way problematic for the driver?
the fundamental difference between glBufferData and glTexImage is that the first semantically destroys the old object and creates new one whereas the second hes much more complicated function which makes the lives of the driver writers harder.
this difference is the reason why the considerations leading to the need of glTexStorage do not apply in the case with the buffers