 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
siberianstar
Joined: 22 Jun 2006 Posts: 70
|
Posted: Mon Jul 10, 2006 7:22 am Post subject: Loading texture GU |
|
|
Hello,
I'm reading that texture data must be aligned to 16bytes, what means ?
| Code: |
/**
* Set current texturemap
*
* Textures may reside in main RAM, but it has a huge speed-penalty. Swizzle textures
* to get maximum speed.
*
* @note Data must be aligned to 1 quad word (16 bytes)
*
* @param mipmap - Mipmap level
* @param width - Width of texture (must be a power of 2)
* @param height - Height of texture (must be a power of 2)
* @param tbw - Texture Buffer Width (block-aligned)
* @param tbp - Texture buffer pointer (16 byte aligned)
**/
void sceGuTexImage(int mipmap, int width, int height, int tbw, const void* tbp);
|
|
|
| Back to top |
|
 |
Kojima
Joined: 26 Jun 2006 Posts: 275
|
Posted: Tue Jul 11, 2006 11:52 pm Post subject: |
|
|
It means you have to allocate your memory aligned to 16 bytes.
Do this,
void * _buf = memalign(16,TexWidth*TexHeight*3);
or similar. 16 = how many bytes to align it to.
If you need for a non dynamic allocation, use atrribute align 16 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|