aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_blorp.h
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2013-05-31 10:59:50 -0700
committerAnuj Phogat <[email protected]>2013-07-01 15:21:25 -0700
commit6fc3da2da0cce869d807211fdd5e96bba9f003f7 (patch)
tree2d5f336df7efb4ccaa63b16b94ee21f418cd5945 /src/mesa/drivers/dri/i965/brw_blorp.h
parent27f2df2507a591eaf8ff6c2953fd39e60ad85482 (diff)
i965/blorp: Add bilinear filtering of samples for multisample scaled blits
Current implementation of ext_framebuffer_multisample_blit_scaled in i965/blorp uses nearest filtering for multisample scaled blits. Using nearest filtering produces blocky artifacts and negates the benefits of MSAA. That is the reason why extension was not enabled on i965. This patch implements the bilinear filtering of samples in blorp engine. Images generated with this patch are free from blocky artifacts and show big improvement in visual quality. Observed no piglit and gles3 regressions. V3: - Algorithm used for filtering assumes a rectangular grid of samples roughly corresponding to sample locations. - Test the boundary conditions on the edges of texture. V4: - Clip texcoords and use conditional MOVs. - Send texture dimensions as push constants. - Remove the optimization in case of scaled multisample blits. V5: - Move mcs_fetch() inside the 'for' loop after computing pixel coordinates. Signed-off-by: Anuj Phogat <[email protected]> Acked-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_blorp.h')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h
index ffc27ccd7b4..9277d09733a 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp.h
@@ -178,8 +178,15 @@ struct brw_blorp_wm_push_constants
uint32_t dst_x1;
uint32_t dst_y0;
uint32_t dst_y1;
+ /* Top right coordinates of the rectangular sample grid used for
+ * multisample scaled blitting.
+ */
+ float sample_grid_x1;
+ float sample_grid_y1;
brw_blorp_coord_transform_params x_transform;
brw_blorp_coord_transform_params y_transform;
+ /* Pad out to an integral number of registers */
+ uint32_t pad[6];
};
/* Every 32 bytes of push constant data constitutes one GEN register. */
@@ -319,6 +326,15 @@ struct brw_blorp_blit_prog_key
* than one sample per pixel.
*/
bool persample_msaa_dispatch;
+
+ /* True for scaled blitting. */
+ bool blit_scaled;
+
+ /* Scale factors between the pixel grid and the grid of samples. We're
+ * using grid of samples for bilinear filetring in multisample scaled blits.
+ */
+ float x_scale;
+ float y_scale;
};
class brw_blorp_blit_params : public brw_blorp_params