00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef PIPE_CONTEXT_H
00029 #define PIPE_CONTEXT_H
00030
00031 #include "p_state.h"
00032
00033
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037
00038
00039 struct pipe_screen;
00040 struct pipe_fence_handle;
00041 struct pipe_state_cache;
00042 struct pipe_query;
00043
00044
00051 struct pipe_context {
00052 struct pipe_winsys *winsys;
00053 struct pipe_screen *screen;
00054
00055 void *priv;
00056 void *draw;
00058 void (*destroy)( struct pipe_context * );
00059
00060
00061
00062
00063
00064 void (*set_edgeflags)( struct pipe_context *,
00065 const unsigned *bitfield );
00066
00067
00072 boolean (*draw_arrays)( struct pipe_context *pipe,
00073 unsigned mode, unsigned start, unsigned count);
00074
00075 boolean (*draw_elements)( struct pipe_context *pipe,
00076 struct pipe_buffer *indexBuffer,
00077 unsigned indexSize,
00078 unsigned mode, unsigned start, unsigned count);
00079
00080
00081
00082
00083
00084
00085 boolean (*draw_range_elements)( struct pipe_context *pipe,
00086 struct pipe_buffer *indexBuffer,
00087 unsigned indexSize,
00088 unsigned minIndex,
00089 unsigned maxIndex,
00090 unsigned mode,
00091 unsigned start,
00092 unsigned count);
00100 struct pipe_query *(*create_query)( struct pipe_context *pipe,
00101 unsigned query_type );
00102
00103 void (*destroy_query)(struct pipe_context *pipe,
00104 struct pipe_query *q);
00105
00106 void (*begin_query)(struct pipe_context *pipe, struct pipe_query *q);
00107 void (*end_query)(struct pipe_context *pipe, struct pipe_query *q);
00108
00109 boolean (*get_query_result)(struct pipe_context *pipe,
00110 struct pipe_query *q,
00111 boolean wait,
00112 uint64 *result);
00119 void * (*create_blend_state)(struct pipe_context *,
00120 const struct pipe_blend_state *);
00121 void (*bind_blend_state)(struct pipe_context *, void *);
00122 void (*delete_blend_state)(struct pipe_context *, void *);
00123
00124 void * (*create_sampler_state)(struct pipe_context *,
00125 const struct pipe_sampler_state *);
00126 void (*bind_sampler_states)(struct pipe_context *, unsigned num, void **);
00127 void (*delete_sampler_state)(struct pipe_context *, void *);
00128
00129 void * (*create_rasterizer_state)(struct pipe_context *,
00130 const struct pipe_rasterizer_state *);
00131 void (*bind_rasterizer_state)(struct pipe_context *, void *);
00132 void (*delete_rasterizer_state)(struct pipe_context *, void *);
00133
00134 void * (*create_depth_stencil_alpha_state)(struct pipe_context *,
00135 const struct pipe_depth_stencil_alpha_state *);
00136 void (*bind_depth_stencil_alpha_state)(struct pipe_context *, void *);
00137 void (*delete_depth_stencil_alpha_state)(struct pipe_context *, void *);
00138
00139 void * (*create_fs_state)(struct pipe_context *,
00140 const struct pipe_shader_state *);
00141 void (*bind_fs_state)(struct pipe_context *, void *);
00142 void (*delete_fs_state)(struct pipe_context *, void *);
00143
00144 void * (*create_vs_state)(struct pipe_context *,
00145 const struct pipe_shader_state *);
00146 void (*bind_vs_state)(struct pipe_context *, void *);
00147 void (*delete_vs_state)(struct pipe_context *, void *);
00154 void (*set_blend_color)( struct pipe_context *,
00155 const struct pipe_blend_color * );
00156
00157 void (*set_clip_state)( struct pipe_context *,
00158 const struct pipe_clip_state * );
00159
00160 void (*set_constant_buffer)( struct pipe_context *,
00161 uint shader, uint index,
00162 const struct pipe_constant_buffer *buf );
00163
00164 void (*set_framebuffer_state)( struct pipe_context *,
00165 const struct pipe_framebuffer_state * );
00166
00167 void (*set_polygon_stipple)( struct pipe_context *,
00168 const struct pipe_poly_stipple * );
00169
00170 void (*set_scissor_state)( struct pipe_context *,
00171 const struct pipe_scissor_state * );
00172
00173 void (*set_viewport_state)( struct pipe_context *,
00174 const struct pipe_viewport_state * );
00175
00176 void (*set_sampler_textures)( struct pipe_context *,
00177 unsigned num_textures,
00178 struct pipe_texture ** );
00179
00180 void (*set_vertex_buffers)( struct pipe_context *,
00181 unsigned num_buffers,
00182 const struct pipe_vertex_buffer * );
00183
00184 void (*set_vertex_elements)( struct pipe_context *,
00185 unsigned num_elements,
00186 const struct pipe_vertex_element * );
00194 void (*surface_copy)(struct pipe_context *pipe,
00195 boolean do_flip,
00196 struct pipe_surface *dest,
00197 unsigned destx, unsigned desty,
00198 struct pipe_surface *src,
00199
00200 unsigned srcx, unsigned srcy,
00201 unsigned width, unsigned height);
00202
00203 void (*surface_fill)(struct pipe_context *pipe,
00204 struct pipe_surface *dst,
00205 unsigned dstx, unsigned dsty,
00206 unsigned width, unsigned height,
00207 unsigned value);
00208
00209 void (*clear)(struct pipe_context *pipe,
00210 struct pipe_surface *ps,
00211 unsigned clearValue);
00216 void (*flush)( struct pipe_context *pipe,
00217 unsigned flags,
00218 struct pipe_fence_handle **fence );
00219 };
00220
00221
00222 #ifdef __cplusplus
00223 }
00224 #endif
00225
00226 #endif