diff options
author | Eric Anholt <eric@anholt.net> | 2013-01-23 14:30:05 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2013-01-25 09:04:52 -0500 |
commit | 416326e33780fda0580292f9c2ace0b7c2c520e3 (patch) | |
tree | c2db06b5ddda33ee2ffabdb1bfa073eeb8048fd3 /src/mesa/drivers/dri/i965/gen7_viewport_state.c | |
parent | 9db2098d18dd28cbb4f9f98ec9e8f9d579608c38 (diff) | |
download | external_mesa3d-416326e33780fda0580292f9c2ace0b7c2c520e3.zip external_mesa3d-416326e33780fda0580292f9c2ace0b7c2c520e3.tar.gz external_mesa3d-416326e33780fda0580292f9c2ace0b7c2c520e3.tar.bz2 |
i965: Correct gen6+ guardband calculation.
Too much attention was paid to the first paragraphs, and not enough to
the last little note that "oh, by the way, the rendered things
themselves still have to be clipped to just 8192 wide/high".
Fixes GTF's clip.c test with 4096 or higher width on ivb, where one of
the triangles got the upper half of its pixels dropped.
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen7_viewport_state.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_viewport_state.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_viewport_state.c b/src/mesa/drivers/dri/i965/gen7_viewport_state.c index 7036ef6..150e890 100644 --- a/src/mesa/drivers/dri/i965/gen7_viewport_state.c +++ b/src/mesa/drivers/dri/i965/gen7_viewport_state.c @@ -44,12 +44,17 @@ gen7_upload_sf_clip_viewport(struct brw_context *brw) brw->clip.vp_offset = brw->sf.vp_offset; /* According to the "Vertex X,Y Clamping and Quantization" section of the - * Strips and Fans documentation, Ivybridge and later don't have a maximum - * post-clamp delta. However, the guardband extent must fit in [-32K, 32K) - * which gives us a maximum size of 64K. Use 65000 rather than 65536 to be - * somewhat cautious---make the guardband slightly smaller than the maximum. + * Strips and Fans documentation, objects must not have a screen-space + * extents of over 8192 pixels, or they may be mis-rasterized. The maximum + * screen space coordinates of a small object may larger, but we have no + * way to enforce the object size other than through clipping. + * + * If you're surprised that we set clip to -gbx to +gbx and it seems like + * we'll end up with 16384 wide, note that for a 8192-wide render target, + * we'll end up with a normal (-1, 1) clip volume that just covers the + * drawable. */ - const float maximum_guardband_extent = 65000; + const float maximum_guardband_extent = 8192; float gbx = maximum_guardband_extent / (float) ctx->Viewport.Width; float gby = maximum_guardband_extent / (float) ctx->Viewport.Height; |