From 8c1a4692539e701dfdff170d7a8b363a6beea6ec Mon Sep 17 00:00:00 2001 From: vladislavbelov Date: Tue, 12 Apr 2022 16:49:04 +0000 Subject: [PATCH] Uses GL device capabilities for all vertex attribute locations. This was SVN commit r26782. --- source/renderer/backend/gl/ShaderProgram.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/renderer/backend/gl/ShaderProgram.cpp b/source/renderer/backend/gl/ShaderProgram.cpp index 89c8007bfd..7b12febbd6 100644 --- a/source/renderer/backend/gl/ShaderProgram.cpp +++ b/source/renderer/backend/gl/ShaderProgram.cpp @@ -763,7 +763,7 @@ public: { const GLint size = GLSizeFromFormat(format); const GLenum type = GLTypeFromFormat(format); - glVertexAttribPointer(2, size, type, (type == GL_FLOAT ? GL_FALSE : GL_TRUE), stride, pointer); + glVertexAttribPointer(m_Device->GetCapabilities().computeShaders ? 1 : 2, size, type, (type == GL_FLOAT ? GL_FALSE : GL_TRUE), stride, pointer); m_ValidStreams |= STREAM_NORMAL; } @@ -771,7 +771,7 @@ public: { const GLint size = GLSizeFromFormat(format); const GLenum type = GLTypeFromFormat(format); - glVertexAttribPointer(3, size, type, (type == GL_FLOAT ? GL_FALSE : GL_TRUE), stride, pointer); + glVertexAttribPointer(m_Device->GetCapabilities().computeShaders ? 2 : 3, size, type, (type == GL_FLOAT ? GL_FALSE : GL_TRUE), stride, pointer); m_ValidStreams |= STREAM_COLOR; } @@ -779,7 +779,8 @@ public: { const GLint size = GLSizeFromFormat(format); const GLenum type = GLTypeFromFormat(format); - glVertexAttribPointer(8 + texture - GL_TEXTURE0, size, type, GL_FALSE, stride, pointer); + glVertexAttribPointer( + (m_Device->GetCapabilities().computeShaders ? 3 : 8) + texture - GL_TEXTURE0, size, type, GL_FALSE, stride, pointer); m_ValidStreams |= STREAM_UV0 << (texture - GL_TEXTURE0); }