i965: report correct sample positions
authorChris Forbes <chrisf@ijw.co.nz>
Tue, 23 Apr 2013 18:44:02 +0000 (06:44 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Thu, 25 Apr 2013 08:47:54 +0000 (20:47 +1200)
From low to high bits, the sample positions are packed y0,x0,y1,x1...

Fixes arb_texture_multisample-sample-position piglit.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/gen6_multisample_state.c

index 35071e846be28e6cf34b7553f438fd9e2289799f..534abc212b684e8acbd018c48d2caca9de2ddd9b 100644 (file)
@@ -83,14 +83,14 @@ gen6_get_sample_position(struct gl_context *ctx,
       break;
    case 4: {
       uint8_t val = (uint8_t)(sample_positions_4x[0] >> (8*index));
-      result[0] = (val & 0xf) / 16.0f;
-      result[1] = ((val >> 4) & 0xf) / 16.0f;
+      result[0] = ((val >> 4) & 0xf) / 16.0f;
+      result[1] = (val & 0xf) / 16.0f;
       break;
    }
    case 8: {
       uint8_t val = (uint8_t)(sample_positions_8x[index>>2] >> (8*(index & 3)));
-      result[0] = (val & 0xf) / 16.0f;
-      result[1] = ((val >> 4) & 0xf) / 16.0f;
+      result[0] = ((val >> 4) & 0xf) / 16.0f;
+      result[1] = (val & 0xf) / 16.0f;
       break;
    }
    default: