summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-05-04 17:32:29 -0700
committerJason Ekstrand <[email protected]>2016-05-14 13:34:30 -0700
commit5a68df87dac0c4206382f9d31046410bad2ce2f1 (patch)
treeddf3c1ff11733562c4c1580dcdbf324d4dd89a77 /src/mesa/drivers/dri
parentbee160b31be9e09eeab83f62d26ac331f08955fa (diff)
i965/blorp: Simplify the sample layout calculation
Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 9eeb89dbbbe..2e69e96d8ab 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -1506,6 +1506,9 @@ brw_blorp_blit_program::manual_blend_bilinear(unsigned num_samples)
* --------- ---------
* | 6 | 7 | | 7 | 1 |
* --------- ---------
+ *
+ * Fortunately, this can be done fairly easily as:
+ * S' = (0x17306425 >> (S * 4)) & 0xf
*/
emit_frc(vec16(t1_f), x_sample_coords);
emit_frc(vec16(t2_f), y_sample_coords);
@@ -1515,23 +1518,10 @@ brw_blorp_blit_program::manual_blend_bilinear(unsigned num_samples)
emit_mov(vec16(S), t1_f);
if (num_samples == 8) {
- /* Map the sample index to a sample number */
- emit_cmp_if(BRW_CONDITIONAL_L, S, brw_imm_d(4));
- {
- emit_mov(vec16(t2), brw_imm_d(5));
- emit_if_eq_mov(S, 1, vec16(t2), 2);
- emit_if_eq_mov(S, 2, vec16(t2), 4);
- emit_if_eq_mov(S, 3, vec16(t2), 6);
- }
- emit_else();
- {
- emit_mov(vec16(t2), brw_imm_d(0));
- emit_if_eq_mov(S, 5, vec16(t2), 3);
- emit_if_eq_mov(S, 6, vec16(t2), 7);
- emit_if_eq_mov(S, 7, vec16(t2), 1);
- }
- emit_endif();
- emit_mov(vec16(S), t2);
+ emit_mov(vec16(t2), brw_imm_d(0x17306425));
+ emit_shl(vec16(S), S, brw_imm_d(2));
+ emit_shr(vec16(S), t2, S);
+ emit_and(vec16(S), S, brw_imm_d(0xf));
}
texel_fetch(texture_data[i]);
}