diff options
author | Ilia Mirkin <[email protected]> | 2015-03-29 19:59:38 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-04-02 00:09:14 -0400 |
commit | 8efa3e340d13a9f373e7b2834f12d9fae43e6867 (patch) | |
tree | 90bd7831f58242b63ac14d6a130d00f7493af507 /src/gallium/drivers/freedreno/a4xx | |
parent | 70eed78cacd711e663068e78a8430372cc5fabf1 (diff) |
freedreno: remove alpha key from ir3_shader
This complication is unnecessary and makes MRTs more complicated and
likely to generate tons of variants.
Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a4xx')
-rw-r--r-- | src/gallium/drivers/freedreno/a4xx/fd4_draw.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a4xx/fd4_emit.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a4xx/fd4_program.c | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_draw.c b/src/gallium/drivers/freedreno/a4xx/fd4_draw.c index 57f257478a7..6c54f61cc66 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_draw.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_draw.c @@ -97,9 +97,6 @@ fixup_shader_state(struct fd_context *ctx, struct ir3_shader_key *key) if (last_key->half_precision != key->half_precision) ctx->prog.dirty |= FD_SHADER_DIRTY_FP; - if (last_key->alpha != key->alpha) - ctx->prog.dirty |= FD_SHADER_DIRTY_FP; - if (last_key->rasterflat != key->rasterflat) ctx->prog.dirty |= FD_SHADER_DIRTY_FP; @@ -120,7 +117,6 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info) /* do binning pass first: */ .binning_pass = true, .color_two_side = ctx->rasterizer ? ctx->rasterizer->light_twoside : false, - .alpha = util_format_is_alpha(pipe_surface_format(pfb->cbufs[0])), .rasterflat = ctx->rasterizer && ctx->rasterizer->flatshade, // TODO set .half_precision based on render target format, // ie. float16 and smaller use half, float32 use full.. @@ -134,6 +130,7 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info) .fsaturate_r = fd4_ctx->fsaturate_r, }, .format = fd4_emit_format(pfb->cbufs[0]), + .pformat = pipe_surface_format(pfb->cbufs[0]), }; unsigned dirty; diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_emit.h b/src/gallium/drivers/freedreno/a4xx/fd4_emit.h index 5dc3db8880e..7d059f8e532 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_emit.h +++ b/src/gallium/drivers/freedreno/a4xx/fd4_emit.h @@ -54,6 +54,7 @@ struct fd4_emit { const struct pipe_draw_info *info; struct ir3_shader_key key; enum a4xx_color_fmt format; + enum pipe_format pformat; uint32_t dirty; /* cached to avoid repeated lookups of same variants: */ diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_program.c b/src/gallium/drivers/freedreno/a4xx/fd4_program.c index 776e4a16b14..9ee47fbdb66 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_program.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_program.c @@ -218,6 +218,9 @@ fd4_program_emit(struct fd_ringbuffer *ring, struct fd4_emit *emit) color_regid = ir3_find_output_regid(s[FS].v, ir3_semantic_name(TGSI_SEMANTIC_COLOR, 0)); + if (util_format_is_alpha(emit->pformat)) + color_regid += 3; + /* TODO get these dynamically: */ face_regid = s[FS].v->frag_face ? regid(0,0) : regid(63,0); coord_regid = s[FS].v->frag_coord ? regid(0,0) : regid(63,0); |