From 570c75a6c609c695fc72c3856e816f8f543b1fe9 Mon Sep 17 00:00:00 2001 From: Jeannot Breton Date: Tue, 11 Jul 2017 17:25:06 -0500 Subject: [PATCH] All scalar or vector VS Inputs use one location GetLocations() was returning 2 locations for dvec3 and dvec4, this was incorrect for vertex shader input. Affects: KHR-GL45.enhanced_layouts.varying_location_limit Components: OpenGL VK-GL-CTS issue: 569 Change-Id: I884aa05dddb209f690beae3762d05edc3d56ca2e --- external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.cpp | 8 ++++---- external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.cpp b/external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.cpp index c9f4ab1..135b456 100644 --- a/external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.cpp +++ b/external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.cpp @@ -500,14 +500,14 @@ const glw::GLchar* Type::GetGLSLTypeName() const * * @return Number of columns times: * - 2 when type is double with 3 or 4 rows, - * - 1 otherwise. + * - 1 otherwise or if it's a vertex shader input. **/ -GLuint Type::GetLocations() const +GLuint Type::GetLocations(bool is_vs_input) const { GLuint n_loc_per_column; /* 1 or 2 doubles any for rest */ - if ((2 >= m_n_rows) || (Double != m_basic_type)) + if ((2 >= m_n_rows) || (Double != m_basic_type) || is_vs_input) { n_loc_per_column = 1; } @@ -5119,7 +5119,7 @@ GLint TestBase::getLastInputLocation(Utils::Shader::STAGES stage, const Utils::T #endif - const GLuint n_req_location = type.GetLocations() * array_length; + const GLuint n_req_location = type.GetLocations(stage == Utils::Shader::VERTEX) * array_length; return n_avl_locations - n_req_location; /* last is max - 1 */ } diff --git a/external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.hpp b/external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.hpp index 68fbcf3..427b77c 100644 --- a/external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.hpp +++ b/external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.hpp @@ -65,7 +65,7 @@ public: glw::GLuint GetBaseAlignment(bool is_array) const; std::string GetGLSLConstructor(const glw::GLvoid* data) const; const glw::GLchar* GetGLSLTypeName() const; - glw::GLuint GetLocations() const; + glw::GLuint GetLocations(bool is_vs_input = false) const; glw::GLuint GetSize(const bool is_std140 = false) const; glw::GLenum GetTypeGLenum() const; glw::GLuint GetNumComponents() const; -- 2.7.4