| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 ParamCache* param_cache) { | 78 ParamCache* param_cache) { |
| 79 DLOG_ASSERT(material); | 79 DLOG_ASSERT(material); |
| 80 DLOG_ASSERT(draw_element); | 80 DLOG_ASSERT(draw_element); |
| 81 DLOG_ASSERT(param_cache); | 81 DLOG_ASSERT(param_cache); |
| 82 DLOG_FIRST_N(INFO, kNumLoggedEvents) << "PrimitiveGL Draw \"" | 82 DLOG_FIRST_N(INFO, kNumLoggedEvents) << "PrimitiveGL Draw \"" |
| 83 << draw_element->name() << "\""; | 83 << draw_element->name() << "\""; |
| 84 DrawElementGL* draw_element_gl = down_cast<DrawElementGL*>(draw_element); | 84 DrawElementGL* draw_element_gl = down_cast<DrawElementGL*>(draw_element); |
| 85 EffectGL* effect_gl = down_cast<EffectGL*>(material->effect()); | 85 EffectGL* effect_gl = down_cast<EffectGL*>(material->effect()); |
| 86 DLOG_ASSERT(effect_gl); | 86 DLOG_ASSERT(effect_gl); |
| 87 StreamBankGL* stream_bank_gl = down_cast<StreamBankGL*>(stream_bank()); | 87 StreamBankGL* stream_bank_gl = down_cast<StreamBankGL*>(stream_bank()); |
| 88 DLOG_ASSERT(stream_bank_gl); | 88 DLOG_ASSERT(stream_bank_gl); |
| 89 | 89 |
| 90 ParamCacheGL* param_cache_gl = down_cast<ParamCacheGL*>(param_cache); | 90 ParamCacheGL* param_cache_gl = down_cast<ParamCacheGL*>(param_cache); |
| 91 ParamCacheGL::VaryingParameterMap& varying_map = | 91 ParamCacheGL::VaryingParameterMap& varying_map = |
| 92 param_cache_gl->varying_map(); | 92 param_cache_gl->varying_map(); |
| 93 | 93 |
| 94 // If this PrimitiveGL has an effect we haven't seen before (or it's the first | 94 // If this PrimitiveGL has an effect we haven't seen before (or it's the first |
| 95 // time through), initalize the parameter lists before drawing with it. | 95 // time through), initalize the parameter lists before drawing with it. |
| 96 if (effect_gl->cg_vertex_program() && effect_gl->cg_fragment_program()) { | 96 if (effect_gl->cg_vertex_program() && effect_gl->cg_fragment_program()) { |
| 97 // Set up the current CGeffect. | 97 // Set up the current CGeffect. |
| 98 if (!param_cache_gl->ValidateAndCacheParams(effect_gl, | 98 if (!param_cache_gl->ValidateAndCacheParams(effect_gl, |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // Disable the vertex attribute states set earlier. | 249 // Disable the vertex attribute states set earlier. |
| 250 for (ParamCacheGL::VaryingParameterMap::iterator i = varying_map.begin(); | 250 for (ParamCacheGL::VaryingParameterMap::iterator i = varying_map.begin(); |
| 251 i != varying_map.end(); | 251 i != varying_map.end(); |
| 252 ++i) { | 252 ++i) { |
| 253 cgGLDisableClientState(i->first); | 253 cgGLDisableClientState(i->first); |
| 254 } | 254 } |
| 255 CHECK_GL_ERROR(); | 255 CHECK_GL_ERROR(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace o3d | 258 } // namespace o3d |
| OLD | NEW |