summaryrefslogtreecommitdiff
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2018-07-23 08:02:46 -0700
committerAndres Gomez <agomez@igalia.com>2018-08-13 12:43:03 +0300
commit90278c7f951e9bb9909c0e7a0fd543fa59643600 (patch)
tree83a84a8bc13df689af90f0eaef3cf35978c7c1d2 /src/intel
parent0c1832765f491f52acde43553f05fae1a136d806 (diff)
intel: Switch the order of the 2x MSAA sample positions
The Vulkan 1.1.82 spec flipped the order to better match D3D. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> (cherry picked from commit a9f7bcfdf90d8302e9ed27601b2b7001b9940740)
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/blorp/blorp_blit.c12
-rw-r--r--src/intel/common/gen_sample_positions.h8
2 files changed, 15 insertions, 5 deletions
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index c85ec8543a9..e811cb0be37 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -776,6 +776,14 @@ blorp_nir_manual_blend_bilinear(nir_builder *b, nir_ssa_def *pos,
* grid of samples with in a pixel. Sample number layout shows the
* rectangular grid of samples roughly corresponding to the real sample
* locations with in a pixel.
+ *
+ * In the case of 2x MSAA, the layout of sample indices is reversed from
+ * the layout of sample numbers:
+ *
+ * sample index layout : --------- sample number layout : ---------
+ * | 0 | 1 | | 1 | 0 |
+ * --------- ---------
+ *
* In case of 4x MSAA, layout of sample indices matches the layout of
* sample numbers:
* ---------
@@ -819,7 +827,9 @@ blorp_nir_manual_blend_bilinear(nir_builder *b, nir_ssa_def *pos,
key->x_scale * key->y_scale));
sample = nir_f2i32(b, sample);
- if (tex_samples == 8) {
+ if (tex_samples == 2) {
+ sample = nir_isub(b, nir_imm_int(b, 1), sample);
+ } else if (tex_samples == 8) {
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));
diff --git a/src/intel/common/gen_sample_positions.h b/src/intel/common/gen_sample_positions.h
index f0ce95dd1fb..da48dcb5ed0 100644
--- a/src/intel/common/gen_sample_positions.h
+++ b/src/intel/common/gen_sample_positions.h
@@ -42,10 +42,10 @@ prefix##0YOffset = 0.5;
* c 1
*/
#define GEN_SAMPLE_POS_2X(prefix) \
-prefix##0XOffset = 0.25; \
-prefix##0YOffset = 0.25; \
-prefix##1XOffset = 0.75; \
-prefix##1YOffset = 0.75;
+prefix##0XOffset = 0.75; \
+prefix##0YOffset = 0.75; \
+prefix##1XOffset = 0.25; \
+prefix##1YOffset = 0.25;
/**
* Sample positions: