gu buffers width and block-aligned + sceGuTexImage

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

gu buffers width and block-aligned + sceGuTexImage

Post by jonny »

on various gu functions i see the "block aligned" requirement (typically on buffer width parameters)

1) what is the block size? (is it a way to say "a power of 2"?)


about sceGuTexImage:

Code: Select all

/**
  * 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);
2) have someone made experiments with tbw parameter?

in this thread: http://forums.ps2dev.org/viewtopic.php?t=4213 Brunni seems to use 250 with success.
i'm also interested to know if a value > 512 can be used.
i'll go to check this myself, anyway if someone already did this and want to share infos ... :)

thanks
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

MAX texture dimensions GU can handle is 512x512
you cannot use 520x512 for example texture buffer
width of course also has this limitation
swizzling textures/quad word alignment info in found in ps2dev wiki
10011011 00101010 11010111 10001001 10111010
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

i'm running some tests
width of course also has this limitation
this seems not true (note that i'm talking about texture buffer width)

i'm setting a buffer of (512+16) x 272 pixels (i fill it with a true (512+16) x 272 texture)

i setup the texture in this way:
sceGuTexImage(0,512,512,512+16,p);

and is rendered correctly :) (at least the 480x272 portion)

texture buffer width need to be divisible by 16, after some tests, this seems the only requirement (max width seems 2048-16)

i'm using an 8bit texture + a palette, i dunno if this make some difference
Post Reply