vramMemAlign for buffers and fixed indent
This commit is contained in:
parent
e1baf131d1
commit
20397232b8
@ -64,10 +64,9 @@ typedef struct {
|
||||
#define GPU_CMD_SIZE 0x40000
|
||||
|
||||
//GPU framebuffer address
|
||||
u32* gpuFBuffer =(u32*)0x1F119400;
|
||||
u32* gpuFBuffer = NULL;
|
||||
//GPU depth buffer address
|
||||
u32* gpuDBuffer =(u32*)0x1F370800;
|
||||
|
||||
u32* gpuDBuffer = NULL;
|
||||
//GPU command buffers
|
||||
u32* gpuCmd = NULL;
|
||||
|
||||
@ -108,8 +107,12 @@ void gpuInit()
|
||||
res = shaderProgramSetVsh(&shader, &shader_dvlb->DVLE[0]);
|
||||
my_assert(res >=0); // check for errors
|
||||
|
||||
//Allocate the GPU render buffers
|
||||
gpuFBuffer = vramMemAlign(400*240*8, 0x100);
|
||||
gpuDBuffer = vramMemAlign(400*240*8, 0x100);
|
||||
|
||||
//In this example we are only rendering in "2D mode", so we don't need one command buffer per eye
|
||||
gpuCmd=(u32*)linearAlloc(GPU_CMD_SIZE * (sizeof *gpuCmd) ); //Don't forget that commands size is 4 (hence the sizeof)
|
||||
gpuCmd = linearAlloc(GPU_CMD_SIZE * (sizeof *gpuCmd) ); //Don't forget that commands size is 4 (hence the sizeof)
|
||||
my_assert(gpuCmd != NULL);
|
||||
|
||||
//Reset the gpu
|
||||
@ -132,6 +135,8 @@ void gpuExit()
|
||||
{
|
||||
//do things properly
|
||||
linearFree(gpuCmd);
|
||||
vramFree(gpuDBuffer);
|
||||
vramFree(gpuFBuffer);
|
||||
shaderProgramFree(&shader);
|
||||
DVLB_Free(shader_dvlb);
|
||||
GPU_Reset(NULL, gpuCmd, GPU_CMD_SIZE); // Not really needed, but safer for the next applications ?
|
||||
|
Loading…
Reference in New Issue
Block a user