diff options
author | Courtney Goeltzenleuchter <[email protected]> | 2013-11-13 16:24:56 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-01-20 11:31:53 -0800 |
commit | 5b84226c31e941219422f6d60c31524081b7a188 (patch) | |
tree | ddebed7b00cfdb732f4f252907998eea5c4202cf /src/mesa/drivers/dri | |
parent | d4dc359875126c432e46e3d1da8610a066d21302 (diff) |
mesa: Converty gl_viewport_attrib::X, ::Y, ::Width, and ::Height to float
v4: Split out from a single megapatch. Suggested by Ken. Also make
meta's save_state::ViewportX, ::ViewportY, ::ViewportW, and ::ViewportH
to match gl_viewport_attrib.
Signed-off-by: Courtney Goeltzenleuchter <[email protected]>
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_clip_state.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_clip_state.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_viewport_state.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_viewport_state.c | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clip_state.c b/src/mesa/drivers/dri/i965/brw_clip_state.c index a0bdb4384ae..021acc80e52 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_state.c +++ b/src/mesa/drivers/dri/i965/brw_clip_state.c @@ -43,8 +43,8 @@ upload_clip_vp(struct brw_context *brw) sizeof(*vp), 32, &brw->clip.vp_offset); const float maximum_post_clamp_delta = 4096; - float gbx = maximum_post_clamp_delta / (float) ctx->Viewport.Width; - float gby = maximum_post_clamp_delta / (float) ctx->Viewport.Height; + float gbx = maximum_post_clamp_delta / ctx->Viewport.Width; + float gby = maximum_post_clamp_delta / ctx->Viewport.Height; vp->xmin = -gbx; vp->xmax = gbx; @@ -127,8 +127,8 @@ brw_upload_clip_unit(struct brw_context *brw) /* enable guardband clipping if we can */ if (ctx->Viewport.X == 0 && ctx->Viewport.Y == 0 && - ctx->Viewport.Width == fb->Width && - ctx->Viewport.Height == fb->Height) + ctx->Viewport.Width == (float) fb->Width && + ctx->Viewport.Height == (float) fb->Height) { clip->clip5.guard_band_enable = 1; clip->clip6.clipper_viewport_state_ptr = diff --git a/src/mesa/drivers/dri/i965/gen6_clip_state.c b/src/mesa/drivers/dri/i965/gen6_clip_state.c index 6cec0ff21ac..8dcca84c216 100644 --- a/src/mesa/drivers/dri/i965/gen6_clip_state.c +++ b/src/mesa/drivers/dri/i965/gen6_clip_state.c @@ -98,8 +98,8 @@ upload_clip_state(struct brw_context *brw) if (ctx->Viewport.X == 0 && ctx->Viewport.Y == 0 && - ctx->Viewport.Width == fb->Width && - ctx->Viewport.Height == fb->Height) { + ctx->Viewport.Width == (float) fb->Width && + ctx->Viewport.Height == (float) fb->Height) { dw2 |= GEN6_CLIP_GB_TEST; } diff --git a/src/mesa/drivers/dri/i965/gen6_viewport_state.c b/src/mesa/drivers/dri/i965/gen6_viewport_state.c index 033592035f9..4c5135b84a3 100644 --- a/src/mesa/drivers/dri/i965/gen6_viewport_state.c +++ b/src/mesa/drivers/dri/i965/gen6_viewport_state.c @@ -55,8 +55,8 @@ gen6_upload_clip_vp(struct brw_context *brw) * drawable. */ const float maximum_post_clamp_delta = 8192; - float gbx = maximum_post_clamp_delta / (float) ctx->Viewport.Width; - float gby = maximum_post_clamp_delta / (float) ctx->Viewport.Height; + float gbx = maximum_post_clamp_delta / ctx->Viewport.Width; + float gby = maximum_post_clamp_delta / ctx->Viewport.Height; vp->xmin = -gbx; vp->xmax = gbx; diff --git a/src/mesa/drivers/dri/i965/gen7_viewport_state.c b/src/mesa/drivers/dri/i965/gen7_viewport_state.c index 8c5fcac2b22..66c183845a0 100644 --- a/src/mesa/drivers/dri/i965/gen7_viewport_state.c +++ b/src/mesa/drivers/dri/i965/gen7_viewport_state.c @@ -54,8 +54,8 @@ gen7_upload_sf_clip_viewport(struct brw_context *brw) * drawable. */ const float maximum_guardband_extent = 8192; - float gbx = maximum_guardband_extent / (float) ctx->Viewport.Width; - float gby = maximum_guardband_extent / (float) ctx->Viewport.Height; + float gbx = maximum_guardband_extent / ctx->Viewport.Width; + float gby = maximum_guardband_extent / ctx->Viewport.Height; vp->guardband.xmin = -gbx; vp->guardband.xmax = gbx; |