Changeset 2846


Ignore:
Timestamp:
Aug 14, 2013, 12:05:55 PM (6 years ago)
Author:
sam
Message:

gpu: avoid unnecessary OpenGL context changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scene.cpp

    r2832 r2846  
    191191{
    192192    RenderContext rc;
    193     rc.SetDepthFunc(DepthFunc::LessOrEqual);
    194     rc.SetBlendFunc(BlendFunc::SrcAlpha, BlendFunc::OneMinusSrcAlpha);
    195     rc.SetAlphaFunc(AlphaFunc::GreaterOrEqual, 0.01f);
    196193
    197194    /* Early test if nothing needs to be rendered */
    198195    if (data->m_tiles.Count())
    199196    {
     197        rc.SetDepthFunc(DepthFunc::LessOrEqual);
     198        rc.SetBlendFunc(BlendFunc::SrcAlpha, BlendFunc::OneMinusSrcAlpha);
     199        rc.SetAlphaFunc(AlphaFunc::GreaterOrEqual, 0.01f);
     200
    200201        PushCamera(data->m_default_cam);
    201202
     
    296297    if (data->m_lines.Count())
    297298    {
     299        rc.SetDepthFunc(DepthFunc::LessOrEqual);
     300        rc.SetBlendFunc(BlendFunc::SrcAlpha, BlendFunc::OneMinusSrcAlpha);
     301        rc.SetAlphaFunc(AlphaFunc::GreaterOrEqual, 0.01f);
     302
    298303        int linecount = data->m_lines.Count();
    299304
Note: See TracChangeset for help on using the changeset viewer.