meta/blit: Add plumbing for shaders without depth
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Wed, 28 Jan 2015 14:24:25 +0000 (16:24 +0200)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 30 Jan 2015 07:54:53 +0000 (09:54 +0200)
Currently all blit programs are unconditionally compiled with
gl_FragDepth.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/common/meta.c
src/mesa/drivers/common/meta.h
src/mesa/drivers/common/meta_blit.c
src/mesa/drivers/common/meta_generate_mipmap.c

index 23c05ebdaffdacbdda1a5ecfea8b274dd8f6e912..ec7564ab7c486bab803ff7e8aabdacabe04b078f 100644 (file)
@@ -243,6 +243,7 @@ _mesa_meta_compile_and_link_program(struct gl_context *ctx,
 void
 _mesa_meta_setup_blit_shader(struct gl_context *ctx,
                              GLenum target,
+                             bool do_depth,
                              struct blit_shader_table *table)
 {
    char *vs_source, *fs_source;
@@ -3035,7 +3036,7 @@ decompress_texture_image(struct gl_context *ctx,
       _mesa_meta_setup_vertex_objects(&decompress->VAO, &decompress->VBO, true,
                                       2, 4, 0);
 
-      _mesa_meta_setup_blit_shader(ctx, target, &decompress->shaders);
+      _mesa_meta_setup_blit_shader(ctx, target, true, &decompress->shaders);
    } else {
       _mesa_meta_setup_ff_tnl_for_blit(&decompress->VAO, &decompress->VBO, 3);
    }
index 20d30f7e6abebf312ae3191433bc725569160e6d..de3dc6a0ab493dfd52a18599b1f2f372f0c381d7 100644 (file)
@@ -632,6 +632,7 @@ _mesa_meta_setup_copypix_texture(struct gl_context *ctx,
 void
 _mesa_meta_setup_blit_shader(struct gl_context *ctx,
                              GLenum target,
+                             bool do_depth,
                              struct blit_shader_table *table);
 
 void
index 079b8e13200dabe9c88d08f708a44ea68dc5e32d..02e90e0aaf74aebab0de1debc894a8211d4a3980 100644 (file)
@@ -531,7 +531,7 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
    } else if (is_target_multisample) {
       setup_glsl_msaa_blit_shader(ctx, blit, src_rb, target);
    } else {
-      _mesa_meta_setup_blit_shader(ctx, target, &blit->shaders);
+      _mesa_meta_setup_blit_shader(ctx, target, true, &blit->shaders);
    }
 }
 
index eedbb8eb2f46ff4ea4fccdb62cd2ad002cb8d392..c38b46bb688d0dc95a896e2ddbec3f71c325c5e2 100644 (file)
@@ -193,7 +193,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
    if (use_glsl_version) {
       _mesa_meta_setup_vertex_objects(&mipmap->VAO, &mipmap->VBO, true,
                                       2, 4, 0);
-      _mesa_meta_setup_blit_shader(ctx, target, &mipmap->shaders);
+      _mesa_meta_setup_blit_shader(ctx, target, true, &mipmap->shaders);
    } else {
       _mesa_meta_setup_ff_tnl_for_blit(&mipmap->VAO, &mipmap->VBO, 3);
       _mesa_set_enable(ctx, target, GL_TRUE);