mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 08:10:14 +01:00
freedreno/a6xx: remove astc_srgb workaround
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>
This commit is contained in:
parent
45271702ec
commit
8dc47490c8
4 changed files with 2 additions and 45 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue