diff options
author | Jason Ekstrand <[email protected]> | 2016-04-21 18:10:53 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-04-26 14:55:22 -0700 |
commit | 33fa12c50f2e5e4fd4cfde1234ed6fdcc612fe92 (patch) | |
tree | 6ca2619047d300e18cbaa96006d08d76aaff200b /src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | |
parent | b6dd8e42f09d98a536a38c33383238ec3595d066 (diff) |
i965/blorp: Turn coord_transform into a C-style struct
Reviewed-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_blorp_blit.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 2aa91ada525..177739065e3 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -1783,10 +1783,11 @@ brw_blorp_blit_program::render_target_write() } -void -brw_blorp_coord_transform_params::setup(GLfloat src0, GLfloat src1, - GLfloat dst0, GLfloat dst1, - bool mirror) +static void +brw_blorp_setup_coord_transform(struct brw_blorp_coord_transform *xform, + GLfloat src0, GLfloat src1, + GLfloat dst0, GLfloat dst1, + bool mirror) { float scale = (src1 - src0) / (dst1 - dst0); if (!mirror) { @@ -1800,16 +1801,16 @@ brw_blorp_coord_transform_params::setup(GLfloat src0, GLfloat src1, * whereas the behaviour we actually want is "round to nearest", * so 0.5 provides the necessary correction. */ - multiplier = scale; - offset = src0 + (-dst0 + 0.5f) * scale; + xform->multiplier = scale; + xform->offset = src0 + (-dst0 + 0.5f) * scale; } else { /* When mirroring X we need: * src_x - src_x0 = dst_x1 - dst_x - 0.5 * Therefore: * src_x = src_x0 + (dst_x1 -dst_x - 0.5) * scale */ - multiplier = -scale; - offset = src0 + (dst1 - 0.5f) * scale; + xform->multiplier = -scale; + xform->offset = src0 + (dst1 - 0.5f) * scale; } } @@ -2062,8 +2063,10 @@ brw_blorp_blit_miptrees(struct brw_context *brw, params.wm_push_consts.rect_grid_y1 = minify(src_mt->logical_height0, src_level) * wm_prog_key.y_scale - 1.0f; - params.wm_push_consts.x_transform.setup(src_x0, src_x1, dst_x0, dst_x1, mirror_x); - params.wm_push_consts.y_transform.setup(src_y0, src_y1, dst_y0, dst_y1, mirror_y); + brw_blorp_setup_coord_transform(¶ms.wm_push_consts.x_transform, + src_x0, src_x1, dst_x0, dst_x1, mirror_x); + brw_blorp_setup_coord_transform(¶ms.wm_push_consts.y_transform, + src_y0, src_y1, dst_y0, dst_y1, mirror_y); params.wm_push_consts.src_z = params.src.mt->target == GL_TEXTURE_3D ? params.src.layer : 0; |