Skip to content

Commit

Permalink
Initializing sceGxm before free mem checking on vglInitExtended.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinnegatamante committed Jun 15, 2020
1 parent 091e5e7 commit 9231680
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/gxm.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ int DISPLAY_STRIDE; // Display stride in pixels
float DISPLAY_WIDTH_FLOAT; // Display width in pixels (float)
float DISPLAY_HEIGHT_FLOAT; // Display height in pixels (float)

static uint8_t gxm_initialized = 0; // Current sceGxm state

// sceDisplay callback data
struct display_queue_callback_data {
void *addr;
Expand Down Expand Up @@ -97,6 +99,8 @@ static void display_queue_callback(const void *callbackData) {
}

void initGxm(void) {
if (gxm_initialized) return;

// Initializing sceGxm init parameters
SceGxmInitializeParams gxm_init_params;
memset(&gxm_init_params, 0, sizeof(SceGxmInitializeParams));
Expand All @@ -108,6 +112,7 @@ void initGxm(void) {

// Initializing sceGxm
sceGxmInitialize(&gxm_init_params);
gxm_initialized = 1;
}

void initGxmContext(void) {
Expand Down
3 changes: 3 additions & 0 deletions source/vitaGL.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,9 @@ void vglInitWithCustomSizes(uint32_t gpu_pool_size, int width, int height, int r
}

void vglInitExtended(uint32_t gpu_pool_size, int width, int height, int ram_threshold, SceGxmMultisampleMode msaa) {
// Initializing sceGxm
initGxm();

// Getting max allocatable CDRAM and RAM memory
SceKernelFreeMemorySizeInfo info;
info.size = sizeof(SceKernelFreeMemorySizeInfo);
Expand Down

0 comments on commit 9231680

Please sign in to comment.