-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
/*
* Copyright (C) 2013 Rob Clark <robclark@freedesktop.org>
*
#include "fd2_emit.h"
#include "fd2_gmem.h"
#include "fd2_program.h"
+#include "fd2_query.h"
#include "fd2_rasterizer.h"
#include "fd2_texture.h"
#include "fd2_zsa.h"
fd2_context_destroy(struct pipe_context *pctx)
{
fd_context_destroy(pctx);
+ free(pctx);
}
static struct pipe_resource *
create_solid_vertexbuf(struct pipe_context *pctx)
{
static const float init_shader_const[] = {
- /* for clear/gmem2mem: */
- -1.000000, +1.000000, +1.000000, +1.100000,
- +1.000000, +1.000000, -1.000000, -1.100000,
- +1.000000, +1.100000, -1.100000, +1.000000,
- /* for mem2gmem: (vertices) */
- -1.000000, +1.000000, +1.000000, +1.000000,
- +1.000000, +1.000000, -1.000000, -1.000000,
- +1.000000, +1.000000, -1.000000, +1.000000,
+ /* for clear/gmem2mem/mem2gmem (vertices): */
+ -1.000000, +1.000000, +1.000000,
+ +1.000000, +1.000000, +1.000000,
+ -1.000000, -1.000000, +1.000000,
/* for mem2gmem: (tex coords) */
- +0.000000, +0.000000, +1.000000, +0.000000,
- +0.000000, +1.000000, +1.000000, +1.000000,
+ +0.000000, +0.000000,
+ +1.000000, +0.000000,
+ +0.000000, +1.000000,
+ /* SCREEN_SCISSOR_BR value (must be at 60 byte offset in page) */
+ 0.0,
+ /* zero indices dummy draw workaround (3 16-bit zeros) */
+ 0.0, 0.0,
};
struct pipe_resource *prsc = pipe_buffer_create(pctx->screen,
PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE, sizeof(init_shader_const));
return NULL;
pctx = &fd2_ctx->base.base;
+ pctx->screen = pscreen;
fd2_ctx->base.dev = fd_device_ref(screen->dev);
fd2_ctx->base.screen = fd_screen(pscreen);
pctx = fd_context_init(&fd2_ctx->base, pscreen,
(screen->gpu_id >= 220) ? a22x_primtypes : a20x_primtypes,
- priv);
+ priv, flags);
if (!pctx)
return NULL;
/* construct vertex state used for solid ops (clear, and gmem<->mem) */
fd2_ctx->solid_vertexbuf = create_solid_vertexbuf(pctx);
+ fd2_query_context_init(pctx);
+
return pctx;
}