void *const mem_ctx = ralloc_context(NULL);
struct blit_shader *shader = choose_blit_shader(target, table);
const char *vs_input, *vs_output, *fs_input, *vs_preprocess, *fs_preprocess;
- const char *fs_output_var, *fs_output_var_decl;
if (ctx->Const.GLSLVersion < 130) {
vs_preprocess = "";
vs_output = "varying";
fs_preprocess = "#extension GL_EXT_texture_array : enable";
fs_input = "varying";
- fs_output_var_decl = "";
- fs_output_var = "gl_FragColor";
} else {
vs_preprocess = "#version 130";
vs_input = "in";
vs_output = "out";
fs_preprocess = "#version 130";
fs_input = "in";
- fs_output_var_decl = "out vec4 out_color;";
- fs_output_var = "out_color";
shader->func = "texture";
}
"#extension GL_ARB_texture_cube_map_array: enable\n"
"uniform %s texSampler;\n"
"%s vec4 texCoords;\n"
- "%s\n"
"void main()\n"
"{\n"
- " vec4 color = %s(texSampler, %s);\n"
- " %s = color;\n"
- " gl_FragDepth = color.x;\n"
+ " gl_FragColor = %s(texSampler, %s);\n"
+ " gl_FragDepth = gl_FragColor.x;\n"
"}\n",
- fs_preprocess, shader->type, fs_input, fs_output_var_decl,
- shader->func, shader->texcoords, fs_output_var);
+ fs_preprocess, shader->type, fs_input,
+ shader->func, shader->texcoords);
_mesa_meta_compile_and_link_program(ctx, vs_source, fs_source,
ralloc_asprintf(mem_ctx, "%s blit",