summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyuw@linux.intel.com>2010-09-17 14:17:06 +0800
committerZhenyu Wang <zhenyuw@linux.intel.com>2010-09-28 15:58:20 +0800
commit956f866030f7bea5fc4a2de28c72e60bdc3a5b3d (patch)
tree3d8be8a7c8c4555256b0b0751cfcf86eb077f48c /src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
parentc5a3b25bb954db49dcb5e7737018979782d2edba (diff)
i965: Fix sampler on sandybridge
Sandybridge has not much change on texture sampler with Ironlake.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm_sampler_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_sampler_state.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
index 1fc802cfa6..f9c48140fb 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -100,10 +100,13 @@ struct wm_sampler_key {
* Sets the sampler state for a single unit based off of the sampler key
* entry.
*/
-static void brw_update_sampler_state(struct wm_sampler_entry *key,
+static void brw_update_sampler_state(struct brw_context *brw,
+ struct wm_sampler_entry *key,
drm_intel_bo *sdc_bo,
struct brw_sampler_state *sampler)
{
+ struct intel_context *intel = &brw->intel;
+
memset(sampler, 0, sizeof(*sampler));
switch (key->minfilter) {
@@ -163,6 +166,10 @@ static void brw_update_sampler_state(struct wm_sampler_entry *key,
sampler->ss1.s_wrap_mode = translate_wrap_mode(key->wrap_s);
sampler->ss1.t_wrap_mode = translate_wrap_mode(key->wrap_t);
+ if (intel->gen >= 6 &&
+ sampler->ss0.min_filter != sampler->ss0.mag_filter)
+ sampler->ss0.min_mag_neq = 1;
+
/* Cube-maps on 965 and later must use the same wrap mode for all 3
* coordinate dimensions. Futher, only CUBE and CLAMP are valid.
*/
@@ -329,7 +336,7 @@ static void upload_wm_samplers( struct brw_context *brw )
if (brw->wm.sdc_bo[i] == NULL)
continue;
- brw_update_sampler_state(&key.sampler[i], brw->wm.sdc_bo[i],
+ brw_update_sampler_state(brw, &key.sampler[i], brw->wm.sdc_bo[i],
&sampler[i]);
}