瀏覽代碼

freedreno/a3xx: add format to emit info, use to set sint/uint flags

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
tags/10.5-branchpoint
Ilia Mirkin 10 年之前
父節點
當前提交
d63afe3b58

+ 3
- 1
src/gallium/drivers/freedreno/a3xx/fd3_draw.c 查看文件

@@ -114,6 +114,7 @@ static void
fd3_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
{
struct fd3_context *fd3_ctx = fd3_context(ctx);
struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
struct fd3_emit emit = {
.vtx = &ctx->vtx,
.prog = &ctx->prog,
@@ -122,7 +123,7 @@ fd3_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(ctx->framebuffer.cbufs[0])),
.alpha = util_format_is_alpha(pipe_surface_format(pfb->cbufs[0])),
// TODO set .half_precision based on render target format,
// ie. float16 and smaller use half, float32 use full..
.half_precision = !!(fd_mesa_debug & FD_DBG_FRAGHALF),
@@ -134,6 +135,7 @@ fd3_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
.fsaturate_t = fd3_ctx->fsaturate_t,
.fsaturate_r = fd3_ctx->fsaturate_r,
},
.format = pipe_surface_format(pfb->cbufs[0]),
.rasterflat = ctx->rasterizer && ctx->rasterizer->flatshade,
};
unsigned dirty;

+ 1
- 0
src/gallium/drivers/freedreno/a3xx/fd3_emit.h 查看文件

@@ -53,6 +53,7 @@ struct fd3_emit {
const struct fd_program_stateobj *prog;
const struct pipe_draw_info *info;
struct ir3_shader_key key;
enum pipe_format format;
uint32_t dirty;
bool rasterflat;


+ 3
- 1
src/gallium/drivers/freedreno/a3xx/fd3_program.c 查看文件

@@ -351,7 +351,9 @@ fd3_program_emit(struct fd_ringbuffer *ring, struct fd3_emit *emit)

OUT_PKT0(ring, REG_A3XX_SP_FS_MRT_REG(0), 4);
OUT_RING(ring, A3XX_SP_FS_MRT_REG_REGID(color_regid) |
COND(fp->key.half_precision, A3XX_SP_FS_MRT_REG_HALF_PRECISION));
COND(fp->key.half_precision, A3XX_SP_FS_MRT_REG_HALF_PRECISION) |
COND(util_format_is_pure_uint(emit->format), A3XX_SP_FS_MRT_REG_UINT) |
COND(util_format_is_pure_sint(emit->format), A3XX_SP_FS_MRT_REG_SINT));
OUT_RING(ring, A3XX_SP_FS_MRT_REG_REGID(0));
OUT_RING(ring, A3XX_SP_FS_MRT_REG_REGID(0));
OUT_RING(ring, A3XX_SP_FS_MRT_REG_REGID(0));

Loading…
取消
儲存