]> git.tdb.fi Git - libs/gl.git/commitdiff
Sort shader program input attributes by name
authorMikko Rasa <tdb@tdb.fi>
Thu, 17 Mar 2022 19:56:40 +0000 (21:56 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 17 Mar 2022 20:06:05 +0000 (22:06 +0200)
The lookup requires this.  It seems to have gotten broken in 2576b61, but
since the only user is InstanceArray, it wasn't noticed until now.

source/backends/opengl/program_backend.cpp
source/core/program.cpp

index e83a94844dc4e79e28986e0d8dcf8e835e9cad7e..ce865cf3a0b53417dc0463902d5f9bd20a623b04 100644 (file)
@@ -444,6 +444,8 @@ void OpenGLProgram::query_attributes()
                        info.type = from_gl_type(type);
                }
        }
+
+       sort_member(reflect_data.attributes, &ReflectData::AttributeInfo::name);
 }
 
 void OpenGLProgram::finalize_uniforms()
index f8c35ec573ed9b1437ecb63879cca00b00b9d7ff..a82ac1d227279be4edd1175428af8e6c0dfe6ffd 100644 (file)
@@ -193,6 +193,8 @@ void Program::collect_attributes(const SpirVModule &mod)
                                        info.type = v->type;
                                }
                }
+
+       sort_member(reflect_data.attributes, &ReflectData::AttributeInfo::name);
 }
 
 void Program::collect_builtins(const SpirVModule &mod)