Commit a21552a9 authored by Kenneth Graunke's avatar Kenneth Graunke

i965: Program 2x MSAA sample positions.

There are only two sensible placements for 2x MSAA samples - and one is
the mirror image of the other.  I chose (0.25, 0.25) and (0.75, 0.75).
Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes's avatarChris Forbes <chrisf@ijw.co.nz>
parent f4bc0ac8
......@@ -23,6 +23,17 @@
#include <stdint.h>
/**
* 1x MSAA has a single sample at the center: (0.5, 0.5) -> (0x8, 0x8).
*
* 2x MSAA sample positions are (0.25, 0.25) and (0.75, 0.75):
* 4 c
* 4 0
* c 1
*/
static const uint32_t
brw_multisample_positions_1x_2x = 0x0088cc44;
/**
* Sample positions:
* 2 6 a e
......
......@@ -38,6 +38,9 @@ gen6_get_sample_position(struct gl_context *ctx,
case 1:
result[0] = result[1] = 0.5f;
return;
case 2:
bits = brw_multisample_positions_1x_2x >> (8 * index);
break;
case 4:
bits = brw_multisample_positions_4x >> (8 * index);
break;
......
......@@ -87,10 +87,8 @@ gen8_emit_3dstate_sample_pattern(struct brw_context *brw)
/* 4x MSAA */
OUT_BATCH(brw_multisample_positions_4x);
/* 2x and 1x MSAA patterns
* XXX: need to program 2x.
*/
OUT_BATCH(0x00880000);
/* 1x and 2x MSAA */
OUT_BATCH(brw_multisample_positions_1x_2x);
ADVANCE_BATCH();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment