I planned on using the GU to render it to the draw buffer and just not swap with the display buffer. I'd have it render the DXTn image as a texture on a quad and read back the RGB data directly from the draw buffer in VRAM to somewhere in RAM without affecting anything currently on the screen.
But the buffers are swapping automatically. My code doesn't contain any calls to sceGuSwapBuffers(), so I have no idea what's up.
I also tried going directly to the rasterizer instead of transforming first, but I was wrong to assume that it was my problem.
Code: Select all
/* Body of the function that's messing up. */
sceGuStart (GU_DIRECT, gList);
sceGumMatrixMode (GU_MODEL);
sceGumLoadIdentity()
draw_quad (64, 64);
sceGuFinish();
sceGuSync (0, 0);
/* To illustrate that nothing is going on after this: */
while ( 1 )
{
}
Code: Select all
void
draw_quad ( const float nW
, const float nH )
{
struct vert2d
{
float u, v;
uint32_t color;
float x, y, z;
} *p_verts = (struct vert2d *)
sceGuGetMemory (2 * sizeof (struct vert2d));
p_verts[0] = (struct vert2d) { 0.0f, 0.0f, 0xFF0000FF, 0.0f, 0.0f, 0.0f };
p_verts[1] = (struct vert2d) { nW, nH, 0xFF0000FF, nW, nH, 0.0f };
sceGumDrawArray
(
GU_SPRITES
, GU_TEXTURE_32BITF|GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D
, 2
, 0
, p_verts
);
}