Mesa (master): i965: Change 8X MSAA sample mapping

Anuj Phogat aphogat at kemper.freedesktop.org
Fri Aug 12 17:47:25 UTC 2016


Module: Mesa
Branch: master
Commit: 7f6136d7dbbb8f28dc7448c4d6fcd3a0d583c7d1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7f6136d7dbbb8f28dc7448c4d6fcd3a0d583c7d1

Author: Anuj Phogat <anuj.phogat at gmail.com>
Date:   Thu Aug 11 12:05:45 2016 -0700

i965: Change 8X MSAA sample mapping

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 at gmail.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp       | 10 +++++-----
 src/mesa/drivers/dri/i965/gen6_multisample_state.c |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index b903de1..f7f685b 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -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) {
diff --git a/src/mesa/drivers/dri/i965/gen6_multisample_state.c b/src/mesa/drivers/dri/i965/gen6_multisample_state.c
index a47e323..a59ffec 100644
--- a/src/mesa/drivers/dri/i965/gen6_multisample_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_multisample_state.c
@@ -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 };
 




More information about the mesa-commit mailing list