X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fstate_trackers%2Fpython%2Fst_device.h;h=dcd0dc6e2737beb57a3ae2aa04a0cc4fabfcfdd2;hb=dff50ff592da7cb1d784fae794dd1647a5445bca;hp=7cfe6de9f6a733ab9bc8c065e0ef3478fc5b1cd1;hpb=b0caa10a85b39f0e657dc0c4816884c9356b0b1a;p=mesa.git diff --git a/src/gallium/state_trackers/python/st_device.h b/src/gallium/state_trackers/python/st_device.h index 7cfe6de9f6a..dcd0dc6e273 100644 --- a/src/gallium/state_trackers/python/st_device.h +++ b/src/gallium/state_trackers/python/st_device.h @@ -38,52 +38,57 @@ struct pipe_context; struct st_winsys; -struct st_buffer { - struct st_device *st_dev; - - struct pipe_buffer *buffer; +struct st_surface +{ + struct pipe_texture *texture; + unsigned face; + unsigned level; + unsigned zslice; }; -struct st_context { +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_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 { - const struct st_winsys *st_ws; +struct st_device +{ + /* FIXME: we also need to refcount for textures and surfaces... */ + struct pipe_reference reference; - struct pipe_screen *real_screen; struct pipe_screen *screen; - - /* FIXME: we also need to refcount for textures and surfaces... */ - unsigned refcount; }; -struct st_buffer * -st_buffer_create(struct st_device *st_dev, - unsigned alignment, unsigned usage, unsigned size); - -void -st_buffer_destroy(struct st_buffer *st_buf); +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);