forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

gu buffers width and block-aligned + sceGuTexImage

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
jonny



Joined: 22 Sep 2005
Posts: 351

PostPosted: Mon May 08, 2006 7:59 pm    Post subject: gu buffers width and block-aligned + sceGuTexImage Reply with quote

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:

/**
  * 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
Back to top
View user's profile Send private message Visit poster's website
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Tue May 09, 2006 3:49 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
jonny



Joined: 22 Sep 2005
Posts: 351

PostPosted: Tue May 09, 2006 6:01 am    Post subject: Reply with quote

i'm running some tests

Quote:

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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