diff options
author | Rob Clark <[email protected]> | 2015-09-15 17:25:47 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2015-09-15 17:29:01 -0400 |
commit | d85267c4bb5416dc3fbac7798b4bb68247340508 (patch) | |
tree | 4c48f2cbeb878de1c107a4930138cb7da5c832c5 /src/gallium/drivers/freedreno/a4xx/fd4_emit.c | |
parent | f8222724f539b9e16affc0f4ddd95cfda27293a5 (diff) |
freedreno/a4xx: border-color support
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a4xx/fd4_emit.c')
-rw-r--r-- | src/gallium/drivers/freedreno/a4xx/fd4_emit.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c index b75be29e523..5f36cef3e9a 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c @@ -124,7 +124,20 @@ static void emit_textures(struct fd_context *ctx, struct fd_ringbuffer *ring, enum adreno_state_block sb, struct fd_texture_stateobj *tex) { - unsigned i; + static const uint32_t bcolor_reg[] = { + [SB_VERT_TEX] = REG_A4XX_TPL1_TP_VS_BORDER_COLOR_BASE_ADDR, + [SB_FRAG_TEX] = REG_A4XX_TPL1_TP_FS_BORDER_COLOR_BASE_ADDR, + }; + struct fd4_context *fd4_ctx = fd4_context(ctx); + unsigned i, off; + void *ptr; + + u_upload_alloc(fd4_ctx->border_color_uploader, + 0, 2 * PIPE_MAX_SAMPLERS * BORDERCOLOR_SIZE, &off, + &fd4_ctx->border_color_buf, + &ptr); + + fd_setup_border_colors(tex, ptr, 0); if (tex->num_samplers > 0) { int num_samplers; @@ -190,6 +203,11 @@ emit_textures(struct fd_context *ctx, struct fd_ringbuffer *ring, OUT_RING(ring, 0x00000000); } } + + OUT_PKT0(ring, bcolor_reg[sb], 1); + OUT_RELOC(ring, fd_resource(fd4_ctx->border_color_buf)->bo, off, 0, 0); + + u_upload_unmap(fd4_ctx->border_color_uploader); } /* emit texture state for mem->gmem restore operation.. eventually it would |