From: Roland Scheidegger Date: Fri, 18 Dec 2015 20:44:06 +0000 (+0100) Subject: llvmpipe: scratch some special handling of vp_index/layer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01761a38e8f49b528facf9853c27bbc8891a4424;p=mesa.git llvmpipe: scratch some special handling of vp_index/layer It was actually slightly buggy (missing initialization / setup not dependent on new vs albeit I didn't see issues), but the case of non-existing attributes is now handled by draw emit code so don't need that anymore. Reviewed-by: Brian Paul Reviewed-by: Edward O'Callaghan --- diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.h b/src/gallium/drivers/llvmpipe/lp_bld_interp.h index 0a52642e395..9029d2a4180 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_interp.h +++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.h @@ -63,8 +63,7 @@ enum lp_interp { LP_INTERP_LINEAR, LP_INTERP_PERSPECTIVE, LP_INTERP_POSITION, - LP_INTERP_FACING, - LP_INTERP_ZERO + LP_INTERP_FACING }; struct lp_shader_input { diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index 9dcc102e758..b1cb10250bc 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -125,12 +125,6 @@ struct llvmpipe_context { /** A fake frontface output for unfilled primitives */ uint8_t face_slot; - /** Which output slot is used for the fake vp index info */ - uint8_t fake_vpindex_slot; - - /** Which output slot is used for the fake layer info */ - uint8_t fake_layer_slot; - /** Depth format and bias settings. */ boolean floating_point_depth; double mrd; /**< minimum resolvable depth value, for polygon offset */ diff --git a/src/gallium/drivers/llvmpipe/lp_state_derived.c b/src/gallium/drivers/llvmpipe/lp_state_derived.c index f5bcfb2b511..f1f51cf0381 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_derived.c +++ b/src/gallium/drivers/llvmpipe/lp_state_derived.c @@ -100,27 +100,16 @@ compute_vertex_info(struct llvmpipe_context *llvmpipe) draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_CONSTANT, vs_index); /* * For vp index and layer, if the fs requires them but the vs doesn't - * provide them, store the slot - we'll later replace the data directly - * with zero (as required by ARB_fragment_layer_viewport). This is - * because draw itself just redirects them to whatever was at output 0. - * We'll also store the real vpindex/layer slot for setup use. + * provide them, draw (vbuf) will give us the required 0 (slot -1). + * (This means in this case we'll also use those slots in setup, which + * isn't necessary but they'll contain the correct (0) value.) */ } else if (lpfs->info.base.input_semantic_name[i] == TGSI_SEMANTIC_VIEWPORT_INDEX) { - if (vs_index >= 0) { - llvmpipe->viewport_index_slot = vinfo->num_attribs; - } - else { - llvmpipe->fake_vpindex_slot = vinfo->num_attribs; - } + llvmpipe->viewport_index_slot = vinfo->num_attribs; draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_CONSTANT, vs_index); } else if (lpfs->info.base.input_semantic_name[i] == TGSI_SEMANTIC_LAYER) { - if (vs_index >= 0) { - llvmpipe->layer_slot = vinfo->num_attribs; - } - else { - llvmpipe->fake_layer_slot = vinfo->num_attribs; - } + llvmpipe->layer_slot = vinfo->num_attribs; draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_CONSTANT, vs_index); } else { /* diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c index d7ba5c8ad8e..20e177f54fb 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c @@ -602,13 +602,6 @@ emit_tri_coef( struct gallivm_state *gallivm, */ break; - case LP_INTERP_ZERO: - /* - * The information we get from the output is bogus, replace it - * with zero. - */ - emit_constant_coef4(gallivm, args, slot+1, args->bld.zero); - break; case LP_INTERP_FACING: emit_facing_coef(gallivm, args, slot+1); break; @@ -879,13 +872,7 @@ lp_make_setup_variant_key(struct llvmpipe_context *lp, key->pad = 0; memcpy(key->inputs, fs->inputs, key->num_inputs * sizeof key->inputs[0]); for (i = 0; i < key->num_inputs; i++) { - if (key->inputs[i].interp == LP_INTERP_CONSTANT) { - if (key->inputs[i].src_index == lp->fake_vpindex_slot || - key->inputs[i].src_index == lp->fake_layer_slot) { - key->inputs[i].interp = LP_INTERP_ZERO; - } - } - else if (key->inputs[i].interp == LP_INTERP_COLOR) { + if (key->inputs[i].interp == LP_INTERP_COLOR) { if (lp->rasterizer->flatshade) key->inputs[i].interp = LP_INTERP_CONSTANT; else