freedreno/a4xx: better workaround for astc+srgb
[mesa.git] / src / gallium / drivers / freedreno / a4xx / fd4_context.h
index 53e1bf6a2e6da991b56bbdc2567fa6be9b4e3abd..9467fc529bf65527f5c8bc7b09d2bece2cc218c5 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef FD4_CONTEXT_H_
 #define FD4_CONTEXT_H_
 
+#include "util/u_upload_mgr.h"
+
 #include "freedreno_drmif.h"
 
 #include "freedreno_context.h"
 struct fd4_context {
        struct fd_context base;
 
-       /* Keep track of writes to RB_RENDER_CONTROL which need to be patched
-        * once we know whether or not to use GMEM, and GMEM tile pitch.
-        */
-       struct util_dynarray rbrc_patches;
-
        struct fd_bo *vs_pvt_mem, *fs_pvt_mem;
 
        /* This only needs to be 4 * num_of_pipes bytes (ie. 32 bytes).  We
         * could combine it with another allocation.
+        *
+        * (upper area used as scratch bo.. see fd4_query)
         */
        struct fd_bo *vsc_size_mem;
 
@@ -70,6 +69,9 @@ struct fd4_context {
         */
        struct fd_vertex_state blit_vbuf_state;
 
+       struct u_upload_mgr *border_color_uploader;
+       struct pipe_resource *border_color_buf;
+
        /* if *any* of bits are set in {v,f}saturate_{s,t,r} */
        bool vsaturate, fsaturate;
 
@@ -83,6 +85,9 @@ struct fd4_context {
         */
        uint16_t fsaturate_s, fsaturate_t, fsaturate_r;
 
+       /* bitmask of samplers which need astc srgb workaround: */
+       uint16_t vastc_srgb, fastc_srgb;
+
        /* some state changes require a different shader variant.  Keep
         * track of this so we know when we need to re-emit shader state
         * due to variant change.  See fixup_shader_state()
@@ -90,13 +95,13 @@ struct fd4_context {
        struct ir3_shader_key last_key;
 };
 
-static INLINE struct fd4_context *
+static inline struct fd4_context *
 fd4_context(struct fd_context *ctx)
 {
        return (struct fd4_context *)ctx;
 }
 
 struct pipe_context *
-fd4_context_create(struct pipe_screen *pscreen, void *priv);
+fd4_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags);
 
 #endif /* FD4_CONTEXT_H_ */