+/*
+ * MSAA fixed sample position table
+ * used by update_derived and get_sample_position
+ * (integer locations on a 16x16 grid)
+ */
+static const uint8_t swr_sample_positions[][2] =
+{ /* 1x*/ { 8, 8},
+ /* 2x*/ {12,12},{ 4, 4},
+ /* 4x*/ { 6, 2},{14, 6},{ 2,10},{10,14},
+ /* 8x*/ { 9, 5},{ 7,11},{13, 9},{ 5, 3},
+ { 3,13},{ 1, 7},{11,15},{15, 1},
+ /*16x*/ { 9, 9},{ 7, 5},{ 5,10},{12, 7},
+ { 3, 6},{10,13},{13,11},{11, 3},
+ { 6,14},{ 8, 1},{ 4, 2},{ 2,12},
+ { 0, 8},{15, 4},{14,15},{ 1, 0} };
+
+static void
+swr_get_sample_position(struct pipe_context *pipe,
+ unsigned sample_count, unsigned sample_index,
+ float *out_value)
+{
+ /* validate sample_count */
+ sample_count = GetNumSamples(GetSampleCount(sample_count));
+
+ const uint8_t *sample = swr_sample_positions[sample_count-1 + sample_index];
+ out_value[0] = sample[0] / 16.0f;
+ out_value[1] = sample[1] / 16.0f;
+}
+
+