Merge branch '7.8'
[mesa.git] / src / gallium / state_trackers / python / st_device.h
index d1bd8c31f4ff932fbc1de393f707f351f0c9b6ce..2dca7a1974e38270061413059edffee389c9e098 100644 (file)
@@ -38,39 +38,58 @@ struct pipe_context;
 struct st_winsys; 
 
 
-struct st_context {
+struct st_surface
+{
+   struct pipe_resource *texture;
+   unsigned face;
+   unsigned level;
+   unsigned zslice;
+};
+
+
+struct st_context
+{
    struct st_device *st_dev;
    
-   struct pipe_context *real_pipe;
    struct pipe_context *pipe;
    
    struct cso_context *cso;
    
    void *vs;
    void *fs;
+   void *gs;
 
-   struct pipe_texture *default_texture;
-   struct pipe_texture *sampler_textures[PIPE_MAX_SAMPLERS];
+   struct pipe_resource *default_texture;
+   struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
+   struct pipe_sampler_view *vertex_sampler_views[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 st_device
+{
    /* FIXME: we also need to refcount for textures and surfaces... */
    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_resource *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);