few questions (synchro, textures)

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

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
outtony
Posts: 26
Joined: Thu Oct 13, 2005 2:46 am
Location: Slovakia
Contact:

few questions (synchro, textures)

Post by outtony »

hello again,
I have some few questions ;-)

---------------------------
first:
i made a fps counter.
The first number i've got was 59.7fps (propably it should be 60fps).
the next with more triangles and textures was 30fps

something is propably synchronising it. Could be this synchronisation disabled? it's harder to measure performance of each part of engine.
----------------------

second:
is there performance difference between textures
256 colours 128x64
and
256 colours 64x128
?
(both 8kb cache suitable and swizzled)

somebody told me, that in ps2 it was difference and 64x128 was not suitable
(i have tested it, and i saw no difference)

-------------------------

third:
i have a problem with using entire vram memory. I can't localize, where is free space, and where's not

this is a part of code:


#define VRAM_OFFSET ((512*280*4)*3)
...
sceGuInit();

sceGuStart(GU_DIRECT,list);
sceGuDrawBuffer(GU_PSM_8888,(void*)0,BUF_WIDTH);
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)0x88000,BUF_WIDTH);
sceGuDepthBuffer((void*)0x110000,BUF_WIDTH);
sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
sceGuDepthRange(0xc350,0x2710);

vramaddr = (0x40000000 | (u32)sceGeEdramGetAddr()) + VRAM_OFFSET;
vRamDest= (unsigned char *)vramaddr;

...
FOR EACH TEXTURE AFTER LOADING:
{
sceGuCopyImage(pTex->dataformat, 0, 0, pTex->w, pTex->h, pTex->w, pTex->data, 0, 0, pTex->w, (void*)(vRamDest));
sceGuTexSync(); // make sure the copy finishes before starting to use it
sceGuTexFlush(); // clear the previous texture out of the GE texture cache

pTex->vdata=vRamDest;
vRamDest+=datasize;
}
...

i have correctly loaded around 300kb of textures (of 500kb), but the few of last has incorrectly data in vram (propably owerwritten by color buffer - changing every frame, when changing the scene)

if you have any idea, i will be very thankfull for them.
thanks anyway

Tony
-----------------------------
Tony

www.n3.sk
User avatar
Saotome
Posts: 182
Joined: Sat Apr 03, 2004 3:45 am

Re: few questions (synchro, textures)

Post by Saotome »

outtony wrote:something is propably synchronising it. Could be this synchronisation disabled? it's harder to measure performance of each part of engine.
you probably have something like this in your main loop:

Code: Select all

sceDisplayWaitVblankStart();
sceGuSwapBuffers();
the sceDisplayWaitVblankStart is "synchronising" it, now guess how to disable it ;)
infj
User avatar
outtony
Posts: 26
Joined: Thu Oct 13, 2005 2:46 am
Location: Slovakia
Contact:

Re: few questions (synchro, textures)

Post by outtony »

Saotome wrote:
outtony wrote:something is propably synchronising it. Could be this synchronisation disabled? it's harder to measure performance of each part of engine.
you probably have something like this in your main loop:

Code: Select all

sceDisplayWaitVblankStart();
sceGuSwapBuffers();
the sceDisplayWaitVblankStart is "synchronising" it, now guess how to disable it ;)
i thought that i tried to remove it. heh, propably not. Now it works well. thanks :)
-----------------------------
Tony

www.n3.sk
User avatar
ReKleSS
Posts: 73
Joined: Sat Jun 18, 2005 12:57 pm
Location: Melbourne, Australia

Post by ReKleSS »

I think your math is messed up. 2mb of vram = 0x200000, 512 * 280 * 4 * 3 = 0x1a4000, 0x200000 - 0x1a4000 = 0x5c000 = around 380kb. You're probably out of vram.
-ReK
User avatar
outtony
Posts: 26
Joined: Thu Oct 13, 2005 2:46 am
Location: Slovakia
Contact:

Post by outtony »

ReKleSS wrote:I think your math is messed up. 2mb of vram = 0x200000, 512 * 280 * 4 * 3 = 0x1a4000, 0x200000 - 0x1a4000 = 0x5c000 = around 380kb. You're probably out of vram.
-ReK
yp, that was a problem.
now i have vram free mem calculator. Some textures are stored in vram some in ram, but i have to optimalise them to 368kb (5C000)
-----------------------------
Tony

www.n3.sk
Post Reply