閱片器項目工作總結1


void EntryExitPoints::initialize() {
    if (_has_init) {
        return;
    }
    if (GPU_BASE == _strategy && GL_BASE == _gpu_platform) {
        CHECK_GL_ERROR;

        //TODO change GL_RGBA32F->GL_RGBA16

        _entry_points_texture->get_gl_resource()->initialize();
        _exit_points_texture->get_gl_resource()->initialize();

        _entry_points_texture->get_gl_resource()->bind();
        GLTextureUtils::set_2d_wrap_s_t(GL_CLAMP_TO_BORDER);
        GLTextureUtils::set_filter(GL_TEXTURE_2D, GL_LINEAR);
        _entry_points_texture->get_gl_resource()->load(GL_RGBA32F, _width, _height, GL_RGBA, GL_FLOAT, NULL);
        _entry_points_texture->get_gl_resource()->unbind();

        _exit_points_texture->get_gl_resource()->bind();
        GLTextureUtils::set_2d_wrap_s_t(GL_CLAMP_TO_BORDER);
        GLTextureUtils::set_filter(GL_TEXTURE_2D, GL_LINEAR);
        _exit_points_texture->get_gl_resource()->load(GL_RGBA32F, _width, _height, GL_RGBA, GL_FLOAT, NULL);
        _exit_points_texture->get_gl_resource()->unbind();

        CHECK_GL_ERROR;
    }
    _has_init = true;

}

今天在整理一個閱片器項目的時候發現使用cpu模式下一隻有錯誤,調試代碼過程中發現有一個地方條件有誤,導致cpu模式下執行了gpu的代碼,經過修改,終於改好了 ,就是多加了這句話GPU_BASE == _strategy

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章