From 30f408caa39c2f5c66ebc1cb1409697662d60eef Mon Sep 17 00:00:00 2001 From: Lawrence Sebald Date: Sat, 2 Jul 2016 23:37:04 -0400 Subject: [PATCH] Fix a store-queue related issue in the primitive submission code. The primitive list submission code in libgl never sets the QACR0 or QACR1 registers when it uses the store queues. Thus, if any other code accesses the store queues, rendering may well grind to a halt. This fixes the issue by setting QACR0 and QACR1 each frame. Note: This solution is still not thread-safe. Of course, many GL implementations are not thread-safe at all... --- gl-pvr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gl-pvr.c b/gl-pvr.c index 106f531..5995989 100644 --- a/gl-pvr.c +++ b/gl-pvr.c @@ -2,6 +2,7 @@ libgl/gl-pvr.c Copyright (C) 2013-2014 Josh Pearson + Copyright (C) 2016 Lawrence Sebald Vertex Buffer Routines for interfacing the Dreamcast's SH4 CPU and PowerVR GPU. @@ -23,6 +24,8 @@ #include #include +#include + #include "gl.h" #include "gl-api.h" #include "gl-sh4.h" @@ -201,6 +204,11 @@ inline void _glKosVertexBufCopy(void *dst, void *src, GLuint count) { } static inline void glutSwapBuffer() { +#ifndef GL_KOS_USE_DMA + QACR0 = QACRTA; + QACR1 = QACRTA; +#endif + pvr_list_begin(PVR_LIST_OP_POLY); #ifdef GL_KOS_USE_DMA pvr_dma_transfer(_glKosVertexBufAddress(GL_KOS_LIST_OP), 0,