Ready for some weirdness.
I have a cube, it renders fine when I have these lines:
pspDebugScreenSetXY(0,j*3);
pspDebugScreenPrintf("verts:x %f",verts->Get(j)->x);
pspDebugScreenSetXY(0,j*3+1);
pspDebugScreenPrintf("verts:y %f",verts->Get(j)->y);
pspDebugScreenSetXY(0,j*3+2);
pspDebugScreenPrintf("verts:z %f",verts->Get(j)->z);
for debugging, then I took those lines out and theres a peice of the box missing, like i dont have all the geometry, so I put the debug lines back in, and my box renders fine... WEIRD!
So I talked with someone in the IRC room saying it maybe the compiler messing up. I added -o0.... didn't work. Any other ideas?
My vertices are floats, thats all im rendering, im passing in this:
sceGuDrawArray(GU_TRIANGLES,GU_VERTEX_32BITF|GU_TRANSFORM_3D,12*3,0,&m_PSPBuffer[0]);
Any ideas???
Compiler Issue ( I think )
0x8a3f278 is a cached address. 0x48a3f278 is an uncached address. They both reference the same memory location, except the latter bypasses the CPU cache. Since the GU isn't aware of the CPUs cache, you need to use uncached addresses to make sure it can see the last thing you wrote. Either that or you have to flush the CPUs data cache before calling GU.
Since the data cache is quite small, it's possible that the debug instructions are causing your data to be written out of the cache in time for the GU to see them.
Jim
Since the data cache is quite small, it's possible that the debug instructions are causing your data to be written out of the cache in time for the GU to see them.
Jim
so how do I use the uncached address. I just say new something and it gives me a new address.... I can try to flush the cpu data cache, but you wound't happen to know a function that does that would ya? I understand the concept of whats going on, just not the details on how to work around it.
Thanks again guys
Jeff.
Thanks again guys
Jeff.
Code: Select all
THING vertex[10];
THING *uncachedvertexptr = (THING *)(((unsigned int)vertex)|0x40000000);
or call
Code: Select all
sceKernelDcacheWriteBackAll();
Try not to mix the two. If you access though uncached addresses and then call WriteBack you can clobber the uncached writes.
Jim