diff options
author | Anuj Phogat <anuj.phogat@gmail.com> | 2014-09-23 11:58:02 -0700 |
---|---|---|
committer | Anuj Phogat <anuj.phogat@gmail.com> | 2014-10-01 12:04:15 -0700 |
commit | 7a4790148c524fbdc75fca9aaa4d4439dce911a2 (patch) | |
tree | 20e6abe5a9096144d5a204f38436f215cca34108 /src/mesa/drivers/dri/i965/gen6_multisample_state.c | |
parent | 38cd40faab8686023ac48e323014f951abf47098 (diff) | |
download | external_mesa3d-7a4790148c524fbdc75fca9aaa4d4439dce911a2.zip external_mesa3d-7a4790148c524fbdc75fca9aaa4d4439dce911a2.tar.gz external_mesa3d-7a4790148c524fbdc75fca9aaa4d4439dce911a2.tar.bz2 |
i965: Initialize the SampleMap{2,4,8}x variables
with values specific to Intel hardware.
V2: Define and use gen6_get_sample_map() function to initialize
the variables.
V3: Change the function name to gen6_set_sample_maps() and use
memcpy() to fill in the data.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen6_multisample_state.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_multisample_state.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_multisample_state.c b/src/mesa/drivers/dri/i965/gen6_multisample_state.c index 429a590..ee20c08 100644 --- a/src/mesa/drivers/dri/i965/gen6_multisample_state.c +++ b/src/mesa/drivers/dri/i965/gen6_multisample_state.c @@ -57,6 +57,51 @@ gen6_get_sample_position(struct gl_context *ctx, } /** + * 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 indices to sample numbers. + */ +void +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}; + + memcpy(ctx->Const.SampleMap2x, map_2x, sizeof(map_2x)); + memcpy(ctx->Const.SampleMap4x, map_4x, sizeof(map_4x)); + memcpy(ctx->Const.SampleMap8x, map_8x, sizeof(map_8x)); +} + +/** * 3DSTATE_MULTISAMPLE */ void |