Changeset 1475


Ignore:
Timestamp:
Jun 14, 2012, 8:22:56 PM (7 years ago)
Author:
sam
Message:

gpu: do not convert integers in vertex streams to floats.

File:
1 edited

Legend:

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

    r1466 r1475  
    359359            type_index = 0;
    360360
    361         /* Normalize unsigned bytes by default, because it's usually
    362          * some color information. */
    363         GLboolean normalize = (tlut[type_index].type == GL_UNSIGNED_BYTE)
    364                            || (tlut[type_index].type == GL_BYTE);
    365361
    366362#   if !defined __CELLOS_LV2__
    367         glVertexAttribPointer((GLint)reg, tlut[type_index].size,
    368                               tlut[type_index].type, normalize,
    369                               stride, (GLvoid const *)(uintptr_t)offset);
     363        if (type_index <= 12)
     364        {
     365            /* Normalize unsigned bytes by default, because it's usually
     366             * some color information. */
     367            GLboolean normalize = (tlut[type_index].type == GL_UNSIGNED_BYTE)
     368                               || (tlut[type_index].type == GL_BYTE);
     369            glVertexAttribPointer((GLint)reg, tlut[type_index].size,
     370                                  tlut[type_index].type, normalize,
     371                                  stride, (GLvoid const *)(uintptr_t)offset);
     372        }
     373        else
     374        {
     375            glVertexAttribIPointer((GLint)reg, tlut[type_index].size,
     376                                   tlut[type_index].type,
     377                                   stride, (GLvoid const *)(uintptr_t)offset);
     378        }
    370379#   else
    371380        switch (usage)
Note: See TracChangeset for help on using the changeset viewer.