Signed-off-by: Anuj Phogat <anuj.pho...@gmail.com> --- src/mesa/drivers/dri/i965/brw_context.c | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 619f2d5..cabc79f 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -406,6 +406,42 @@ brw_initialize_context_constants(struct brw_context *brw) ctx->Const.MaxDepthTextureSamples = max_samples; ctx->Const.MaxIntegerSamples = max_samples; + /* Sample index layout shows the numbering of slots in a rectangular + * 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. Sample number layout matches the sample + * index layout in case of 2X and 4x MSAA, but they are different in + * case of 8X MSAA. + * + * 2X MSAA sample index / number layout + * --------- + * | 0 | 1 | + * --------- + * + * 4X MSAA sample index / number layout + * --------- + * | 0 | 1 | + * --------- + * | 2 | 3 | + * --------- + * + * 8X MSAA sample index layout 8x MSAA sample number layout + * --------- --------- + * | 0 | 1 | | 5 | 2 | + * --------- --------- + * | 2 | 3 | | 4 | 6 | + * --------- --------- + * | 4 | 5 | | 0 | 3 | + * --------- --------- + * | 6 | 7 | | 7 | 1 | + * --------- --------- + * + * A sample map is used to map sample index to a sample number. + */ + ctx->Const.sample_map_2x = "0, 1"; + ctx->Const.sample_map_4x = "0, 1, 2, 3"; + ctx->Const.sample_map_8x = "5, 2, 4, 6, 0, 3, 7, 1"; + if (brw->gen >= 7) ctx->Const.MaxProgramTextureGatherComponents = 4; else if (brw->gen == 6) -- 1.9.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev