*/
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "gpu.h"
gpu.frameskip.active = 1;
else
gpu.frameskip.active = 0;
+
+ if (!gpu.frameskip.active && gpu.frameskip.pending_fill[0] != 0) {
+ int dummy;
+ do_cmd_list(gpu.frameskip.pending_fill, 3, &dummy);
+ gpu.frameskip.pending_fill[0] = 0;
+ }
}
static noinline int decide_frameskip_allow(uint32_t cmd_e3)
{
int ret;
ret = vout_init();
+
+ gpu.state.enhancement_available = 0;
ret |= renderer_init();
+ if (gpu.state.enhancement_available) {
+ if (gpu.enhancement_bufer == NULL)
+ gpu.enhancement_bufer = malloc(2048 * 1024 * 2 + 1024 * 512 * 2);
+ if (gpu.enhancement_bufer == NULL)
+ gpu_log("OOM for enhancement buffer\n");
+ }
+ else if (gpu.enhancement_bufer != NULL) {
+ free(gpu.enhancement_bufer);
+ gpu.enhancement_bufer = NULL;
+ }
+
gpu.state.frame_count = &gpu.zero;
gpu.state.hcnt = &gpu.zero;
gpu.frameskip.active = 0;
int cmd = 0, pos = 0, len, dummy;
int skip = 1;
+ gpu.frameskip.pending_fill[0] = 0;
+
// XXX: polylines are not properly handled
while (pos < count && skip) {
uint32_t *list = data + pos;
if (cmd == 0x02) {
if ((list[2] & 0x3ff) > gpu.screen.w || ((list[2] >> 16) & 0x1ff) > gpu.screen.h)
// clearing something large, don't skip
- do_cmd_list(data + pos, 3, &dummy);
+ do_cmd_list(list, 3, &dummy);
+ else
+ memcpy(gpu.frameskip.pending_fill, list, 3 * 4);
}
else if ((cmd & 0xf4) == 0x24) {
// flat textured prim
gpu.state.hcnt = cbs->gpu_hcnt;
gpu.state.frame_count = cbs->gpu_frame_count;
gpu.state.allow_interlace = cbs->gpu_neon.allow_interlace;
+ gpu.state.enhancement_enable = cbs->gpu_neon.enhancement_enable;
if (cbs->pl_vout_set_raw_vram)
cbs->pl_vout_set_raw_vram(gpu.vram);