Re: Re: Tips for debugging D3D Textures & DirectSound?

Adam Luchjenbroers <[email protected]> Fri, 8 Oct 2004 21:08:57 +0930
Newsgroups gmane.comp.emulators.winex.devel
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> Incidentally, when a card finally comes on the market that supports
> ARB_texture_non_power_of_two this will no longer be necessary, since
> cards exposing that extension will support those texture formats
> natively.

Just curiously, can you explain why these code fragments are there?

texstate.c, D3D_GL_texture_map, 932:
GLenum target = priv->texture_target[Stage];

texstate.c, D3D_GL_texture_map, 945-954:
 if (new_target != target) {
     if (target) {
  glBindTexture(target, 0);
  glDisable(target);
  TRACE("Target %04x has been disabled\n",target);
  priv->texture_used[Stage] = FALSE;
     }
     target = new_target;
     priv->texture_target[Stage] = target;
 }

d3dgl_main.c, D3D_GL_initialize, 160-165
    priv->texture_target[0] = GL_TEXTURE_2D;
    for (u=1; u<priv->lpCaps->wMaxTextureBlendStages; u++) {
 GLD(priv)->glActiveTextureARB(GL_TEXTURE0_ARB + u);
 glBindTexture(GL_TEXTURE_2D, priv->dummy_texture);
 priv->texture_target[u] = GL_TEXTURE_2D;
    }

Because in combination, they mean that whenever D3D_GL_texture_map is called 
for a non-power of two texture, the code within the body of the if gets 
executed. While I have only a limited understanding of priv structure, it 
would seem like this might cause some issues.

Can I get you to explain this and the nature of the priv structure to me?

- -- 
"Premature optimization is the root of all evil.." - Donald E. Knuth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBZnxT94zI/zB2CYURAthdAKCnALWmYTPUt+/AQo6o+fru8hIB5gCeMXNw
fhbPp4XoXteAx4fweSkGcec=
=MKaG
-----END PGP SIGNATURE-----