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 

clutmode, clutload & sync

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



Joined: 25 Jun 2005
Posts: 23
Location: paris

PostPosted: Tue Jul 26, 2005 6:49 pm    Post subject: clutmode, clutload & sync Reply with quote

I'm having some color palette update issues....

I'm working in 5551 color mode, with 8bits texture, using replace mode & alpha.
I'm rendering sprites & have to switch the palette multiple times. Moreover some entries in my palette are transparent (|=0x8000).
Sometimes it seems the alpha isn't used in the rendering, so I guess it's a problem of palette updates.

Here's how it works basically :

1st rendering of n sprites :
copy master palette in a my working palette (using non cacheable addresses with |=0x40000000)
patch some entries with a OR 0x8000 (this entries will be transparent)
call sceGuClutLoad to load my patched palette
do the actual rendering
2nd rendering of m sprites :
same as before, but patching other entries
3rd,....

I've usually less than 10 steps in gu list.
Most of the time it works well, but sometimes I see the sprites pixels
which should be transparent.
Moreover it happens on static data! I mean I render the same screen
with the same list & sometimes it looks like the palette isn't loaded correctly.

Any idea of a potential sync issue when loading multiple palettes in the same rendering pass (in the same gu list) ?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ector



Joined: 12 May 2005
Posts: 195

PostPosted: Wed Jul 27, 2005 1:12 am    Post subject: Reply with quote

is the pointer you use to patch the entries noncachable?
Back to top
View user's profile Send private message
yoyofr



Joined: 25 Jun 2005
Posts: 23
Location: paris

PostPosted: Wed Jul 27, 2005 1:46 am    Post subject: Reply with quote

Quote:
(using non cacheable addresses with |=0x40000000)

yes, it is.....

I guess it could help to know if psp support multiple palette (it seems to be the case) and how much...
Nobody's ever heard of a multiple clut mode ?

from my point of view, after looking again & again at the rendering, using
vsync on/off, speed limiter, 222Mhz-333Mhz, it looks like after n rendering
the clut isn't properly loaded.
I mean for testing, the data I'm drawing are always the same, the palette
too. I'm using non cacheable addresses (tried without |=0x40000000 and calling sceKernelDcacheWritebackAll(); instead) and most of the time
everything is ok, but some frames are drawn with opaque pixels.
I'm not changing the alpha_test or other stuff.
The setup remains the same, the pixels/textures data too, vertices too,...
The only thing is I'm calling multiple times sceguclutload...
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Wed Jul 27, 2005 5:02 am    Post subject: Reply with quote

try inserting sceGuTexSync() or sceGuTexFlush() after setting the texture and see if it helps.
_________________
GE Dominator
Back to top
View user's profile Send private message
yoyofr



Joined: 25 Jun 2005
Posts: 23
Location: paris

PostPosted: Wed Jul 27, 2005 6:35 pm    Post subject: Reply with quote

thx for the help, but I fixed the bug in the meantime.
the issue was in the way I proceeded :
1/ load new palette (fast)
2/ init my vertices (slow) & update texture
3/ load texture & render
and then 1/ 2/ 3/ again

I changed it to
1/ init vertices & update texture
2/ load texture
3/ load new paletet & render

with this it seems to be ok!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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