[Mesa-dev] [PATCH 2/5] freedreno: add support for user index buffers
Marek Olšák
maraeo at gmail.com
Fri Feb 17 12:36:44 UTC 2017
On Fri, Feb 17, 2017 at 11:27 AM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
> src/gallium/drivers/freedreno/freedreno_draw.c | 13 +++++++++++++
> src/gallium/drivers/freedreno/freedreno_screen.c | 2 +-
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c
> index cfe13cd..cb4c063 100644
> --- a/src/gallium/drivers/freedreno/freedreno_draw.c
> +++ b/src/gallium/drivers/freedreno/freedreno_draw.c
> @@ -24,20 +24,21 @@
> *
> * Authors:
> * Rob Clark <robclark at freedesktop.org>
> */
>
> #include "pipe/p_state.h"
> #include "util/u_string.h"
> #include "util/u_memory.h"
> #include "util/u_prim.h"
> #include "util/u_format.h"
> +#include "util/u_helpers.h"
>
> #include "freedreno_draw.h"
> #include "freedreno_context.h"
> #include "freedreno_state.h"
> #include "freedreno_resource.h"
> #include "freedreno_query_hw.h"
> #include "freedreno_util.h"
>
> static void
> resource_read(struct fd_batch *batch, struct pipe_resource *prsc)
> @@ -77,20 +78,29 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
> /* emulate unsupported primitives: */
> if (!fd_supported_prim(ctx, info->mode)) {
> if (ctx->streamout.num_targets > 0)
> debug_error("stream-out with emulated prims");
> util_primconvert_save_index_buffer(ctx->primconvert, &ctx->indexbuf);
> util_primconvert_save_rasterizer_state(ctx->primconvert, ctx->rasterizer);
> util_primconvert_draw_vbo(ctx->primconvert, info);
> return;
> }
>
> + /* Upload a user index buffer. */
> + struct pipe_index_buffer ibuffer_saved = {};
> + if (info->indexed && ctx->indexbuf.user_buffer &&
> + !util_save_and_upload_index_buffer(pctx, info,
> + &ctx->indexbuf.user_buffer,
This should be &ctx->indexbuf. Fixed locally.
Marek
More information about the mesa-dev
mailing list