summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2018-05-14 09:08:43 -0400
committerRob Clark <[email protected]>2018-05-15 08:47:35 -0400
commitdae4c98dd7669acbc5488d50751cde6cefc6883e (patch)
treefd20ffe717498d5ca6a1a6406461dc5807fdc184
parentf897b67dc1299a4607478fc3792c66f78b6ca8b6 (diff)
vc4: use util_copy_framebuffer_state
Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/gallium/drivers/vc4/vc4_state.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/gallium/drivers/vc4/vc4_state.c b/src/gallium/drivers/vc4/vc4_state.c
index f8c37818499..408a9e0af2a 100644
--- a/src/gallium/drivers/vc4/vc4_state.c
+++ b/src/gallium/drivers/vc4/vc4_state.c
@@ -23,6 +23,7 @@
*/
#include "pipe/p_state.h"
+#include "util/u_framebuffer.h"
#include "util/u_inlines.h"
#include "util/u_math.h"
#include "util/u_memory.h"
@@ -414,21 +415,10 @@ vc4_set_framebuffer_state(struct pipe_context *pctx,
{
struct vc4_context *vc4 = vc4_context(pctx);
struct pipe_framebuffer_state *cso = &vc4->framebuffer;
- unsigned i;
vc4->job = NULL;
- for (i = 0; i < framebuffer->nr_cbufs; i++)
- pipe_surface_reference(&cso->cbufs[i], framebuffer->cbufs[i]);
- for (; i < vc4->framebuffer.nr_cbufs; i++)
- pipe_surface_reference(&cso->cbufs[i], NULL);
-
- cso->nr_cbufs = framebuffer->nr_cbufs;
-
- pipe_surface_reference(&cso->zsbuf, framebuffer->zsbuf);
-
- cso->width = framebuffer->width;
- cso->height = framebuffer->height;
+ util_copy_framebuffer_state(cso, framebuffer);
/* Nonzero texture mipmap levels are laid out as if they were in
* power-of-two-sized spaces. The renderbuffer config infers its