From 369eefc34c8d7acdb881ea5b0516406d71344fc4 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 15 Oct 2007 11:47:53 -0600 Subject: add 'normalized_coords' field to pipe_sampler_state This controls whether texcoords are interpreted as-is or scaled up from [0,1]. Fixes glDrawPixels/glBitmap problems on i915 when image is non power-of-two. Also, cleans up the CSO sampler state for i915 a bit. --- src/mesa/state_tracker/st_atom_sampler.c | 3 +++ src/mesa/state_tracker/st_cb_drawpixels.c | 1 + 2 files changed, 4 insertions(+) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index 151d7248630..38de35933e8 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -136,6 +136,9 @@ update_samplers(struct st_context *st) sampler.min_mip_filter = gl_filter_to_mip_filter(texobj->MinFilter); sampler.mag_img_filter = gl_filter_to_img_filter(texobj->MagFilter); + if (texobj->Target != GL_TEXTURE_RECTANGLE_ARB) + sampler.normalized_coords = 1; + sampler.lod_bias = st->ctx->Texture.Unit[u].LodBias; #if 1 sampler.min_lod = texobj->MinLod; diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index e3479deb795..7d115209f4f 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -558,6 +558,7 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, sampler.min_img_filter = PIPE_TEX_FILTER_NEAREST; sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE; sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST; + sampler.normalized_coords = 1; cso = st_cached_sampler_state(ctx->st, &sampler); pipe->bind_sampler_state(pipe, unit, cso->data); } -- cgit v1.2.3