summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_shader.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-12-07 19:30:08 +0100
committerMarek Olšák <[email protected]>2014-12-10 21:59:37 +0100
commit161534737c643e15bacf77b389daa18da325b74f (patch)
tree878d225ad66f18eb1244e70c7a77171c5f0b80c0 /src/gallium/drivers/radeonsi/si_shader.c
parent20e570d1156b76916cd6bf2a0113f548de8c4644 (diff)
radeonsi: get info about VS outputs from tgsi_shader_info
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 037811edd18..ce59f0ebb66 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -804,7 +804,6 @@ static void si_llvm_emit_clipvertex(struct lp_build_tgsi_context * bld_base,
LLVMValueRef (*pos)[9], LLVMValueRef *out_elts)
{
struct si_shader_context *si_shader_ctx = si_shader_context(bld_base);
- struct si_shader *shader = si_shader_ctx->shader;
struct lp_build_context *base = &bld_base->base;
struct lp_build_context *uint = &si_shader_ctx->radeon_bld.soa.bld_base.uint_bld;
unsigned reg_index;
@@ -818,8 +817,6 @@ static void si_llvm_emit_clipvertex(struct lp_build_tgsi_context * bld_base,
for (reg_index = 0; reg_index < 2; reg_index ++) {
LLVMValueRef *args = pos[2 + reg_index];
- shader->clip_dist_write |= 0xf << (4 * reg_index);
-
args[5] =
args[6] =
args[7] =
@@ -1088,18 +1085,12 @@ handle_semantic:
/* Select the correct target */
switch(semantic_name) {
case TGSI_SEMANTIC_PSIZE:
- shader->vs_out_misc_write = true;
- shader->vs_out_point_size = true;
psize_value = outputs[i].values[0];
continue;
case TGSI_SEMANTIC_EDGEFLAG:
- shader->vs_out_misc_write = true;
- shader->vs_out_edgeflag = true;
edgeflag_value = outputs[i].values[0];
continue;
case TGSI_SEMANTIC_LAYER:
- shader->vs_out_misc_write = true;
- shader->vs_out_layer = true;
layer_value = outputs[i].values[0];
continue;
case TGSI_SEMANTIC_POSITION:
@@ -1112,8 +1103,6 @@ handle_semantic:
param_count++;
break;
case TGSI_SEMANTIC_CLIPDIST:
- shader->clip_dist_write |=
- 0xf << (semantic_index * 4);
target = V_008DFC_SQ_EXP_POS + 2 + semantic_index;
break;
case TGSI_SEMANTIC_CLIPVERTEX:
@@ -1166,11 +1155,13 @@ handle_semantic:
}
/* Write the misc vector (point size, edgeflag, layer, viewport). */
- if (shader->vs_out_misc_write) {
+ if (shader->selector->info.writes_psize ||
+ shader->selector->info.writes_edgeflag ||
+ shader->selector->info.writes_layer) {
pos_args[1][0] = lp_build_const_int32(base->gallivm, /* writemask */
- shader->vs_out_point_size |
- (shader->vs_out_edgeflag << 1) |
- (shader->vs_out_layer << 2));
+ shader->selector->info.writes_psize |
+ (shader->selector->info.writes_edgeflag << 1) |
+ (shader->selector->info.writes_layer << 2));
pos_args[1][1] = uint->zero; /* EXEC mask */
pos_args[1][2] = uint->zero; /* last export? */
pos_args[1][3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_POS + 1);
@@ -1180,10 +1171,10 @@ handle_semantic:
pos_args[1][7] = base->zero; /* Z */
pos_args[1][8] = base->zero; /* W */
- if (shader->vs_out_point_size)
+ if (shader->selector->info.writes_psize)
pos_args[1][5] = psize_value;
- if (shader->vs_out_edgeflag) {
+ if (shader->selector->info.writes_edgeflag) {
/* The output is a float, but the hw expects an integer
* with the first bit containing the edge flag. */
edgeflag_value = LLVMBuildFPToUI(base->gallivm->builder,
@@ -1199,7 +1190,7 @@ handle_semantic:
base->elem_type, "");
}
- if (shader->vs_out_layer)
+ if (shader->selector->info.writes_layer)
pos_args[1][7] = layer_value;
}