struct u_upload_mgr;
-#define ST_NEW_MESA (1 << 0) /* Mesa state has changed */
+/* gap */
#define ST_NEW_FRAGMENT_PROGRAM (1 << 1)
#define ST_NEW_VERTEX_PROGRAM (1 << 2)
#define ST_NEW_FRAMEBUFFER (1 << 3)
#define ST_NEW_TESSCTRL_PROGRAM (1 << 9)
#define ST_NEW_TESSEVAL_PROGRAM (1 << 10)
#define ST_NEW_SAMPLER_VIEWS (1 << 11)
+#define ST_NEW_ATOMIC_BUFFER (1 << 12)
+#define ST_NEW_STORAGE_BUFFER (1 << 13)
+#define ST_NEW_COMPUTE_PROGRAM (1 << 14)
+#define ST_NEW_IMAGE_UNITS (1 << 15)
struct st_state_flags {
- GLuint mesa;
- uint64_t st;
+ GLbitfield mesa; /**< Mask of _NEW_x flags */
+ uint64_t st; /**< Mask of ST_NEW_x flags */
};
struct st_tracked_state {
};
+/**
+ * Enumeration of state tracker pipelines.
+ */
+enum st_pipeline {
+ ST_PIPELINE_RENDER,
+ ST_PIPELINE_COMPUTE,
+};
+
+
+/** For drawing quads for glClear, glDraw/CopyPixels, glBitmap, etc. */
+struct st_util_vertex
+{
+ float x, y, z;
+ float r, g, b, a;
+ float s, t;
+};
+
struct st_context
{
boolean prefer_blit_based_texture_transfer;
boolean force_persample_in_shader;
boolean has_shareable_shaders;
+ boolean has_half_float_packing;
+ boolean has_multi_draw_indirect;
/**
* If a shader can be created when we get its source.
char renderer[100];
struct st_state_flags dirty;
+ struct st_state_flags dirty_cp;
GLboolean vertdata_edgeflags;
GLboolean edgeflag_culls_prims;
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_compute_program *cp; /**< Currently bound compute 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 st_basic_variant *gp_variant;
+ struct st_basic_variant *tcp_variant;
+ struct st_basic_variant *tep_variant;
+ struct st_basic_variant *cp_variant;
struct gl_texture_object *default_texture;
/** for glBitmap */
struct {
struct pipe_rasterizer_state rasterizer;
- struct pipe_sampler_state samplers[2];
+ struct pipe_sampler_state sampler;
+ struct pipe_sampler_state atlas_sampler;
enum pipe_format tex_format;
void *vs;
struct bitmap_cache *cache;
void *vert_shaders[2]; /**< ureg shaders */
} drawpix;
+ struct {
+ GLsizei width, height;
+ GLenum format, type;
+ const void *user_pointer; /**< Last user 'pixels' pointer */
+ void *image; /**< Copy of the glDrawPixels image data */
+ struct pipe_resource *texture;
+ } drawpix_cache;
+
/** for glClear */
struct {
struct pipe_rasterizer_state raster;
void *gs_layered;
} clear;
- /** used for anything using util_draw_vertex_buffer */
- struct pipe_vertex_element velems_util_draw[3];
+ /* For gl(Compressed)Tex(Sub)Image */
+ struct {
+ struct pipe_rasterizer_state raster;
+ struct pipe_blend_state blend;
+ void *vs;
+ void *gs;
+ void *fs;
+ bool enabled;
+ bool rgba_only;
+ bool upload_layers;
+ bool use_gs;
+ } pbo_upload;
+
+ /** for drawing with st_util_vertex */
+ struct pipe_vertex_element util_velems[3];
void *passthrough_fs; /**< simple pass-through frag shader */
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);
+void st_invalidate_state(struct gl_context * ctx, GLbitfield new_state);