X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_cb_bitmap.c;h=676fb12be55a942d6a17f5bc2cf02144b66370af;hb=0c74e354d10b3a7640f682a43ca0984bc93fa3ef;hp=7ef0d7ea5c621f04fcc26be31e7f5392a01f0b55;hpb=bcb6f19947d5e77e0a6636340dbfc55df5fcc788;p=mesa.git diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 7ef0d7ea5c6..676fb12be55 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -49,6 +49,7 @@ #include "st_cb_drawpixels.h" #include "st_sampler_view.h" #include "st_texture.h" +#include "st_util.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" @@ -302,9 +303,8 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, /* XXX if the bitmap is larger than the max texture size, break * it up into chunks. */ - GLuint MAYBE_UNUSED maxSize = - 1 << (pipe->screen->get_param(pipe->screen, - PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1); + ASSERTED GLuint maxSize = + pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_TEXTURE_2D_SIZE); assert(width <= (GLsizei) maxSize); assert(height <= (GLsizei) maxSize); } @@ -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);