summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-08-06 16:43:28 -0700
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-08-09 11:53:21 -0700
commit5ff797356010933a92b0b2651db72eac9866704c (patch)
tree143cbc0e0d28954b7e32618b72291886805e3b86
parentc82672c9c146f215314a40afb696164bad080746 (diff)
downloadmesa-5ff797356010933a92b0b2651db72eac9866704c.tar.gz
panfrost: Import streamout data structures
Pretty much copypasted from v3d to jumpstart us. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c18
-rw-r--r--src/gallium/drivers/panfrost/pan_context.h7
2 files changed, 24 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 2fc5ac36197..26df0caa706 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1,5 +1,6 @@
/*
* © Copyright 2018 Alyssa Rosenzweig
+ * Copyright © 2014-2017 Broadcom
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -2670,7 +2671,22 @@ panfrost_set_stream_output_targets(struct pipe_context *pctx,
struct pipe_stream_output_target **targets,
const unsigned *offsets)
{
- /* STUB */
+ struct panfrost_context *ctx = pan_context(pctx);
+ struct panfrost_streamout *so = &ctx->streamout;
+
+ assert(num_targets <= ARRAY_SIZE(so->targets));
+
+ for (unsigned i = 0; i < num_targets; i++) {
+ if (offsets[i] != -1)
+ so->offsets[i] = offsets[i];
+
+ pipe_so_target_reference(&so->targets[i], targets[i]);
+ }
+
+ for (unsigned i = 0; i < so->num_targets; i++)
+ pipe_so_target_reference(&so->targets[i], NULL);
+
+ so->num_targets = num_targets;
}
static void
diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
index 9a34e243b74..4e32a691200 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -88,6 +88,12 @@ struct panfrost_fence {
int fd;
};
+struct panfrost_streamout {
+ struct pipe_stream_output_target *targets[PIPE_MAX_SO_BUFFERS];
+ uint32_t offsets[PIPE_MAX_SO_BUFFERS];
+ unsigned num_targets;
+};
+
struct panfrost_context {
/* Gallium context */
struct pipe_context base;
@@ -106,6 +112,7 @@ struct panfrost_context {
unsigned draw_modes;
struct pipe_framebuffer_state pipe_framebuffer;
+ struct panfrost_streamout streamout;
struct panfrost_memory cmdstream_persistent;
struct panfrost_memory scratchpad;