/*
* © 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"),
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
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;
unsigned draw_modes;
struct pipe_framebuffer_state pipe_framebuffer;
+ struct panfrost_streamout streamout;
struct panfrost_memory cmdstream_persistent;
struct panfrost_memory scratchpad;