r300g: more efficient finish + fix comments
[mesa.git] / src / gallium / drivers / r300 / r300_context.h
index 69c09560e7ef630054ab26cd4e5a8af2956d3164..efc6df3fabf859464a039be48700f80b81ab887d 100644 (file)
@@ -90,8 +90,10 @@ struct r300_dsa_state {
 };
 
 struct r300_rs_state {
-    /* Draw-specific rasterizer state */
+    /* Original rasterizer state. */
     struct pipe_rasterizer_state rs;
+    /* Draw-specific rasterizer state. */
+    struct pipe_rasterizer_state rs_draw;
 
     uint32_t vap_control_status;    /* R300_VAP_CNTL_STATUS: 0x2140 */
     uint32_t antialiasing_config;   /* R300_GB_AA_CONFIG: 0x4020 */
@@ -250,6 +252,22 @@ struct r300_query {
     struct r300_query* next;
 };
 
+/* Fence object.
+ *
+ * This is a fake fence. Instead of syncing with the fence, we sync
+ * with the context, which is inefficient but compliant.
+ *
+ * This is not a subclass of pipe_fence_handle because pipe_fence_handle is
+ * never actually fully defined. So, rather than have it as a member, and do
+ * subclass-style casting, we treat pipe_fence_handle as an opaque, and just
+ * trust that our state tracker does not ever mess up fence objects.
+ */
+struct r300_fence {
+    struct pipe_reference reference;
+    struct r300_context *ctx;
+    boolean signalled;
+};
+
 struct r300_texture {
     /* Parent class */
     struct u_resource b;
@@ -439,7 +457,12 @@ struct r300_context {
     uint64_t flush_counter;
 };
 
-/* Convenience cast wrapper. */
+/* Convenience cast wrappers. */
+static INLINE struct r300_query* r300_query(struct pipe_query* q)
+{
+    return (struct r300_query*)q;
+}
+
 static INLINE struct r300_texture* r300_texture(struct pipe_resource* tex)
 {
     return (struct r300_texture*)tex;
@@ -460,9 +483,16 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
 
 /* Context initialization. */
 struct draw_stage* r300_draw_stage(struct r300_context* r300);
+void r300_init_blit_functions(struct r300_context *r300);
+void r300_init_flush_functions(struct r300_context* r300);
+void r300_init_query_functions(struct r300_context* r300);
+void r300_init_render_functions(struct r300_context *r300);
 void r300_init_state_functions(struct r300_context* r300);
 void r300_init_resource_functions(struct r300_context* r300);
 
+void r300_finish(struct r300_context *r300);
+void r500_dump_rs_block(struct r300_rs_block *rs);
+
 static INLINE boolean CTX_DBG_ON(struct r300_context * ctx, unsigned flags)
 {
     return SCREEN_DBG_ON(ctx->screen, flags);