summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_state.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-04-06 13:17:58 -0700
committerEric Anholt <eric@anholt.net>2016-09-14 06:08:03 +0100
commit9688166bd9c3e12c74c55b857ad0dbb62b28da9e (patch)
treef33d7d803d85fb86443a1f5669edf19d11ef8c90 /src/gallium/drivers/vc4/vc4_state.c
parentc31a7f529fadc016786eedc35ce65802a915ce09 (diff)
downloadexternal_mesa3d-9688166bd9c3e12c74c55b857ad0dbb62b28da9e.zip
external_mesa3d-9688166bd9c3e12c74c55b857ad0dbb62b28da9e.tar.gz
external_mesa3d-9688166bd9c3e12c74c55b857ad0dbb62b28da9e.tar.bz2
vc4: Move the render job state into a separate structure.
This is a preparation step for having multiple jobs being queued up at the same time.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_state.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_state.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/gallium/drivers/vc4/vc4_state.c b/src/gallium/drivers/vc4/vc4_state.c
index bf211b1..d697f7c 100644
--- a/src/gallium/drivers/vc4/vc4_state.c
+++ b/src/gallium/drivers/vc4/vc4_state.c
@@ -406,6 +406,7 @@ vc4_set_framebuffer_state(struct pipe_context *pctx,
const struct pipe_framebuffer_state *framebuffer)
{
struct vc4_context *vc4 = vc4_context(pctx);
+ struct vc4_job *job = vc4->job;
struct pipe_framebuffer_state *cso = &vc4->framebuffer;
unsigned i;
@@ -430,14 +431,14 @@ vc4_set_framebuffer_state(struct pipe_context *pctx,
struct vc4_resource *rsc =
vc4_resource(cso->cbufs[0]->texture);
if (!rsc->writes)
- vc4->cleared |= PIPE_CLEAR_COLOR0;
+ job->cleared |= PIPE_CLEAR_COLOR0;
}
if (cso->zsbuf) {
struct vc4_resource *rsc =
vc4_resource(cso->zsbuf->texture);
if (!rsc->writes)
- vc4->cleared |= PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL;
+ job->cleared |= PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL;
}
/* Nonzero texture mipmap levels are laid out as if they were in
@@ -460,21 +461,21 @@ vc4_set_framebuffer_state(struct pipe_context *pctx,
rsc->cpp);
}
- vc4->msaa = false;
+ job->msaa = false;
if (cso->cbufs[0])
- vc4->msaa = cso->cbufs[0]->texture->nr_samples > 1;
+ job->msaa = cso->cbufs[0]->texture->nr_samples > 1;
else if (cso->zsbuf)
- vc4->msaa = cso->zsbuf->texture->nr_samples > 1;
+ job->msaa = cso->zsbuf->texture->nr_samples > 1;
- if (vc4->msaa) {
- vc4->tile_width = 32;
- vc4->tile_height = 32;
+ if (job->msaa) {
+ job->tile_width = 32;
+ job->tile_height = 32;
} else {
- vc4->tile_width = 64;
- vc4->tile_height = 64;
+ job->tile_width = 64;
+ job->tile_height = 64;
}
- vc4->draw_tiles_x = DIV_ROUND_UP(cso->width, vc4->tile_width);
- vc4->draw_tiles_y = DIV_ROUND_UP(cso->height, vc4->tile_height);
+ job->draw_tiles_x = DIV_ROUND_UP(cso->width, job->tile_width);
+ job->draw_tiles_y = DIV_ROUND_UP(cso->height, job->tile_height);
vc4->dirty |= VC4_DIRTY_FRAMEBUFFER;
}