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_SEND display lists and double buffering

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



Joined: 15 Apr 2009
Posts: 7

PostPosted: Fri Oct 23, 2009 1:31 am    Post subject: GU_SEND display lists and double buffering Reply with quote

Hello everyone. I have run across a problem while trying to use GU_SEND diplay lists with double buffering. It works... kind of... If i use GU_DIRECT - all is perfect, but as soon as i switch to GU_SEND, it looks like sceGuSwapBuffers() stops working. Only each 2nd frame is shown (looks like : frame/black/frame/black/frame... etc). Maybe someone could lend a hand on this situation? I tried to search for additional info on sceGuSendList() but with no success. Here is my draw-loop.

Code:
static  unsigned int __attribute__((aligned(16))) __list[262144];

// Setup environment, nothing special...

while   (running()) {
        sceGuStart(GU_SEND,__list);

        // --- Draw everything here ---

        sceGuFinish();
        sceGuSendList(GU_TAIL,__list,NULL);
        sceGuSync(0,0);
        sceDisplayWaitVblankStart();
        sceGuSwapBuffers();
        }


Once again - this codepath works perfectly if GU_SEND is replaced by GU_DIRECT. But i really-really need to work with GU_SEND. What's wrong with such approach? Thanks.
P.S. Sorry for bad english.
Back to top
View user's profile Send private message
a_noob



Joined: 17 Sep 2006
Posts: 97
Location: _start: jr 0xDEADBEEF

PostPosted: Sun Oct 25, 2009 3:37 am    Post subject: Reply with quote

I have encountered the same problem man times, I eventually just decided it wasn't worth the hassle, but I suppose maybe this is a bug in the sdk. As I have never got sceGuSendList to work right. Ill take a look at the code, and see if I can spot something.
_________________
Code:
.øOº'ºOø.
'ºOo.oOº'
Back to top
View user's profile Send private message AIM Address MSN Messenger
a_noob



Joined: 17 Sep 2006
Posts: 97
Location: _start: jr 0xDEADBEEF

PostPosted: Sun Oct 25, 2009 3:41 am    Post subject: Reply with quote

I suppose you could use a small work around and use the GE directly. I'll see if I can get this to work

Code:
/**
  * Enqueue a display list at the tail of the GE display list queue.
  *
  * @param list - The head of the list to queue.
  * @param stall - The stall address.
  * If NULL then no stall address set and the list is transferred immediately.
  * @param cbid - ID of the callback set by calling sceGeSetCallback
  * @param arg - Structure containing GE context buffer address
  *
  * @return The ID of the queue.
  */
int sceGeListEnQueue(const void *list, void *stall, int cbid, PspGeListArgs *arg);

_________________
Code:
.øOº'ºOø.
'ºOo.oOº'
Back to top
View user's profile Send private message AIM Address MSN Messenger
Eib



Joined: 15 Apr 2009
Posts: 7

PostPosted: Mon Oct 26, 2009 12:49 am    Post subject: Reply with quote

Well, in case someone might need it, here's the workaround. Putting 1 call to GuStart() with GU_DIRECT mode (and finishing it right away) right after sceGuSwapBuffers() seems solve the problem. Here is my rendering loop when frame being rendered while next frame is being computed. So i managed to keep sceGuSync() execution time down to 100 µs.

Code:
   // At this point, frame must be already rendered in display list
   sceGuSync(0,0);
   __fbp0 = sceGuSwapBuffers();
   sceGuStart(GU_DIRECT,__list_blank);
   sceGuFinish();
   sceGuSendList(GU_TAIL,__list[frame_num%2],NULL); // Send frame to GE
   frame_num++;
   sceGuStart(GU_SEND,__list[frame_num%2]); // Start to fill current frame's display list
   // ...rendering code
Back to top
View user's profile Send private message
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