#include "../../winsys/radeon/drm/radeon_winsys.h"
#include "util/u_double_list.h"
-#include "util/u_vbuf_mgr.h"
+#include "util/u_vbuf.h"
#define R600_ERR(fmt, args...) \
fprintf(stderr, "EE %s:%d %s - "fmt, __FILE__, __LINE__, __func__, ##args)
/* Winsys objects. */
struct pb_buffer *buf;
struct radeon_winsys_cs_handle *cs_buf;
+
+ /* Resource state. */
+ unsigned domains;
};
/* R600/R700 STATES */
};
struct r600_query {
- u64 result;
+ union {
+ uint64_t u64;
+ boolean b;
+ struct pipe_query_data_so_statistics so;
+ } result;
/* The kind of query */
unsigned type;
/* Offset of the first result for current query */
* data blocks for current query are stored sequentially from
* results_start to results_end, with wrapping on the buffer end */
struct r600_resource *buffer;
+ /* The number of dwords for begin_query or end_query. */
+ unsigned num_cs_dw;
/* linked list of queries */
struct list_head list;
};
+struct r600_so_target {
+ struct pipe_stream_output_target b;
+
+ /* The buffer where BUFFER_FILLED_SIZE is stored. */
+ struct r600_resource *filled_size;
+ unsigned stride_in_dw;
+ unsigned so_index;
+};
+
#define R600_CONTEXT_DRAW_PENDING (1 << 0)
#define R600_CONTEXT_DST_CACHES_DIRTY (1 << 1)
#define R600_CONTEXT_CHECK_EVENT_FLUSH (1 << 2)
struct r600_screen *screen;
struct radeon_winsys *ws;
struct radeon_winsys_cs *cs;
+ struct pipe_context *pipe;
+
+ void (*flush)(void *pipe, unsigned flags);
struct r600_range *range;
unsigned nblocks;
struct list_head dirty;
struct list_head resource_dirty;
struct list_head enable_list;
- unsigned pm4_ndwords;
unsigned pm4_dirty_cdwords;
unsigned ctx_pm4_ndwords;
unsigned init_dwords;
/* The list of active queries. Only one query of each type can be active. */
struct list_head active_query_list;
+ unsigned num_cs_dw_queries_suspend;
+ unsigned num_cs_dw_streamout_end;
- unsigned num_query_running;
unsigned backend_mask;
unsigned max_db; /* for OQ */
unsigned num_dest_buffers;
struct r600_range fs_resources;
int num_ps_resources, num_vs_resources, num_fs_resources;
boolean have_depth_texture, have_depth_fb;
+
+ unsigned num_so_targets;
+ struct r600_so_target *so_targets[PIPE_MAX_SO_BUFFERS];
+ boolean streamout_start;
+ unsigned streamout_append_bitmask;
+ unsigned *vs_so_stride_in_dw;
};
struct r600_draw {
void r600_context_flush_all(struct r600_context *ctx, unsigned flush_flags);
void r600_context_flush_dest_caches(struct r600_context *ctx);
+void r600_context_streamout_begin(struct r600_context *ctx);
+void r600_context_streamout_end(struct r600_context *ctx);
+void r600_context_draw_opaque_count(struct r600_context *ctx, struct r600_so_target *t);
+
int evergreen_context_init(struct r600_context *ctx, struct r600_screen *screen);
void evergreen_context_draw(struct r600_context *ctx, const struct r600_draw *draw);
void evergreen_context_flush_dest_caches(struct r600_context *ctx);