mirror of
https://github.com/lubosz/overte.git
synced 2025-04-25 00:03:16 +02:00
render pipeline support for normalized intergers
This commit is contained in:
parent
60bc76e1c4
commit
fcf18cba91
3 changed files with 18 additions and 10 deletions
|
@ -99,8 +99,13 @@ void GL41Backend::updateInput() {
|
|||
GLboolean isNormalized = attrib._element.isNormalized();
|
||||
|
||||
for (size_t locNum = 0; locNum < locationCount; ++locNum) {
|
||||
glVertexAttribPointer(slot + (GLuint)locNum, count, type, isNormalized, stride,
|
||||
reinterpret_cast<GLvoid*>(pointer + perLocationStride * (GLuint)locNum));
|
||||
if (attrib._element.isInteger()) {
|
||||
glVertexAttribIPointer(slot + (GLuint)locNum, count, type, stride,
|
||||
reinterpret_cast<GLvoid*>(pointer + perLocationStride * (GLuint)locNum));
|
||||
} else {
|
||||
glVertexAttribPointer(slot + (GLuint)locNum, count, type, isNormalized, stride,
|
||||
reinterpret_cast<GLvoid*>(pointer + perLocationStride * (GLuint)locNum));
|
||||
}
|
||||
#ifdef GPU_STEREO_DRAWCALL_INSTANCED
|
||||
glVertexAttribDivisor(slot + (GLuint)locNum, attrib._frequency * (isStereo() ? 2 : 1));
|
||||
#else
|
||||
|
|
|
@ -61,8 +61,11 @@ void GL45Backend::updateInput() {
|
|||
_input._attributeActivation.set(attriNum);
|
||||
glEnableVertexAttribArray(attriNum);
|
||||
}
|
||||
glVertexAttribFormat(attriNum, count, type, isNormalized, offset + locNum * perLocationSize);
|
||||
// TODO: Support properly the IAttrib version
|
||||
if (attrib._element.isInteger()) {
|
||||
glVertexAttribIFormat(attriNum, count, type, offset + locNum * perLocationSize);
|
||||
} else {
|
||||
glVertexAttribFormat(attriNum, count, type, isNormalized, offset + locNum * perLocationSize);
|
||||
}
|
||||
glVertexAttribBinding(attriNum, attrib._channel);
|
||||
}
|
||||
|
||||
|
|
|
@ -75,12 +75,12 @@ static const bool TYPE_IS_INTEGER[NUM_TYPES] = {
|
|||
true,
|
||||
|
||||
// Normalized values
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
};
|
||||
|
||||
// Dimension of an Element
|
||||
|
|
Loading…
Reference in a new issue