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

Fixed OpenGL vertex attribute bindings

BearishSun 9 лет назад
Родитель
Сommit
39c4f21114
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      Source/BansheeGLRenderAPI/Source/BsGLSLParamParser.cpp

+ 2 - 1
Source/BansheeGLRenderAPI/Source/BsGLSLParamParser.cpp

@@ -40,8 +40,9 @@ namespace BansheeEngine
 			if (attribNameToElementSemantic(attributeName, semantic, index))
 			if (attribNameToElementSemantic(attributeName, semantic, index))
 			{
 			{
 				VertexElementType type = glTypeToAttributeType(attribType);
 				VertexElementType type = glTypeToAttributeType(attribType);
+				UINT32 slot = glGetAttribLocation(glProgram, attributeName);
 
 
-				elementList.push_back(VertexElement(0, i, type, semantic, index));
+				elementList.push_back(VertexElement(0, slot, type, semantic, index));
 			}
 			}
 			else
 			else
 			{
 			{