-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2015-05-26 um 13:03 schrieb Henri Verbeet:
On 26 May 2015 at 12:54, Stefan Dösinger stefandoesinger@gmail.com wrote:
I tried to move the code to resource_init and the non power of 2 handling is a big problem. resource_init doesn't care about power of 2 and non power of 2 sizes, and I don't think it should. It would need to know that though to switch between 2D and RECT.
What is the issue exactly?
I'd have to move or duplicate the power of two size calculation (texture.c lines 1092 - 1123) to resource_init, and I don't think the generic resource code should have to deal with this functionality that is very specific to 2D textures. Passing a "this is a np2 texture" flag to resource_init is a possible option, but it would still take quite a bit of 2D texture specific code along with it (in particular the switch between true NP2, faked WINED3D_GL_NORMALIZED_TEXRECT NP2, ARB_texture_rectangle and 2D texture emulated NP2).
I'm not saying we can't do it that way. I just don't think it is nicer. I'll see if I can extract the flag checks into a separate function that texture_init and resource_init can call.