diff options
author | Dave Airlie <[email protected]> | 2018-10-04 02:41:26 +0100 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-10-09 09:56:00 +0200 |
commit | f92226931b90c005eace6dd9cb675c83b1e58cb0 (patch) | |
tree | 30ce382549fbfdd1d97e946936b7011ca8a4e38d /src | |
parent | ad96c4987cb2b23a9314a0a01fea8153843de8ef (diff) |
st/mesa: Prefer R8 for bitmap textures
If it's not available, we fall back to A8. This should work on all drivers,
because we depend on it in the display-list code already.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_cb_bitmap.c | 9 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index d3b7353fb72..676fb12be55 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -564,21 +564,16 @@ init_bitmap_state(struct st_context *st) st->bitmap.rasterizer.depth_clip_far = 1; /* find a usable texture format */ - if (screen->is_format_supported(screen, PIPE_FORMAT_I8_UNORM, + if (screen->is_format_supported(screen, PIPE_FORMAT_R8_UNORM, st->internal_target, 0, 0, PIPE_BIND_SAMPLER_VIEW)) { - st->bitmap.tex_format = PIPE_FORMAT_I8_UNORM; + st->bitmap.tex_format = PIPE_FORMAT_R8_UNORM; } else if (screen->is_format_supported(screen, PIPE_FORMAT_A8_UNORM, st->internal_target, 0, 0, PIPE_BIND_SAMPLER_VIEW)) { st->bitmap.tex_format = PIPE_FORMAT_A8_UNORM; } - else if (screen->is_format_supported(screen, PIPE_FORMAT_L8_UNORM, - st->internal_target, 0, 0, - PIPE_BIND_SAMPLER_VIEW)) { - st->bitmap.tex_format = PIPE_FORMAT_L8_UNORM; - } else { /* XXX support more formats */ assert(0); diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index f3143cef95c..3c9597e1c6f 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -1183,7 +1183,7 @@ st_create_fp_variant(struct st_context *st, variant->bitmap_sampler = ffs(~stfp->Base.SamplersUsed) - 1; options.sampler = variant->bitmap_sampler; - options.swizzle_xxxx = (st->bitmap.tex_format == PIPE_FORMAT_L8_UNORM); + options.swizzle_xxxx = st->bitmap.tex_format == PIPE_FORMAT_R8_UNORM; NIR_PASS_V(tgsi.ir.nir, nir_lower_bitmap, &options); } |