aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/blorp
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-08-29 17:52:52 -0700
committerJason Ekstrand <[email protected]>2016-09-12 19:42:57 -0700
commita613449f7147c4a9196f9e9cc31783029a7493f2 (patch)
treeb7a9e0407931875fc7606cd104cd06f88bc75c3b /src/intel/blorp
parent8ac99eabb6570f0f3c5f7d7da1332a99ce636362 (diff)
intel/blorp: Use isl_get_interleaved_msaa_px_size_sa
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/blorp')
-rw-r--r--src/intel/blorp/blorp_blit.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index 35cf9a46c0a..bebe36b2b05 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -1484,34 +1484,12 @@ blorp_blit(struct blorp_batch *batch,
* If it's UMS, then we have no choice but to set up the rendering
* pipeline as multisampled.
*/
- switch (params.dst.surf.samples) {
- case 2:
- params.x0 = ROUND_DOWN_TO(params.x0 * 2, 4);
- params.y0 = ROUND_DOWN_TO(params.y0, 4);
- params.x1 = ALIGN(params.x1 * 2, 4);
- params.y1 = ALIGN(params.y1, 4);
- break;
- case 4:
- params.x0 = ROUND_DOWN_TO(params.x0 * 2, 4);
- params.y0 = ROUND_DOWN_TO(params.y0 * 2, 4);
- params.x1 = ALIGN(params.x1 * 2, 4);
- params.y1 = ALIGN(params.y1 * 2, 4);
- break;
- case 8:
- params.x0 = ROUND_DOWN_TO(params.x0 * 4, 8);
- params.y0 = ROUND_DOWN_TO(params.y0 * 2, 4);
- params.x1 = ALIGN(params.x1 * 4, 8);
- params.y1 = ALIGN(params.y1 * 2, 4);
- break;
- case 16:
- params.x0 = ROUND_DOWN_TO(params.x0 * 4, 8);
- params.y0 = ROUND_DOWN_TO(params.y0 * 4, 8);
- params.x1 = ALIGN(params.x1 * 4, 8);
- params.y1 = ALIGN(params.y1 * 4, 8);
- break;
- default:
- unreachable("Unrecognized sample count in brw_blorp_blit_params ctor");
- }
+ struct isl_extent2d px_size_sa =
+ isl_get_interleaved_msaa_px_size_sa(params.dst.surf.samples);
+ params.x0 = ROUND_DOWN_TO(params.x0, 2) * px_size_sa.width;
+ params.y0 = ROUND_DOWN_TO(params.y0, 2) * px_size_sa.height;
+ params.x1 = ALIGN(params.x1, 2) * px_size_sa.width;
+ params.y1 = ALIGN(params.y1, 2) * px_size_sa.height;
surf_fake_interleaved_msaa(batch->blorp->isl_dev, &params.dst);