VirtualBox

Ignore:
Timestamp:
Oct 9, 2015 1:36:35 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103258
Message:

GuestHost/OpenGL: get the number of active uniforms only if they exist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_glsl.c

    r53088 r58151  
    10071007{
    10081008    CRGLSLProgram *pProgram = crStateGetProgramObj(program);
    1009     GLint maxUniformLen, activeUniforms=0, fakeUniformsCount, i, j;
     1009    GLint maxUniformLen = 0, activeUniforms=0, fakeUniformsCount, i, j;
    10101010    char *pCurrent = pData;
    10111011    GLsizei cbWritten;
     
    10171017    }
    10181018
     1019    /*
     1020     * OpenGL spec says about GL_ACTIVE_UNIFORM_MAX_LENGTH:
     1021     * "If no active uniform variable exist, 0 is returned."
     1022     */
    10191023    diff_api.GetProgramiv(pProgram->hwid, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxUniformLen);
    1020     diff_api.GetProgramiv(pProgram->hwid, GL_ACTIVE_UNIFORMS, &activeUniforms);
     1024    if (maxUniformLen > 0)
     1025        diff_api.GetProgramiv(pProgram->hwid, GL_ACTIVE_UNIFORMS, &activeUniforms);
    10211026
    10221027    *cbData = 0;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette