diff options
author | Brian <[email protected]> | 2007-10-15 11:47:53 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-10-15 11:47:53 -0600 |
commit | 369eefc34c8d7acdb881ea5b0516406d71344fc4 (patch) | |
tree | 323628a281f794df317aa89577266ac4bfc8649e /src/mesa/pipe/i915simple | |
parent | c8bf63e992f902f1bef0c20e5b50f397c4d219a7 (diff) |
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.
Diffstat (limited to 'src/mesa/pipe/i915simple')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_state.c | 3 | ||||
-rw-r--r-- | src/mesa/pipe/i915simple/i915_state_sampler.c | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/mesa/pipe/i915simple/i915_state.c b/src/mesa/pipe/i915simple/i915_state.c index 4a31747fe85..8da5662e3fe 100644 --- a/src/mesa/pipe/i915simple/i915_state.c +++ b/src/mesa/pipe/i915simple/i915_state.c @@ -262,6 +262,9 @@ i915_create_sampler_state(struct pipe_context *pipe, (translate_wrap_mode(wt) << SS3_TCY_ADDR_MODE_SHIFT) | (translate_wrap_mode(wr) << SS3_TCZ_ADDR_MODE_SHIFT)); + if (sampler->normalized_coords) + cso->state[1] |= SS3_NORMALIZED_COORDS; + { ubyte r = float_to_ubyte(sampler->border_color[0]); ubyte g = float_to_ubyte(sampler->border_color[1]); diff --git a/src/mesa/pipe/i915simple/i915_state_sampler.c b/src/mesa/pipe/i915simple/i915_state_sampler.c index 3b736f9c551..8dec6781cd5 100644 --- a/src/mesa/pipe/i915simple/i915_state_sampler.c +++ b/src/mesa/pipe/i915simple/i915_state_sampler.c @@ -127,10 +127,6 @@ static void update_sampler(struct i915_context *i915, #endif state[1] |= (unit << SS3_TEXTUREMAP_INDEX_SHIFT); - - if (is_power_of_two_texture(mt)) { - state[1] |= SS3_NORMALIZED_COORDS; - } } void i915_update_samplers( struct i915_context *i915 ) |