#ifndef ST_DEVICE_H_
#define ST_DEVICE_H_
#include "pipe/p_state.h"
struct cso_context;
struct pipe_screen;
struct pipe_context;
struct st_winsys;
struct st_surface
{
struct pipe_texture *texture;
unsigned face;
unsigned level;
unsigned zslice;
};
struct st_context {
struct st_device *st_dev;
struct pipe_context *pipe;
struct cso_context *cso;
void *vs;
void *fs;
void *gs;
struct pipe_texture *default_texture;
struct pipe_texture *fragment_sampler_textures[PIPE_MAX_SAMPLERS];
struct pipe_texture *vertex_sampler_textures[PIPE_MAX_VERTEX_SAMPLERS];
unsigned num_vertex_buffers;
struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS];
unsigned num_vertex_elements;
struct pipe_vertex_element vertex_elements[PIPE_MAX_ATTRIBS];
struct pipe_framebuffer_state framebuffer;
};
struct st_device {
struct pipe_reference reference;
const struct st_winsys *st_ws;
struct pipe_screen *real_screen;
struct pipe_screen *screen;
};
static INLINE struct pipe_surface *
st_pipe_surface(struct st_surface *surface, unsigned usage)
{
struct pipe_texture *texture = surface->texture;
struct pipe_screen *screen = texture->screen;
return screen->get_tex_surface(screen, texture, surface->face, surface->level, surface->zslice, usage);
}
struct st_context *
st_context_create(struct st_device *st_dev);
void
st_context_destroy(struct st_context *st_ctx);
struct st_device *
st_device_create(boolean hardware);
void
st_device_destroy(struct st_device *st_dev);
#endif