summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_context.h
diff options
context:
space:
mode:
authorJerome Glisse <glisse@freedesktop.org>2010-05-08 21:09:24 +0100
committerJerome Glisse <jglisse@redhat.com>2010-05-27 23:23:56 +0200
commit72128962d640846472c1b0dc22cf4ac6ce875dc9 (patch)
treea90f4a2d425d215ad24b256c5918acbc6859cfe1 /src/gallium/drivers/r600/r600_context.h
parent3d41dd7934e6d2527424a1288d28128c20d9c5ce (diff)
r600g: Initial import
Diffstat (limited to 'src/gallium/drivers/r600/r600_context.h')
-rw-r--r--src/gallium/drivers/r600/r600_context.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_context.h b/src/gallium/drivers/r600/r600_context.h
new file mode 100644
index 0000000000..4646df3b56
--- /dev/null
+++ b/src/gallium/drivers/r600/r600_context.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#ifndef R600_CONTEXT_H
+#define R600_CONTEXT_H
+
+#include <pipe/p_state.h>
+#include <pipe/p_context.h>
+#include <tgsi/tgsi_scan.h>
+#include <tgsi/tgsi_parse.h>
+#include <tgsi/tgsi_util.h>
+#include <util/u_blitter.h>
+#include "radeon.h"
+#include "r600_shader.h"
+
+struct r600_state;
+typedef void (*r600_state_destroy_t)(struct r600_state *rstate);
+
+struct r600_state {
+ unsigned type;
+ struct r600_atom *atom;
+ void *state;
+ unsigned nbuffers;
+ struct pipe_buffer *buffer[256];
+ unsigned nsurfaces;
+ struct pipe_surface *surface[256];
+ r600_state_destroy_t destroy;
+};
+
+struct r600_pipe_shader {
+ unsigned type;
+ struct r600_shader shader;
+ struct radeon_bo *bo;
+ struct radeon_state *state;
+};
+
+struct r600_context {
+ struct pipe_context context;
+ struct radeon_ctx *ctx;
+ struct radeon_state *cb_cntl;
+ struct radeon_state *db;
+ struct radeon_state *config;
+ struct r600_pipe_shader *ps_shader;
+ struct r600_pipe_shader *vs_shader;
+ unsigned flat_shade;
+ unsigned nvertex_buffer;
+ unsigned nvertex_element;
+ struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
+ struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
+ struct blitter_context *blitter;
+ struct pipe_stencil_ref stencil_ref;
+ struct pipe_framebuffer_state fb_state;
+ struct radeon_draw *draw;
+};
+
+void r600_draw_arrays(struct pipe_context *ctx, unsigned mode,
+ unsigned start, unsigned count);
+void r600_draw_elements(struct pipe_context *ctx,
+ struct pipe_buffer *index_buffer,
+ unsigned index_size, unsigned mode,
+ unsigned start, unsigned count);
+void r600_draw_range_elements(struct pipe_context *ctx,
+ struct pipe_buffer *index_buffer,
+ unsigned indexSize, unsigned minIndex,
+ unsigned maxIndex, unsigned mode,
+ unsigned start, unsigned count);
+
+void r600_state_destroy_common(struct r600_state *state);
+struct r600_state *r600_state_new(r600_state_destroy_t destroy);
+struct r600_state *r600_state_destroy(struct r600_state *state);
+
+void r600_init_state_functions(struct r600_context *rctx);
+void r600_init_query_functions(struct r600_context* rctx);
+struct pipe_context *r600_create_context(struct pipe_screen *screen, void *priv);
+
+void r600_pipe_shader_destroy(struct pipe_context *ctx, struct r600_pipe_shader *rpshader);
+struct r600_pipe_shader *r600_pipe_shader_create(struct pipe_context *ctx,
+ unsigned type,
+ const struct tgsi_token *tokens);
+int r600_pipe_shader_update(struct pipe_context *ctx, struct r600_pipe_shader *rpshader);
+
+#endif