X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Finclude%2Fpipe%2Fp_context.h;h=9d19ec2f7fe029217fa66c306c9c434799bb0eb7;hb=70c8d2a29724d018bacc4a68ddc61db08faea00d;hp=166c6b6b7e0b6f0f47ecbf7af0534c19501e05e2;hpb=4df482086ebf0663c708b089d8d8d22de0ef972c;p=mesa.git diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 166c6b6b7e0..9d19ec2f7fe 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -40,7 +40,7 @@ struct pipe_screen; struct pipe_fence_handle; struct pipe_state_cache; struct pipe_query; - +struct pipe_winsys; /** * Gallium rendering context. Basically: @@ -57,14 +57,6 @@ struct pipe_context { void (*destroy)( struct pipe_context * ); - - /* Possible interface for setting edgeflags. These aren't really - * vertex elements, so don't fit there. - */ - void (*set_edgeflags)( struct pipe_context *, - const unsigned *bitfield ); - - /** * VBO drawing (return false on fallbacks (temporary??)) */ @@ -98,7 +90,7 @@ struct pipe_context { */ /*@{*/ struct pipe_query *(*create_query)( struct pipe_context *pipe, - unsigned query_type ); + unsigned query_type ); void (*destroy_query)(struct pipe_context *pipe, struct pipe_query *q); @@ -123,7 +115,12 @@ struct pipe_context { void * (*create_sampler_state)(struct pipe_context *, const struct pipe_sampler_state *); - void (*bind_sampler_states)(struct pipe_context *, unsigned num, void **); + void (*bind_fragment_sampler_states)(struct pipe_context *, + unsigned num_samplers, + void **samplers); + void (*bind_vertex_sampler_states)(struct pipe_context *, + unsigned num_samplers, + void **samplers); void (*delete_sampler_state)(struct pipe_context *, void *); void * (*create_rasterizer_state)(struct pipe_context *, @@ -159,7 +156,7 @@ struct pipe_context { void (*set_constant_buffer)( struct pipe_context *, uint shader, uint index, - const struct pipe_constant_buffer *buf ); + struct pipe_buffer *buf ); void (*set_framebuffer_state)( struct pipe_context *, const struct pipe_framebuffer_state * ); @@ -173,9 +170,13 @@ struct pipe_context { void (*set_viewport_state)( struct pipe_context *, const struct pipe_viewport_state * ); - void (*set_sampler_textures)( struct pipe_context *, - unsigned num_textures, - struct pipe_texture ** ); + void (*set_fragment_sampler_textures)(struct pipe_context *, + unsigned num_textures, + struct pipe_texture **); + + void (*set_vertex_sampler_textures)(struct pipe_context *, + unsigned num_textures, + struct pipe_texture **); void (*set_vertex_buffers)( struct pipe_context *, unsigned num_buffers, @@ -189,33 +190,81 @@ struct pipe_context { /** * Surface functions + * + * The pipe driver is allowed to set these functions to NULL, and in that + * case, they will not be available. */ /*@{*/ + + /** + * Copy a block of pixels from one surface to another. + * The surfaces must be of the same format. + */ void (*surface_copy)(struct pipe_context *pipe, - boolean do_flip,/**< flip surface contents vertically */ struct pipe_surface *dest, unsigned destx, unsigned desty, - struct pipe_surface *src, /* don't make this const - - need to map/unmap */ + struct pipe_surface *src, unsigned srcx, unsigned srcy, unsigned width, unsigned height); + /** + * Fill a region of a surface with a constant value. + */ void (*surface_fill)(struct pipe_context *pipe, struct pipe_surface *dst, unsigned dstx, unsigned dsty, unsigned width, unsigned height, unsigned value); - - void (*clear)(struct pipe_context *pipe, - struct pipe_surface *ps, - unsigned clearValue); /*@}*/ - - /** Flush rendering (flags = bitmask of PIPE_FLUSH_x tokens) */ + /** + * Clear the specified set of currently bound buffers to specified values. + * The entire buffers are cleared (no scissor, no colormask, etc). + * + * \param buffers bitfield of PIPE_CLEAR_* values. + * \param rgba pointer to an array of one float for each of r, g, b, a. + * \param depth depth clear value in [0,1]. + * \param stencil stencil clear value + */ + void (*clear)(struct pipe_context *pipe, + unsigned buffers, + const float *rgba, + double depth, + unsigned stencil); + + /** Flush rendering + * \param flags bitmask of PIPE_FLUSH_x tokens) + */ void (*flush)( struct pipe_context *pipe, unsigned flags, struct pipe_fence_handle **fence ); + + /** + * Check whether a texture is referenced by an unflushed hw command. + * The state-tracker uses this function to optimize away unnecessary + * flushes. It is safe (but wasteful) to always return. + * PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE. + * \param pipe The pipe context whose unflushed hw commands will be + * checked. + * \param level mipmap level. + * \param texture texture to check. + * \param face cubemap face. Use 0 for non-cubemap texture. + */ + unsigned int (*is_texture_referenced) (struct pipe_context *pipe, + struct pipe_texture *texture, + unsigned face, unsigned level); + + /** + * Check whether a buffer is referenced by an unflushed hw command. + * The state-tracker uses this function to optimize away unnecessary + * flushes. It is safe (but wasteful) to always return + * PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE. + * \param pipe The pipe context whose unflushed hw commands will be + * checked. + * \param buf Buffer to check. + */ + unsigned int (*is_buffer_referenced) (struct pipe_context *pipe, + struct pipe_buffer *buf); };