#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"
/* 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);
}
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);