Просмотр исходного кода

Merge pull request #926 from ogniK5377/vertex-attrib-format

gl_rasterizer: Fix glVertexAttribFormat for integers
bunnei 8 лет назад
Родитель
Сommit
ce46fb27ca
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      src/video_core/renderer_opengl/gl_rasterizer.cpp

+ 8 - 2
src/video_core/renderer_opengl/gl_rasterizer.cpp

@@ -169,8 +169,14 @@ std::pair<u8*, GLintptr> RasterizerOpenGL::SetupVertexArrays(u8* array_ptr,
         ASSERT(buffer.IsEnabled());
 
         glEnableVertexAttribArray(index);
-        glVertexAttribFormat(index, attrib.ComponentCount(), MaxwellToGL::VertexType(attrib),
-                             attrib.IsNormalized() ? GL_TRUE : GL_FALSE, attrib.offset);
+        if (attrib.type == Tegra::Engines::Maxwell3D::Regs::VertexAttribute::Type::SignedInt ||
+            attrib.type == Tegra::Engines::Maxwell3D::Regs::VertexAttribute::Type::UnsignedInt) {
+            glVertexAttribIFormat(index, attrib.ComponentCount(), MaxwellToGL::VertexType(attrib),
+                                  attrib.offset);
+        } else {
+            glVertexAttribFormat(index, attrib.ComponentCount(), MaxwellToGL::VertexType(attrib),
+                                 attrib.IsNormalized() ? GL_TRUE : GL_FALSE, attrib.offset);
+        }
         glVertexAttribBinding(index, attrib.buffer);
     }