From 7f1169788af069ba06d56e94cd715ae586e829e3 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 21 Feb 2019 14:53:25 +0000 Subject: [PATCH] shader: use emit_ios_generic_outputs() in emit_ios_vs() Use the helper instead of open-coding it. v2: use callback (Gert) Signed-off-by: Emil Velikov Reviewed-By: Gert Wollny --- src/vrend_shader.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index a55022c..6066d7d 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -5937,6 +5937,11 @@ emit_ios_patch(struct dump_ctx *ctx, const char *prefix, const struct vrend_shad io->glsl_name, size); } +static bool +can_emit_generic_default(UNUSED const struct vrend_shader_io *io) +{ + return true; +} static void emit_ios_vs(struct dump_ctx *ctx) { @@ -5979,27 +5984,7 @@ static void emit_ios_vs(struct dump_ctx *ctx) } } - for (i = 0; i < ctx->num_outputs; i++) { - - if (!ctx->outputs[i].glsl_predefined_no_emit) { - const char *prefix = ""; - if (ctx->outputs[i].name == TGSI_SEMANTIC_GENERIC || - ctx->outputs[i].name == TGSI_SEMANTIC_COLOR || - ctx->outputs[i].name == TGSI_SEMANTIC_BCOLOR) { - ctx->num_interps++; - prefix = INTERP_PREFIX; - } - - emit_ios_generics(ctx, io_out, prefix, &ctx->outputs[i], - ctx->outputs[i].fbfetch_used ? "inout" : "out", ""); - - } else if (ctx->outputs[i].invariant || ctx->outputs[i].precise) { - emit_hdrf(ctx, "%s%s;\n", - ctx->outputs[i].precise ? "precise " : - (ctx->outputs[i].invariant ? "invariant " : ""), - ctx->outputs[i].glsl_name); - } - } + emit_ios_generic_outputs(ctx, can_emit_generic_default); emit_winsys_correction(ctx);