Skip to content

[OG] std3D_UpdateFrameCount will thrash texture evictions and uploads in some conditions #28

@shinyquagsire23

Description

@shinyquagsire23

The frameNum assignment in std3D_UpdateFrameCount at

pTexture->frameNum = std3D_frameCount;
is immediately undone by std3D_RemoveTextureFromCacheList, which means if the GPU is low on VRAM and a texture needs to be uploaded, it will sometimes pick textures which were uploaded in the same frame with the same size, causing the texture pair to constantly thrash between evicted by std3D_PurgeTextureCache and uploaded by std3D_AddToTextureCache (visually, this looks like random surface textures flickering back and forth) between two textures.

Discovered this bug on accident because I borrowed the code for my DSi port, moving the assignment to after std3D_AddTextureToCacheList makes the LRU cache function as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions