Changeset 1532


Ignore:
Timestamp:
Jun 28, 2012, 2:30:23 PM (8 years ago)
Author:
sam
Message:

gpu: fix vertex and index buffer behaviour on the PS3.

Location:
trunk/src/gpu
Files:
2 edited

Legend:

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

    r1455 r1532  
    4848#elif defined _XBOX
    4949    D3DIndexBuffer *m_ibo;
    50 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__
     50#else
    5151    GLuint m_ibo;
    5252    uint8_t *m_memory;
     
    7070                                              &m_data->m_ibo, NULL)))
    7171        Abort();
    72 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__
     72#else
    7373    glGenBuffers(1, &m_data->m_ibo);
    7474    m_data->m_memory = new uint8_t[size];
     
    8383        if (FAILED(m_data->m_ibo->Release()))
    8484            Abort();
    85 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__
     85#else
    8686        glDeleteBuffers(1, &m_data->m_ibo);
    8787        delete[] m_data->m_memory;
     
    101101        Abort();
    102102    return ret;
    103 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__
     103#else
    104104    return m_data->m_memory + offset;
    105105#endif
     
    114114    if (FAILED(m_data->m_ibo->Unlock()))
    115115        Abort();
    116 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__
     116#else
    117117    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_data->m_ibo);
    118118    glBufferData(GL_ELEMENT_ARRAY_BUFFER, m_data->m_size, m_data->m_memory,
     
    129129    if (FAILED(g_d3ddevice->SetIndices(m_data->m_ibo)))
    130130        Abort();
    131 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__
     131#else
    132132    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_data->m_ibo);
    133133    /* XXX: not necessary because we kept track of the size */
     
    145145    if (FAILED(g_d3ddevice->SetIndices(NULL)))
    146146        Abort();
    147 #elif !defined __CELLOS_LV2__ && !defined __ANDROID__
     147#else
    148148    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
    149149#endif
  • trunk/src/gpu/vertexbuffer.cpp

    r1517 r1532  
    247247#else
    248248    /* Or even: */
    249     //glDisableClientState(GL_VERTEX_ARRAY);
     249    glDisableClientState(GL_VERTEX_ARRAY);
     250    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
     251    glDisableClientState(GL_NORMAL_ARRAY);
     252    glDisableClientState(GL_COLOR_ARRAY);
    250253#endif
    251254}
     
    314317        case VertexUsage::Position:
    315318            glEnableClientState(GL_VERTEX_ARRAY);
     319            break;
     320        case VertexUsage::TexCoord:
     321            glEnableClientState(GL_TEXTURE_COORD_ARRAY);
     322            break;
     323        case VertexUsage::Normal:
     324            glEnableClientState(GL_NORMAL_ARRAY);
    316325            break;
    317326        case VertexUsage::Color:
     
    531540                                               D3DPOOL_MANAGED, &m_data->m_vbo, NULL)))
    532541        Abort();
    533 #elif !defined __CELLOS_LV2__
     542#else
    534543    glGenBuffers(1, &m_data->m_vbo);
    535544    m_data->m_memory = new uint8_t[size];
     
    544553        if (FAILED(m_data->m_vbo->Release()))
    545554            Abort();
    546 #elif !defined __CELLOS_LV2__
     555#else
    547556        glDeleteBuffers(1, &m_data->m_vbo);
    548557        delete[] m_data->m_memory;
     
    561570        Abort();
    562571    return ret;
    563 #elif !defined __CELLOS_LV2__
     572#else
    564573    return m_data->m_memory + offset;
    565574#endif
     
    573582    if (FAILED(m_data->m_vbo->Unlock()))
    574583        Abort();
    575 #elif !defined __CELLOS_LV2__
     584#else
    576585    glBindBuffer(GL_ARRAY_BUFFER, m_data->m_vbo);
    577586    glBufferData(GL_ARRAY_BUFFER, m_data->m_size, m_data->m_memory,
Note: See TracChangeset for help on using the changeset viewer.