http://bugs.winehq.org/show_bug.cgi?id=14762
--- Comment #49 from Stefan Dösinger stefandoesinger@gmx.at 2008-12-05 05:05:24 --- (In reply to comment #46)
However IWineD3DTextureImpl doesn't contain a np2 correction matrix. I'm using the width and height members instead, which seem to contain the correct information. At least the dimensions printed by the debug code are now correct
It is in the BaseTextureClass structure: IWineD3DTextureImpl->baseTexture.np2Matrix. A IWineD3DBaseTextureImpl * is ok here too in fact. Its our hacky way of setting up inheritance without a C++ compiler
The NP2 fixup matrix is in all 3 texture types because we also have NP2 emulation with cube and volume textures. E.g. a 200x200x200 cube texture is scaled up to 256x256x256. However, I think we can drop this code because Windows D3D does conditional NP2 textures only with 2D textures. So you don't have to care about cube and volume textures here.
This is the matrix:
w 0 0 0 0 h 0 0 0 0 1 0 0 0 0 1
This shows why you want elements 0 and 5
I assume this is the matrix normally used when doing the fixup in the fixed function pipeline?
Correct. It is set when creating the texture.
I'm not sure if I understand what you're trying to tell me here? IIRC arb_tex_rect does only "work" with 2D targets anyway. It's not specified for 1D, 3D and cube targets, so...?
I just wanted to elaborate why a texture structure cannot be a surface, even though they seem very related in the 2D case. But since you know the 3D graphics stuff I can stop this lecturing :-)
No, in fact this is very much needed. I also first had it without the else-part, but this crashes most apps early.
I thought about dropping the if entirely and call GetUniform unconditionally, but maybe I am missing something here. Having the if doesn't really hurt though, since that code shouldn't be performance critical.