X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_context.h;h=81d5480431aa27137ce4bab5302441a7c920c287;hb=6e3730452152ca74ad3b51bf1dd4b69b20dbc019;hp=0e00dd4fab65f58c2ab9ac4c9293bcfe6a204db4;hpb=8199d149edd21d74ff70bed652e50d176136aab6;p=mesa.git diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 0e00dd4fab6..81d5480431a 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -33,6 +33,12 @@ #include "state_tracker/st_api.h" #include "main/fbobject.h" + +#ifdef __cplusplus +extern "C" { +#endif + + struct bitmap_cache; struct dd_function_table; struct draw_context; @@ -47,16 +53,19 @@ struct u_upload_mgr; #define ST_NEW_FRAGMENT_PROGRAM (1 << 1) #define ST_NEW_VERTEX_PROGRAM (1 << 2) #define ST_NEW_FRAMEBUFFER (1 << 3) -/* gap, re-use it */ +#define ST_NEW_TESS_STATE (1 << 4) #define ST_NEW_GEOMETRY_PROGRAM (1 << 5) #define ST_NEW_VERTEX_ARRAYS (1 << 6) #define ST_NEW_RASTERIZER (1 << 7) #define ST_NEW_UNIFORM_BUFFER (1 << 8) +#define ST_NEW_TESSCTRL_PROGRAM (1 << 9) +#define ST_NEW_TESSEVAL_PROGRAM (1 << 10) +#define ST_NEW_SAMPLER_VIEWS (1 << 11) struct st_state_flags { GLuint mesa; - GLuint st; + uint64_t st; }; struct st_tracked_state { @@ -86,6 +95,8 @@ struct st_context boolean has_stencil_export; /**< can do shader stencil export? */ boolean has_time_elapsed; boolean has_shader_model3; + boolean has_etc1; + boolean has_etc2; boolean prefer_blit_based_texture_transfer; boolean needs_texcoord_semantic; @@ -129,7 +140,6 @@ struct st_context struct st_state_flags dirty; - GLboolean missing_textures; GLboolean vertdata_edgeflags; GLboolean edgeflag_culls_prims; @@ -139,10 +149,14 @@ struct st_context struct st_vertex_program *vp; /**< Currently bound vertex program */ struct st_fragment_program *fp; /**< Currently bound fragment program */ struct st_geometry_program *gp; /**< Currently bound geometry program */ + struct st_tessctrl_program *tcp; /**< Currently bound tess control program */ + struct st_tesseval_program *tep; /**< Currently bound tess eval program */ struct st_vp_variant *vp_variant; struct st_fp_variant *fp_variant; struct st_gp_variant *gp_variant; + struct st_tcp_variant *tcp_variant; + struct st_tep_variant *tep_variant; struct gl_texture_object *default_texture; @@ -180,6 +194,7 @@ struct st_context void *vs; void *fs; void *vs_layered; + void *gs_layered; } clear; /** used for anything using util_draw_vertex_buffer */ @@ -188,7 +203,6 @@ struct st_context void *passthrough_fs; /**< simple pass-through frag shader */ enum pipe_texture_target internal_target; - struct gen_mipmap_state *gen_mipmap; struct cso_context *cso_context; @@ -206,7 +220,7 @@ struct st_context /* Need this so that we can implement Mesa callbacks in this module. */ -static INLINE struct st_context *st_context(struct gl_context *ctx) +static inline struct st_context *st_context(struct gl_context *ctx) { return ctx->st; } @@ -229,7 +243,8 @@ struct st_framebuffer }; -extern void st_init_driver_functions(struct dd_function_table *functions); +extern void st_init_driver_functions(struct pipe_screen *screen, + struct dd_function_table *functions); void st_invalidate_state(struct gl_context * ctx, GLuint new_state); @@ -238,7 +253,7 @@ void st_invalidate_state(struct gl_context * ctx, GLuint new_state); #define Y_0_TOP 1 #define Y_0_BOTTOM 2 -static INLINE GLuint +static inline GLuint st_fb_orientation(const struct gl_framebuffer *fb) { if (fb && _mesa_is_winsys_fbo(fb)) { @@ -263,6 +278,29 @@ st_fb_orientation(const struct gl_framebuffer *fb) } +static inline unsigned +st_shader_stage_to_ptarget(gl_shader_stage stage) +{ + switch (stage) { + case MESA_SHADER_VERTEX: + return PIPE_SHADER_VERTEX; + case MESA_SHADER_FRAGMENT: + return PIPE_SHADER_FRAGMENT; + case MESA_SHADER_GEOMETRY: + return PIPE_SHADER_GEOMETRY; + case MESA_SHADER_TESS_CTRL: + return PIPE_SHADER_TESS_CTRL; + case MESA_SHADER_TESS_EVAL: + return PIPE_SHADER_TESS_EVAL; + case MESA_SHADER_COMPUTE: + return PIPE_SHADER_COMPUTE; + } + + assert(!"should not be reached"); + return PIPE_SHADER_VERTEX; +} + + /** clear-alloc a struct-sized object, with casting */ #define ST_CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T)) @@ -277,4 +315,8 @@ extern void st_destroy_context(struct st_context *st); +#ifdef __cplusplus +} +#endif + #endif