*/
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()
.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,
}
}
}
-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)
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;
}
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)
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);
}