mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -04:00
Vita: Try to fix problems with deleting unreferenced buffers causing crashes
This commit is contained in:
parent
9e0c9ba942
commit
6921c9516d
@ -639,7 +639,6 @@ static void GPUTexture_Free(struct GPUTexture* tex) {
|
|||||||
|
|
||||||
static void GPUTextures_DeleteUnreferenced(void) {
|
static void GPUTextures_DeleteUnreferenced(void) {
|
||||||
if (!del_textures_head) return;
|
if (!del_textures_head) return;
|
||||||
del_textures_tail = NULL;
|
|
||||||
|
|
||||||
struct GPUTexture* tex;
|
struct GPUTexture* tex;
|
||||||
struct GPUTexture* next;
|
struct GPUTexture* next;
|
||||||
@ -651,15 +650,15 @@ static void GPUTextures_DeleteUnreferenced(void) {
|
|||||||
|
|
||||||
if (tex->lastFrame + 4 > frameCounter) {
|
if (tex->lastFrame + 4 > frameCounter) {
|
||||||
// texture was used within last 4 fames
|
// texture was used within last 4 fames
|
||||||
prev = tex;
|
prev = tex;
|
||||||
del_textures_tail = tex; // update end of linked list
|
|
||||||
|
|
||||||
cc_uintptr addr = tex;
|
|
||||||
Platform_Log1("TEX CHECK %h", &addr);
|
|
||||||
} else {
|
} else {
|
||||||
// advance the head of the linked list
|
// advance the head of the linked list
|
||||||
if (del_textures_head == tex)
|
if (del_textures_head == tex)
|
||||||
del_textures_head = next;
|
del_textures_head = next;
|
||||||
|
|
||||||
|
// update end of linked list if necessary
|
||||||
|
if (del_textures_tail == tex)
|
||||||
|
del_textures_tail = prev;
|
||||||
|
|
||||||
// unlink this texture from the linked list
|
// unlink this texture from the linked list
|
||||||
if (prev) prev->next = next;
|
if (prev) prev->next = next;
|
||||||
@ -866,7 +865,6 @@ static void GPUBuffer_Free(struct GPUBuffer* buf) {
|
|||||||
|
|
||||||
static void GPUBuffers_DeleteUnreferenced(void) {
|
static void GPUBuffers_DeleteUnreferenced(void) {
|
||||||
if (!del_buffers_head) return;
|
if (!del_buffers_head) return;
|
||||||
del_buffers_tail = NULL;
|
|
||||||
|
|
||||||
struct GPUBuffer* buf;
|
struct GPUBuffer* buf;
|
||||||
struct GPUBuffer* next;
|
struct GPUBuffer* next;
|
||||||
@ -878,15 +876,15 @@ static void GPUBuffers_DeleteUnreferenced(void) {
|
|||||||
|
|
||||||
if (buf->lastFrame + 4 > frameCounter) {
|
if (buf->lastFrame + 4 > frameCounter) {
|
||||||
// texture was used within last 4 fames
|
// texture was used within last 4 fames
|
||||||
prev = buf;
|
prev = buf;
|
||||||
del_buffers_tail = buf; // update end of linked list
|
|
||||||
|
|
||||||
cc_uintptr addr = buf;
|
|
||||||
Platform_Log1("VB CHECK %h", &addr);
|
|
||||||
} else {
|
} else {
|
||||||
// advance the head of the linked list
|
// advance the head of the linked list
|
||||||
if (del_buffers_head == buf)
|
if (del_buffers_head == buf)
|
||||||
del_buffers_head = next;
|
del_buffers_head = next;
|
||||||
|
|
||||||
|
// update end of linked list if necessary
|
||||||
|
if (del_buffers_tail == buf)
|
||||||
|
del_buffers_tail = prev;
|
||||||
|
|
||||||
// unlink this texture from the linked list
|
// unlink this texture from the linked list
|
||||||
if (prev) prev->next = next;
|
if (prev) prev->next = next;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user