Linux for PlayStation 2 Community - Forums


Summary |  Home Page |  Forums |  Lists |  Tasks |  Docs |  Surveys |  News |  Files | 

Discussion Forums: Developers

Admin

Message: 50646
BY: aik6980
DATE: 2007-Nov-10 08:09
SUBJECT: 2 different vu1 mpg at runtime

i got the problem when i try to upload different vu mpgs at runtime, it clashes the ps2
i have some different vu code which need to upload for rendering different model, as terrain
, 3d animated model.
firstly, i tested rendering each of them on their own, the application works fine.
secondly, i tested rendering more than one model, with different vu code but same vumem's data struture (same base, same offset), the application still works fine.

the problem's happened when i try to render more than one model with each of them has a different vu mpg and different vumen's structure (different base, offset),
my ps2 clashes.

I think the problem is about some kind of the syncronization.
I try to add (FLUSH) command in every upload processes, this still no good.
could anyone give me any suggestion? all models use Quadbuffering technique

here's some of my code,

this is the main render loop
================================
// there's flush in the following func
gVu1mpg->Upload();
// there's flush in the following func
gTerrain.Render();

KMatrixTranslation(&T,10,-10,-20);
W = T;
WVP = W * VPMat;

VIFDynamicDMA.Add32(FLUSH);
VIFDynamicDMA.AddUnpack(V4_32, 4, 5);
VIFDynamicDMA.AddVector(gVPScaleVec);
VIFDynamicDMA.AddMatrix(WVP);

// there's flush in the following func
gMesh.Render();

KMatrixTranslation(&T,0,-10,-15);
W = T;
WVP = W * VPMat;

VIFDynamicDMA.Add32(FLUSH);
VIFDynamicDMA.AddUnpack(V4_32, 4, 5);
VIFDynamicDMA.AddVector(gVPScaleVec);
VIFDynamicDMA.AddMatrix(WVP);

// there's flush in the following func
gVu1skinedmesh->Upload();
// there's flush in the following func
gSkinedMesh.Render();

SPS2Manager.EndScene();
============================================


 

Thread View

Thread Author Date
2 different vu1 mpg at runtimeaik69802007-Nov-10 08:09
      RE: 2 different vu1 mpg at runtimectofer2007-Nov-11 00:39
            RE: 2 different vu1 mpg at runtimeaik69802007-Nov-11 01:04
      RE: 2 different vu1 mpg at runtimeaik69802007-Nov-12 13:52
            RE: 2 different vu1 mpg at runtimepanther2007-Nov-12 16:51
            RE: 2 different vu1 mpg at runtimectofer2007-Nov-12 18:47
                  RE: 2 different vu1 mpg at runtimeaik69802007-Nov-13 00:05
                        RE: 2 different vu1 mpg at runtimectofer2007-Nov-13 17:39
                              RE: 2 different vu1 mpg at runtimeaik69802007-Nov-14 04:18
      RE: 2 different vu1 mpg at runtimeaik69802007-Nov-21 10:02

 

Post a followup to this message

You could post if you were [logged in]