Ignore:
Timestamp:
Apr 20, 2012, 6:33:09 PM (10 years ago)
Author:
sam
Message:

gpu: fix a great lot of Direct3D problems, spotted using PIX.

File:
1 edited

Legend:

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

    r1228 r1241  
    426426    cgGLEnableProfile(cgGLGetLatestProfile(CG_GL_FRAGMENT));
    427427    cgGLBindProgram(data->frag_id);
     428#endif
     429}
     430
     431void Shader::Unbind() const
     432{
     433#if defined USE_D3D9 || defined _XBOX
     434    HRESULT hr;
     435    hr = g_d3ddevice->SetVertexShader(NULL);
     436    hr = g_d3ddevice->SetPixelShader(NULL);
     437#elif !defined __CELLOS_LV2__
     438    /* FIXME: untested */
     439    glUseProgram(0);
     440#else
     441    /* FIXME: untested */
     442    cgGLDisableProfile(cgGLGetLatestProfile(CG_GL_VERTEX));
     443    cgGLDisableProfile(cgGLGetLatestProfile(CG_GL_FRAGMENT));
    428444#endif
    429445}
Note: See TracChangeset for help on using the changeset viewer.