freedreno/a6xx: remove astc_srgb workaround
authorRob Clark <robdclark@gmail.com>
Wed, 6 Mar 2019 14:44:14 +0000 (09:44 -0500)
committerRob Clark <robdclark@gmail.com>
Thu, 7 Mar 2019 20:33:42 +0000 (15:33 -0500)
Not used on a6xx, so remove some of the related plumbing that was copied
over from older gens.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a6xx/fd6_context.h
src/gallium/drivers/freedreno/a6xx/fd6_draw.c
src/gallium/drivers/freedreno/a6xx/fd6_texture.c
src/gallium/drivers/freedreno/a6xx/fd6_texture.h

index 9c957322a53d6a2833ce6363506bb8aa24f8515f..e033a73f3bef8a3ddc5df7cb983117727a53c303 100644 (file)
@@ -78,9 +78,6 @@ struct fd6_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()
index c278d09d9d6e9301a923e9d5f74ec399937d6de1..c049488db0f7929cf5616133cdd4df77e87dd06e 100644 (file)
@@ -158,16 +158,13 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
                                .fclamp_color = ctx->rasterizer->clamp_fragment_color,
                                .rasterflat = ctx->rasterizer->flatshade,
                                .ucp_enables = ctx->rasterizer->clip_plane_enable,
-                               .has_per_samp = (fd6_ctx->fsaturate || fd6_ctx->vsaturate ||
-                                               fd6_ctx->fastc_srgb || fd6_ctx->vastc_srgb),
+                               .has_per_samp = (fd6_ctx->fsaturate || fd6_ctx->vsaturate),
                                .vsaturate_s = fd6_ctx->vsaturate_s,
                                .vsaturate_t = fd6_ctx->vsaturate_t,
                                .vsaturate_r = fd6_ctx->vsaturate_r,
                                .fsaturate_s = fd6_ctx->fsaturate_s,
                                .fsaturate_t = fd6_ctx->fsaturate_t,
                                .fsaturate_r = fd6_ctx->fsaturate_r,
-                               .vastc_srgb = fd6_ctx->vastc_srgb,
-                               .fastc_srgb = fd6_ctx->fastc_srgb,
                                .vsamples = ctx->tex[PIPE_SHADER_VERTEX].samples,
                                .fsamples = ctx->tex[PIPE_SHADER_FRAGMENT].samples,
                        }
index 6f61f4ed3da091c91b34d9ef8b849048a51068ca..f2f7276aaa8f0f2e63e30c3492f4e38b267cfaeb 100644 (file)
@@ -213,12 +213,6 @@ fd6_sampler_states_bind(struct pipe_context *pctx,
        }
 }
 
-static bool
-use_astc_srgb_workaround(struct pipe_context *pctx, enum pipe_format format)
-{
-       return false;  // TODO check if this is still needed on a5xx
-}
-
 static struct pipe_sampler_view *
 fd6_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
                const struct pipe_sampler_view *cso)
@@ -250,8 +244,6 @@ fd6_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
                                cso->swizzle_b, cso->swizzle_a);
 
        if (util_format_is_srgb(format)) {
-               if (use_astc_srgb_workaround(pctx, format))
-                       so->astc_srgb = true;
                so->texconst0 |= A6XX_TEX_CONST_0_SRGB;
        }
 
@@ -360,34 +352,6 @@ fd6_sampler_view_destroy(struct pipe_context *pctx,
        free(view);
 }
 
-static void
-fd6_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
-               unsigned start, unsigned nr,
-               struct pipe_sampler_view **views)
-{
-       struct fd_context *ctx = fd_context(pctx);
-       struct fd6_context *fd6_ctx = fd6_context(ctx);
-       uint16_t astc_srgb = 0;
-       unsigned i;
-
-       for (i = 0; i < nr; i++) {
-               if (views[i]) {
-                       struct fd6_pipe_sampler_view *view =
-                                       fd6_pipe_sampler_view(views[i]);
-                       if (view->astc_srgb)
-                               astc_srgb |= (1 << i);
-               }
-       }
-
-       fd_set_sampler_views(pctx, shader, start, nr, views);
-
-       if (shader == PIPE_SHADER_FRAGMENT) {
-               fd6_ctx->fastc_srgb = astc_srgb;
-       } else if (shader == PIPE_SHADER_VERTEX) {
-               fd6_ctx->vastc_srgb = astc_srgb;
-       }
-}
-
 
 static uint32_t
 key_hash(const void *_key)
@@ -485,7 +449,7 @@ fd6_texture_init(struct pipe_context *pctx)
 
        pctx->create_sampler_view = fd6_sampler_view_create;
        pctx->sampler_view_destroy = fd6_sampler_view_destroy;
-       pctx->set_sampler_views = fd6_set_sampler_views;
+       pctx->set_sampler_views = fd_set_sampler_views;
 
        fd6_ctx->tex_cache = _mesa_hash_table_create(NULL, key_hash, key_equals);
 }
index 122f60bba27ef096b5fa793d8c71fa5a80fdc073..9ca4cfbdf898e80bd353b5eda77b1bf797fa9520 100644 (file)
@@ -55,7 +55,6 @@ struct fd6_pipe_sampler_view {
        uint32_t texconst0, texconst1, texconst2, texconst3, texconst5;
        uint32_t texconst6, texconst7, texconst8, texconst9, texconst10, texconst11;
        uint32_t offset;
-       bool astc_srgb;
        uint16_t seqno;
        bool ubwc_enabled;
 };