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...
This commit is contained in:
Lawrence Sebald 2016-07-02 23:37:04 -04:00
parent 0fa6e42b55
commit 30f408caa3

View File

@ -2,6 +2,7 @@
libgl/gl-pvr.c libgl/gl-pvr.c
Copyright (C) 2013-2014 Josh Pearson Copyright (C) 2013-2014 Josh Pearson
Copyright (C) 2016 Lawrence Sebald
Vertex Buffer Routines for interfacing the Dreamcast's SH4 CPU and PowerVR GPU. Vertex Buffer Routines for interfacing the Dreamcast's SH4 CPU and PowerVR GPU.
@ -23,6 +24,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <dc/sq.h>
#include "gl.h" #include "gl.h"
#include "gl-api.h" #include "gl-api.h"
#include "gl-sh4.h" #include "gl-sh4.h"
@ -201,6 +204,11 @@ inline void _glKosVertexBufCopy(void *dst, void *src, GLuint count) {
} }
static inline void glutSwapBuffer() { static inline void glutSwapBuffer() {
#ifndef GL_KOS_USE_DMA
QACR0 = QACRTA;
QACR1 = QACRTA;
#endif
pvr_list_begin(PVR_LIST_OP_POLY); pvr_list_begin(PVR_LIST_OP_POLY);
#ifdef GL_KOS_USE_DMA #ifdef GL_KOS_USE_DMA
pvr_dma_transfer(_glKosVertexBufAddress(GL_KOS_LIST_OP), 0, pvr_dma_transfer(_glKosVertexBufAddress(GL_KOS_LIST_OP), 0,