From b566317e7e6eb78a22cac759a4af2e9d78f74a32 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 15 Mar 2016 11:13:25 -0700 Subject: meta: Use ARB_explicit_attrib_location in the rest of the meta shaders. This is cleaner than using glBindAttribLocation(). Not all drivers support the extension, but I don't think those drivers use GLSL in the first place. Apparently some Meta shaders already use GL_ARB_explicit_attrib_location, so I think it should be okay. Honestly, I'm not sure how the old code worked anyway - we bound the attribute location for "texcoords", while all the shaders capitalized or spelled it differently. v2: Convert another instance in brw_meta_fast_clear.c. Signed-off-by: Kenneth Graunke Reviewed-by: Matt Turner --- src/mesa/drivers/dri/i965/brw_meta_fast_clear.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c index b81b1438ba3..fe61c1654d2 100644 --- a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c +++ b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c @@ -110,7 +110,8 @@ brw_bind_rep_write_shader(struct brw_context *brw, float *color) const char *vs_source = "#extension GL_AMD_vertex_shader_layer : enable\n" "#extension GL_ARB_draw_instanced : enable\n" - "attribute vec4 position;\n" + "#extension GL_ARB_explicit_attrib_location : enable\n" + "layout(location = 0) in vec4 position;\n" "uniform int layer;\n" "void main()\n" "{\n" @@ -144,7 +145,6 @@ brw_bind_rep_write_shader(struct brw_context *brw, float *color) _mesa_DeleteShader(fs); _mesa_AttachShader(clear->shader_prog, vs); _mesa_DeleteShader(vs); - _mesa_BindAttribLocation(clear->shader_prog, 0, "position"); _mesa_ObjectLabel(GL_PROGRAM, clear->shader_prog, -1, "meta repclear"); _mesa_LinkProgram(clear->shader_prog); -- cgit v1.2.3