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>tags/19.1-branchpoint
| */ | */ | ||||
| uint16_t fsaturate_s, fsaturate_t, fsaturate_r; | 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 | /* some state changes require a different shader variant. Keep | ||||
| * track of this so we know when we need to re-emit shader state | * track of this so we know when we need to re-emit shader state | ||||
| * due to variant change. See fixup_shader_state() | * due to variant change. See fixup_shader_state() |
| .fclamp_color = ctx->rasterizer->clamp_fragment_color, | .fclamp_color = ctx->rasterizer->clamp_fragment_color, | ||||
| .rasterflat = ctx->rasterizer->flatshade, | .rasterflat = ctx->rasterizer->flatshade, | ||||
| .ucp_enables = ctx->rasterizer->clip_plane_enable, | .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_s = fd6_ctx->vsaturate_s, | ||||
| .vsaturate_t = fd6_ctx->vsaturate_t, | .vsaturate_t = fd6_ctx->vsaturate_t, | ||||
| .vsaturate_r = fd6_ctx->vsaturate_r, | .vsaturate_r = fd6_ctx->vsaturate_r, | ||||
| .fsaturate_s = fd6_ctx->fsaturate_s, | .fsaturate_s = fd6_ctx->fsaturate_s, | ||||
| .fsaturate_t = fd6_ctx->fsaturate_t, | .fsaturate_t = fd6_ctx->fsaturate_t, | ||||
| .fsaturate_r = fd6_ctx->fsaturate_r, | .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, | .vsamples = ctx->tex[PIPE_SHADER_VERTEX].samples, | ||||
| .fsamples = ctx->tex[PIPE_SHADER_FRAGMENT].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 * | static struct pipe_sampler_view * | ||||
| fd6_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc, | fd6_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc, | ||||
| const struct pipe_sampler_view *cso) | const struct pipe_sampler_view *cso) | ||||
| cso->swizzle_b, cso->swizzle_a); | cso->swizzle_b, cso->swizzle_a); | ||||
| if (util_format_is_srgb(format)) { | if (util_format_is_srgb(format)) { | ||||
| if (use_astc_srgb_workaround(pctx, format)) | |||||
| so->astc_srgb = true; | |||||
| so->texconst0 |= A6XX_TEX_CONST_0_SRGB; | so->texconst0 |= A6XX_TEX_CONST_0_SRGB; | ||||
| } | } | ||||
| free(view); | 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 | static uint32_t | ||||
| key_hash(const void *_key) | key_hash(const void *_key) | ||||
| pctx->create_sampler_view = fd6_sampler_view_create; | pctx->create_sampler_view = fd6_sampler_view_create; | ||||
| pctx->sampler_view_destroy = fd6_sampler_view_destroy; | 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); | fd6_ctx->tex_cache = _mesa_hash_table_create(NULL, key_hash, key_equals); | ||||
| } | } |
| uint32_t texconst0, texconst1, texconst2, texconst3, texconst5; | uint32_t texconst0, texconst1, texconst2, texconst3, texconst5; | ||||
| uint32_t texconst6, texconst7, texconst8, texconst9, texconst10, texconst11; | uint32_t texconst6, texconst7, texconst8, texconst9, texconst10, texconst11; | ||||
| uint32_t offset; | uint32_t offset; | ||||
| bool astc_srgb; | |||||
| uint16_t seqno; | uint16_t seqno; | ||||
| bool ubwc_enabled; | bool ubwc_enabled; | ||||
| }; | }; |