etnaviv: use dummy RT buffer when rendering without color buffer
[mesa.git] / src / gallium / drivers / etnaviv / etnaviv_context.h
index b847b652d1dc6afa7077f59a7b587ce7fcf95d92..6ad9f3431e15e38f3c36f7d05c074a4ba38e96b4 100644 (file)
@@ -42,9 +42,9 @@
 
 struct pipe_screen;
 struct etna_shader_variant;
+struct etna_sampler_ts;
 
 struct etna_index_buffer {
-   struct pipe_index_buffer ib;
    struct etna_reloc FE_INDEX_STREAM_BASE_ADDR;
    uint32_t FE_INDEX_STREAM_CONTROL;
    uint32_t FE_PRIMITIVE_RESTART_INDEX;
@@ -80,6 +80,7 @@ struct etna_vertexbuf_state {
 };
 
 struct etna_shader_state {
+   void *bind_vs, *bind_fs;
    struct etna_shader_variant *vs, *fs;
 };
 
@@ -100,6 +101,11 @@ struct etna_shader_uniform_info {
 struct etna_context {
    struct pipe_context base;
 
+   /* GPU-specific implementation to emit texture state */
+   void (*emit_texture_state)(struct etna_context *pctx);
+   /* Get sampler TS pointer for sampler view */
+   struct etna_sampler_ts *(*ts_for_sampler_view)(struct pipe_sampler_view *pview);
+
    struct etna_specs specs;
    struct etna_screen *screen;
    struct etna_cmd_stream *stream;
@@ -124,6 +130,7 @@ struct etna_context {
       ETNA_DIRTY_SHADER          = (1 << 16),
       ETNA_DIRTY_TS              = (1 << 17),
       ETNA_DIRTY_TEXTURE_CACHES  = (1 << 18),
+      ETNA_DIRTY_DERIVE_TS       = (1 << 19),
    } dirty;
 
    uint32_t prim_hwsupport;
@@ -155,6 +162,7 @@ struct etna_context {
    struct compiled_viewport_state viewport;
    unsigned num_fragment_sampler_views;
    uint32_t active_sampler_views;
+   uint32_t dirty_sampler_views;
    struct pipe_sampler_view *sampler_view[PIPE_MAX_SAMPLERS];
    struct pipe_constant_buffer constant_buffer[PIPE_SHADER_TYPES];
    struct etna_vertexbuf_state vertex_buffer;
@@ -174,9 +182,17 @@ struct etna_context {
    struct {
       uint64_t prims_emitted;
       uint64_t draw_calls;
+      uint64_t rs_operations;
    } stats;
 
    struct pipe_debug_callback debug;
+   int in_fence_fd;
+
+   /* list of active hardware queries */
+   struct list_head active_hw_queries;
+
+   struct etna_bo *dummy_rt;
+   struct etna_reloc dummy_rt_reloc;
 };
 
 static inline struct etna_context *