This is required following the change in 8X sample positions.
Fixes the recently modified multisample-scaled-blit piglit tests.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
*
* In case of 8x MSAA the two layouts don't match.
* sample index layout : --------- sample number layout : ---------
- * | 0 | 1 | | 5 | 2 |
+ * | 0 | 1 | | 3 | 7 |
* --------- ---------
- * | 2 | 3 | | 4 | 6 |
+ * | 2 | 3 | | 5 | 0 |
* --------- ---------
- * | 4 | 5 | | 0 | 3 |
+ * | 4 | 5 | | 1 | 2 |
* --------- ---------
- * | 6 | 7 | | 7 | 1 |
+ * | 6 | 7 | | 4 | 6 |
* --------- ---------
*
* Fortunately, this can be done fairly easily as:
sample = nir_f2i(b, sample);
if (tex_samples == 8) {
- sample = nir_iand(b, nir_ishr(b, nir_imm_int(b, 0x17306425),
+ 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));
} else if (tex_samples == 16) {
{
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};
+ uint8_t map_8x[8] = {3, 7, 5, 0, 1, 2, 4, 6};
uint8_t map_16x[16] = { 15, 10, 9, 7, 4, 1, 3, 13,
12, 2, 0, 6, 11, 8, 5, 14 };