apitrace / apitrace

Tools for tracing OpenGL, Direct3D, and other graphics APIs

Home Page:https://apitrace.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GL_ATI_meminfo state: 4 integers instead of 1

stgatilov opened this issue · comments

While trying to glretrace my game on AMD RX 550 with VS2022 x64 Debug, I get stack corruption around texture_free_memory_ati variable:

        // GL_TEXTURE_FREE_MEMORY_ATI
        {
            flushErrors();
    GLint texture_free_memory_ati = 0;
    glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, &texture_free_memory_ati);
            if (glGetError() != GL_NO_ERROR) {
                flushErrors();
            } else {
                writer.beginMember("GL_TEXTURE_FREE_MEMORY_ATI");
    writer.writeInt(texture_free_memory_ati);
                writer.endMember();
            }
        }

Looking at the specs for GL_ATI_meminfo extension, glGetIntegerv returns 4 integers instead of 1 for all three states.

Here is the fix: #849

Good catch. Thanks