1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**************************************************************************
3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * All Rights Reserved.
6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person obtaining a
8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * copy of this software and associated documentation files (the
9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * "Software"), to deal in the Software without restriction, including
10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * without limitation the rights to use, copy, modify, merge, publish,
11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * distribute, sub license, and/or sell copies of the Software, and to
12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * permit persons to whom the Software is furnished to do so, subject to
13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * the following conditions:
14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice (including the
16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * next paragraph) shall be included in all copies or substantial portions
17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * of the Software.
18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org **************************************************************************/
28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**
30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * \brief  Public interface into the drawing module.
31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Authors:  Keith Whitwell <keith@tungstengraphics.com>
34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef DRAW_CONTEXT_H
38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DRAW_CONTEXT_H
39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_state.h"
42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "tgsi/tgsi_exec.h"
43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct pipe_context;
45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_context;
46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_stage;
47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_vertex_shader;
48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_geometry_shader;
49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_fragment_shader;
50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct tgsi_sampler;
51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * structure to contain driver internal information
54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * for stream out support. mapping stores the pointer
55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * to the buffer contents, and internal offset stores
56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * stores an internal counter to how much of the stream
57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * out buffer is used (in bytes).
58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_so_target {
60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct pipe_stream_output_target target;
61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   void *mapping;
62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   int internal_offset;
63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_context *draw_create( struct pipe_context *pipe );
66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_context *draw_create_no_llvm(struct pipe_context *pipe);
68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_destroy( struct draw_context *draw );
70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_flush(struct draw_context *draw);
72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_viewport_state( struct draw_context *draw,
74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                              const struct pipe_viewport_state *viewport );
75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_clip_state( struct draw_context *pipe,
77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                          const struct pipe_clip_state *clip );
78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**
80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Sets the rasterization state used by the draw module.
81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The rast_handle is used to pass the driver specific representation
82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * of the rasterization state. It's going to be used when the
83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * draw module sets the state back on the driver itself using the
84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * pipe::bind_rasterizer_state method.
85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * NOTE: if you're calling this function from within the pipe's
87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * bind_rasterizer_state you should always call it before binding
88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * the actual state - that's because the draw module can try to
89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * bind its own rasterizer state which would reset your newly
90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * set state. i.e. always do
91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * draw_set_rasterizer_state(driver->draw, state->pipe_state, state);
92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * driver->state.raster = state;
93f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
94f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_rasterizer_state( struct draw_context *draw,
95f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                const struct pipe_rasterizer_state *raster,
96f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                void *rast_handle );
97f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
98f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_rasterize_stage( struct draw_context *draw,
99f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                               struct draw_stage *stage );
100f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
101f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_wide_point_threshold(struct draw_context *draw, float threshold);
102f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
103f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_wide_point_sprites(struct draw_context *draw, boolean draw_sprite);
104f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
105f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_wide_line_threshold(struct draw_context *draw, float threshold);
106f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
107f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_enable_line_stipple(struct draw_context *draw, boolean enable);
108f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
109f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_enable_point_sprites(struct draw_context *draw, boolean enable);
110f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
111f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_mrd(struct draw_context *draw, double mrd);
112f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
113f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgboolean
114f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_install_aaline_stage(struct draw_context *draw, struct pipe_context *pipe);
115f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
116f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgboolean
117f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_install_aapoint_stage(struct draw_context *draw, struct pipe_context *pipe);
118f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
119f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgboolean
120f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_install_pstipple_stage(struct draw_context *draw, struct pipe_context *pipe);
121f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
122f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
123f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct tgsi_shader_info *
124f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_get_shader_info(const struct draw_context *draw);
125f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
126f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgint
127f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_find_shader_output(const struct draw_context *draw,
128f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                        uint semantic_name, uint semantic_index);
129f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
130f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orguint
131f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_num_shader_outputs(const struct draw_context *draw);
132f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
133f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
134f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
135f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_texture_samplers(struct draw_context *draw,
136f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                      uint shader_type,
137f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                      uint num_samplers,
138f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                      struct tgsi_sampler **samplers);
139f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
140f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
141f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_set_sampler_views(struct draw_context *draw,
142f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                       unsigned shader_stage,
143f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                       struct pipe_sampler_view **views,
144f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                       unsigned num);
145f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
146f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_set_samplers(struct draw_context *draw,
147f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                  unsigned shader_stage,
148f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                  struct pipe_sampler_state **samplers,
149f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                  unsigned num);
150f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
151f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
152f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_set_mapped_texture(struct draw_context *draw,
153f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                        unsigned shader_stage,
154f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                        unsigned sampler_idx,
155f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                        uint32_t width, uint32_t height, uint32_t depth,
156f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                        uint32_t first_level, uint32_t last_level,
157f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                        uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS],
158f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                        uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS],
159f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                        const void *data[PIPE_MAX_TEXTURE_LEVELS]);
160f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
161f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
162f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
163f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Vertex shader functions
164f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
165f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
166f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_vertex_shader *
167f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_create_vertex_shader(struct draw_context *draw,
168f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                          const struct pipe_shader_state *shader);
169f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_bind_vertex_shader(struct draw_context *draw,
170f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                             struct draw_vertex_shader *dvs);
171f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_delete_vertex_shader(struct draw_context *draw,
172f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                               struct draw_vertex_shader *dvs);
173f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
174f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
175f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
176f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Fragment shader functions
177f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
178f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_fragment_shader *
179f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_create_fragment_shader(struct draw_context *draw,
180f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            const struct pipe_shader_state *shader);
181f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_bind_fragment_shader(struct draw_context *draw,
182f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                               struct draw_fragment_shader *dvs);
183f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_delete_fragment_shader(struct draw_context *draw,
184f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 struct draw_fragment_shader *dvs);
185f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
186f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
187f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Geometry shader functions
188f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
189f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct draw_geometry_shader *
190f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_create_geometry_shader(struct draw_context *draw,
191f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                            const struct pipe_shader_state *shader);
192f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_bind_geometry_shader(struct draw_context *draw,
193f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                               struct draw_geometry_shader *dvs);
194f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_delete_geometry_shader(struct draw_context *draw,
195f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 struct draw_geometry_shader *dvs);
196f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
197f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
198f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
199f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Vertex data functions
200f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
201f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
202f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_vertex_buffers(struct draw_context *draw,
203f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                             unsigned count,
204f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                             const struct pipe_vertex_buffer *buffers);
205f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
206f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_vertex_elements(struct draw_context *draw,
207f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org			      unsigned count,
208f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                              const struct pipe_vertex_element *elements);
209f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
210f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_indexes(struct draw_context *draw,
211f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                      const void *elements, unsigned elem_size);
212f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
213f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_mapped_vertex_buffer(struct draw_context *draw,
214f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                   unsigned attr, const void *buffer);
215f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
216f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
217f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_set_mapped_constant_buffer(struct draw_context *draw,
218f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                unsigned shader_type,
219f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                unsigned slot,
220f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                const void *buffer,
221f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                unsigned size);
222f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
223f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
224f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_set_mapped_so_buffers(struct draw_context *draw,
225f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           void *buffers[PIPE_MAX_SO_BUFFERS],
226f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           unsigned num_buffers);
227f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
228f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
229f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_set_mapped_so_targets(struct draw_context *draw,
230f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           int num_targets,
231f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           struct draw_so_target *targets[PIPE_MAX_SO_BUFFERS]);
232f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
233f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
234f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_set_so_state(struct draw_context *draw,
235f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                  struct pipe_stream_output_info *state);
236f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
237f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
238f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/***********************************************************************
239f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * draw_pt.c
240f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
241f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
242f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_vbo(struct draw_context *draw,
243f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org              const struct pipe_draw_info *info);
244f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
245f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_arrays(struct draw_context *draw, unsigned prim,
246f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org		 unsigned start, unsigned count);
247f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
248f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
249f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_arrays_instanced(struct draw_context *draw,
250f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                      unsigned mode,
251f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                      unsigned start,
252f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                      unsigned count,
253f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                      unsigned startInstance,
254f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                      unsigned instanceCount);
255f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
256f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
257f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*******************************************************************************
258f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Driver backend interface
259f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
260f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct vbuf_render;
261f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_render( struct draw_context *draw,
262f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org		      struct vbuf_render *render );
263f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
264f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_driver_clipping( struct draw_context *draw,
265f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                               boolean bypass_clip_xy,
266f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                               boolean bypass_clip_z,
267f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                               boolean guard_band_xy);
268f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
269f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid draw_set_force_passthrough( struct draw_context *draw,
270f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 boolean enable );
271f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
272f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*******************************************************************************
273f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Draw pipeline
274f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
275f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgboolean draw_need_pipeline(const struct draw_context *draw,
276f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           const struct pipe_rasterizer_state *rasterizer,
277f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           unsigned prim );
278f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
279f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgint
280f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_get_shader_param(unsigned shader, enum pipe_shader_cap param);
281f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
282f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgint
283f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdraw_get_shader_param_no_llvm(unsigned shader, enum pipe_shader_cap param);
284f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
285f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif /* DRAW_CONTEXT_H */
286