meta: Call glObjectLabel before linking.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 1 Jul 2014 00:55:32 +0000 (17:55 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 9 Jul 2014 23:04:52 +0000 (16:04 -0700)
i965 precompiles shaders at link time, and prints a disassembly if
INTEL_DEBUG=vs,gs,fs, including the shader name.  However, blit shaders
were showing up as "unnamed" since we hadn't set a name prior to
linking.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/common/meta.c

index f1f57297c02e639d59012f630dad32e2779805f6..89d7a157ce4e2a67ec2135299a503983b6a38eb9 100644 (file)
@@ -217,6 +217,7 @@ _mesa_meta_compile_and_link_program(struct gl_context *ctx,
                                                     fs_source);
 
    *program = _mesa_CreateProgram();
+   _mesa_ObjectLabel(GL_PROGRAM, *program, -1, name);
    _mesa_AttachShader(*program, fs);
    _mesa_DeleteShader(fs);
    _mesa_AttachShader(*program, vs);
@@ -224,7 +225,6 @@ _mesa_meta_compile_and_link_program(struct gl_context *ctx,
    _mesa_BindAttribLocation(*program, 0, "position");
    _mesa_BindAttribLocation(*program, 1, "texcoords");
    _mesa_meta_link_program_with_debug(ctx, *program);
-   _mesa_ObjectLabel(GL_PROGRAM, *program, -1, name);
 
    _mesa_UseProgram(*program);
 }