Ignore:
Timestamp:
Dec 20, 2012, 2:01:32 AM (10 years ago)
Author:
sam
Message:

gpu: warn when a vertex shader attribute isn’t found and do not crash
when a stream is not found in the vertex declaration at bind time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/shader.cpp

    r2097 r2156  
    327327#if defined USE_D3D9 || defined _XBOX
    328328#elif !defined __CELLOS_LV2__
    329     ret.m_flags |= (uint64_t)
    330                   (uint32_t)glGetAttribLocation(data->prog_id, attr) << 32;
     329    GLint l = glGetAttribLocation(data->prog_id, attr);
     330    if (l < 0)
     331    {
     332        Log::Warn("tried to query invalid attribute: %s\n", attr);
     333        l = 0;
     334    }
     335    ret.m_flags |= (uint64_t)(uint32_t)l << 32;
    331336#else
    332337    /* FIXME: can we do this at all on the PS3? */
Note: See TracChangeset for help on using the changeset viewer.