Procházet zdrojové kódy

Merge pull request #1548 from FernandoS27/fix-vao

Fixed VAOs Float types only returning GL_FLOAT
bunnei před 7 roky
rodič
revize
38fa3aae73
1 změnil soubory, kde provedl 14 přidání a 2 odebrání
  1. 14 2
      src/video_core/renderer_opengl/maxwell_to_gl.h

+ 14 - 2
src/video_core/renderer_opengl/maxwell_to_gl.h

@@ -82,8 +82,20 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) {
         return {};
         return {};
     }
     }
 
 
-    case Maxwell::VertexAttribute::Type::Float:
-        return GL_FLOAT;
+    case Maxwell::VertexAttribute::Type::Float: {
+        switch (attrib.size) {
+        case Maxwell::VertexAttribute::Size::Size_16:
+        case Maxwell::VertexAttribute::Size::Size_16_16:
+        case Maxwell::VertexAttribute::Size::Size_16_16_16:
+        case Maxwell::VertexAttribute::Size::Size_16_16_16_16:
+            return GL_HALF_FLOAT;
+        case Maxwell::VertexAttribute::Size::Size_32:
+        case Maxwell::VertexAttribute::Size::Size_32_32:
+        case Maxwell::VertexAttribute::Size::Size_32_32_32:
+        case Maxwell::VertexAttribute::Size::Size_32_32_32_32:
+            return GL_FLOAT;
+        }
+    }
     }
     }
 
 
     LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex type={}", attrib.TypeString());
     LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex type={}", attrib.TypeString());