Module: Mesa Branch: main Commit: 403b9bf870b4bfbc4fe63a045ddbfbb6b7421c6f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=403b9bf870b4bfbc4fe63a045ddbfbb6b7421c6f
Author: Erik Faye-Lund <[email protected]> Date: Wed Aug 10 08:24:29 2022 +0200 mesa/st: add context-flag for bptc-support Acked-by: Marek Olšák <[email protected]> Acked-by: Soroush Kashani <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012> --- src/mesa/state_tracker/st_context.c | 3 +++ src/mesa/state_tracker/st_context.h | 1 + src/mesa/state_tracker/tests/st_format.c | 1 + 3 files changed, 5 insertions(+) diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 530ea2c61c8..ab7350e4248 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -584,6 +584,9 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, st->has_astc_5x5_ldr = screen->is_format_supported(screen, PIPE_FORMAT_ASTC_5x5_SRGB, PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_SAMPLER_VIEW); + st->has_bptc = screen->is_format_supported(screen, PIPE_FORMAT_BPTC_SRGBA, + PIPE_TEXTURE_2D, 0, 0, + PIPE_BIND_SAMPLER_VIEW); st->force_persample_in_shader = screen->get_param(screen, PIPE_CAP_SAMPLE_SHADING) && !screen->get_param(screen, PIPE_CAP_FORCE_PERSAMPLE_INTERP); diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index cf3445d8e7c..7b79b2ffe9c 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -143,6 +143,7 @@ struct st_context boolean transcode_astc; boolean has_astc_2d_ldr; boolean has_astc_5x5_ldr; + boolean has_bptc; boolean prefer_blit_based_texture_transfer; boolean allow_compute_based_texture_transfer; boolean force_persample_in_shader; diff --git a/src/mesa/state_tracker/tests/st_format.c b/src/mesa/state_tracker/tests/st_format.c index 64e6bb1b33c..460a3052c84 100644 --- a/src/mesa/state_tracker/tests/st_format.c +++ b/src/mesa/state_tracker/tests/st_format.c @@ -60,6 +60,7 @@ int main(int argc, char **argv) .has_etc2 = true, .has_astc_2d_ldr = true, .has_astc_5x5_ldr = true, + .has_bptc = true, }; struct st_context *st = &local_st;
