radeonsi: move si_destroy_saved_cs to si_debug.c
[mesa.git] / src / gallium / drivers / radeonsi / si_pipe.h
index 896b640c17fbb9bb138b25a79a1621e46539d849..8973ad093c2eeb7c385b0cd68182f16b9b84be0a 100644 (file)
@@ -285,6 +285,7 @@ struct si_framebuffer {
        ubyte                           nr_samples:5; /* at most 16xAA */
        ubyte                           log_samples:3; /* at most 4 = 16xAA */
        ubyte                           compressed_cb_mask;
+       ubyte                           uncompressed_cb_mask;
        ubyte                           color_is_int8;
        ubyte                           color_is_int10;
        ubyte                           dirty_cbufs;
@@ -497,8 +498,12 @@ struct si_context {
        bool                            flatshade;
        bool                            do_update_shaders;
 
+       /* vertex buffer descriptors */
+       uint32_t *vb_descriptors_gpu_list;
+       struct r600_resource *vb_descriptors_buffer;
+       unsigned vb_descriptors_offset;
+
        /* shader descriptors */
-       struct si_descriptors           vertex_buffers;
        struct si_descriptors           descriptors[SI_NUM_DESCS];
        unsigned                        descriptors_dirty;
        unsigned                        shader_pointers_dirty;
@@ -527,6 +532,7 @@ struct si_context {
 
        /* MSAA config state. */
        int                             ps_iter_samples;
+       bool                            ps_uses_fbfetch;
        bool                            smoothing_enabled;
 
        /* DB render state. */
@@ -654,6 +660,13 @@ void si_resource_copy_region(struct pipe_context *ctx,
                             struct pipe_resource *src,
                             unsigned src_level,
                             const struct pipe_box *src_box);
+void si_decompress_dcc(struct pipe_context *ctx, struct r600_texture *rtex);
+void si_blit_decompress_depth(struct pipe_context *ctx,
+                             struct r600_texture *texture,
+                             struct r600_texture *staging,
+                             unsigned first_level, unsigned last_level,
+                             unsigned first_layer, unsigned last_layer,
+                             unsigned first_sample, unsigned last_sample);
 
 /* si_clear.c */
 void vi_dcc_clear_level(struct si_context *sctx,
@@ -692,6 +705,7 @@ void cik_emit_prefetch_L2(struct si_context *sctx);
 void si_init_cp_dma_functions(struct si_context *sctx);
 
 /* si_debug.c */
+void si_destroy_saved_cs(struct si_saved_cs *scs);
 void si_auto_log_cs(void *data, struct u_log_context *log);
 void si_log_hw_flush(struct si_context *sctx);
 void si_log_draw_state(struct si_context *sctx, struct u_log_context *log);
@@ -715,11 +729,10 @@ const char *si_get_family_name(const struct si_screen *sscreen);
 void si_init_screen_get_functions(struct si_screen *sscreen);
 
 /* si_hw_context.c */
-void si_destroy_saved_cs(struct si_saved_cs *scs);
-void si_context_gfx_flush(void *context, unsigned flags,
-                         struct pipe_fence_handle **fence);
-void si_begin_new_cs(struct si_context *ctx);
-void si_need_cs_space(struct si_context *ctx);
+void si_flush_gfx_cs(void *context, unsigned flags,
+                    struct pipe_fence_handle **fence);
+void si_begin_new_gfx_cs(struct si_context *ctx);
+void si_need_gfx_cs_space(struct si_context *ctx);
 
 /* si_compute.c */
 void si_init_compute_functions(struct si_context *sctx);
@@ -926,4 +939,29 @@ vi_tc_compat_htile_enabled(struct r600_texture *tex, unsigned level)
        return tex->tc_compatible_htile && level == 0;
 }
 
+static inline unsigned si_get_ps_iter_samples(struct si_context *sctx)
+{
+       if (sctx->ps_uses_fbfetch)
+               return sctx->framebuffer.nr_samples;
+
+       return sctx->ps_iter_samples;
+}
+
+static inline unsigned si_get_total_colormask(struct si_context *sctx)
+{
+       if (sctx->queued.named.rasterizer->rasterizer_discard)
+               return 0;
+
+       struct si_shader_selector *ps = sctx->ps_shader.cso;
+       unsigned colormask = sctx->framebuffer.colorbuf_enabled_4bit &
+                            sctx->queued.named.blend->cb_target_mask;
+
+       if (!ps->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS])
+               colormask &= ps->colors_written_4bit;
+       else if (!ps->colors_written_4bit)
+               colormask = 0; /* color0 writes all cbufs, but it's not written */
+
+       return colormask;
+}
+
 #endif