Skip to content

Drastically refactor glTexImage2D

Luke Benstead requested to merge texture-refactor into master

This is a major change to glTexImage2D.

Previously all texture uploads would be twiddled, and the code for glTexImage was messy, buggy and difficult to follow.

Now, twiddling only happens if you specify one of the new _TWID_KOS formats as the internalFormat parameter, unless you call glEnable(GL_TEXTURE_TWIDDLE_KOS) before glTexImage.

Previously twiddling would happen during the copy to VRAM, now it uses a temporary buffer - the same buffer as conversion between formats.

Also introduces a new texture memory allocator that should work more efficiently on the Dreamcast PVR.

Edited by Luke Benstead

Merge request reports