Changeset 1266


Ignore:
Timestamp:
Apr 22, 2012, 12:32:24 AM (9 years ago)
Author:
sam
Message:

gpu: normalize 8-bit integer data in 0..1 by default.

File:
1 edited

Legend:

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

    r1253 r1266  
    295295            type_index = 0;
    296296
     297        /* Normalize unsigned bytes by default, because it's usually
     298         * some color information. */
     299        GLboolean normalize = (tlut[type_index].type == GL_UNSIGNED_BYTE)
     300                           || (tlut[type_index].type == GL_BYTE);
     301
    297302        glVertexAttribPointer((GLint)reg, tlut[type_index].size,
    298                               tlut[type_index].type, GL_FALSE,
     303                              tlut[type_index].type, normalize,
    299304                              stride, (GLvoid const *)(uintptr_t)offset);
    300305    }
Note: See TracChangeset for help on using the changeset viewer.