* Brian Paul
*/
-#include "imports.h"
+#include "main/imports.h"
+#include "main/image.h"
#include "st_context.h"
#include "st_atom.h"
GLcontext *ctx = st->ctx;
struct st_fragment_program *stfp;
struct gl_program *p;
- GLuint interpMode[16];
- GLuint i;
-
- /* XXX temporary */
- for (i = 0; i < 16; i++)
- interpMode[i] = TGSI_INTERPOLATE_LINEAR;
p = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
if (!p)
static void
draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
- GLsizei width, GLsizei height, GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels)
+ GLsizei width, GLsizei height,
+ struct pipe_mipmap_tree *mt)
{
const GLuint unit = 0;
struct pipe_context *pipe = ctx->st->pipe;
- struct pipe_mipmap_tree *mt;
GLfloat x0, y0, x1, y1;
GLuint maxWidth, maxHeight;
/* mipmap tree state: */
{
- mt = make_mipmap_tree(ctx->st, width, height, format, type,
- unpack, pixels);
pipe->set_texture_state(pipe, unit, mt);
}
pipe->set_texture_state(pipe, unit, ctx->st->state.texture[unit]);
pipe->bind_sampler_state(pipe, unit, ctx->st->state.sampler[unit]->data);
pipe->set_viewport_state(pipe, &ctx->st->state.viewport);
-
- free_mipmap_tree(pipe, mt);
}
any_pixel_transfer_ops(st) ||
!compatible_formats(format, type, ps->format)) {
/* textured quad */
- draw_textured_quad(ctx, x, y, ctx->Current.RasterPos[2], width, height,
- format, type, unpack, pixels);
+ struct pipe_mipmap_tree *mt
+ = make_mipmap_tree(ctx->st, width, height, format, type,
+ unpack, pixels);
+ draw_textured_quad(ctx, x, y, ctx->Current.RasterPos[2],
+ width, height, mt);
+ free_mipmap_tree(st->pipe, mt);
}
else {
/* blit */