So, glGenerateMipMap is great. I'm wondering about a couple of things:
- suppose the texture image is changed via glTexSubImage2D, another call to glGenerateMipMap is -- sufficient / required / unnecessary?
- suppose end-users should be able to "enable/disable mip-maps" on the fly, of course GL_TEXTURE_MIN_FILTER has to be set accordingly to mipmap or not. However, the previously generated mip-maps remain in GPU VRAM, right? -- can the driver be "hinted" to delete those? Do I have to re-upload the original texture image (but now with min-filtering no longer set to mipmap) to clear the memory that contained the previously generated and now unneeded mip-maps?
Background -- among other use-cases also requiring more insights into the above questions, I'd also like to "keep track of approx. GPU VRAM consumed by the app" (for all kinds of reasons such as scalable arbitrary texture / vertex streaming) --- by tracking not only GL buffers being filled by the app but also textures uploaded (sure it's just an approximation but good enough). Tracking their mip-maps then is necessary too, so knowing how to clear them or when they get cleared by current-gen GL implementation would be highly useful.