i965: Change 8X MSAA sample mapping
authorAnuj Phogat <anuj.phogat@gmail.com>
Thu, 11 Aug 2016 19:05:45 +0000 (12:05 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Fri, 12 Aug 2016 17:45:02 +0000 (10:45 -0700)
This is required following the change in 8X sample positions.
Fixes the recently modified multisample-scaled-blit piglit tests.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
src/mesa/drivers/dri/i965/gen6_multisample_state.c

index b903de1..f7f685b 100644 (file)
@@ -1094,13 +1094,13 @@ blorp_nir_manual_blend_bilinear(nir_builder *b, nir_ssa_def *pos,
        *
        * In case of 8x MSAA the two layouts don't match.
        * sample index layout :  ---------    sample number layout :  ---------
-       *                        | 0 | 1 |                            | 5 | 2 |
+       *                        | 0 | 1 |                            | 3 | 7 |
        *                        ---------                            ---------
-       *                        | 2 | 3 |                            | 4 | 6 |
+       *                        | 2 | 3 |                            | 5 | 0 |
        *                        ---------                            ---------
-       *                        | 4 | 5 |                            | 0 | 3 |
+       *                        | 4 | 5 |                            | 1 | 2 |
        *                        ---------                            ---------
-       *                        | 6 | 7 |                            | 7 | 1 |
+       *                        | 6 | 7 |                            | 4 | 6 |
        *                        ---------                            ---------
        *
        * Fortunately, this can be done fairly easily as:
@@ -1128,7 +1128,7 @@ blorp_nir_manual_blend_bilinear(nir_builder *b, nir_ssa_def *pos,
       sample = nir_f2i(b, sample);
 
       if (tex_samples == 8) {
-         sample = nir_iand(b, nir_ishr(b, nir_imm_int(b, 0x17306425),
+         sample = nir_iand(b, nir_ishr(b, nir_imm_int(b, 0x64210573),
                                        nir_ishl(b, sample, nir_imm_int(b, 2))),
                            nir_imm_int(b, 0xf));
       } else if (tex_samples == 16) {
index a47e323..a59ffec 100644 (file)
@@ -109,7 +109,7 @@ gen6_set_sample_maps(struct gl_context *ctx)
 {
    uint8_t map_2x[2] = {0, 1};
    uint8_t map_4x[4] = {0, 1, 2, 3};
-   uint8_t map_8x[8] = {5, 2, 4, 6, 0, 3, 7, 1};
+   uint8_t map_8x[8] = {3, 7, 5, 0, 1, 2, 4, 6};
    uint8_t map_16x[16] = { 15, 10, 9, 7, 4, 1, 3, 13,
                            12, 2, 0, 6, 11, 8, 5, 14 };