<div dir="ltr"><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br><br></div><div>Marek<br></div><div><div class="gmail-yj6qo gmail-ajU"><div id="gmail-:s9" class="gmail-ajR" tabindex="0"><img class="gmail-ajT" src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif"><br></div><div id="gmail-:s9" class="gmail-ajR" tabindex="0"><br></div></div><span class="gmail-HOEnZb gmail-adL"><font color="#888888"></font></span></div><span class="gmail-HOEnZb gmail-adL"></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 28, 2018 at 3:22 PM, Rhys Perry <span dir="ltr"><<a href="mailto:pendingchaos02@gmail.com" target="_blank">pendingchaos02@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Reviewed-by: Brian Paul <<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>><br>
<div><div class="h5"><br>
---<br>
src/mesa/state_tracker/st_<wbr>atom_rasterizer.c | 15 +++++++++++++<br>
src/mesa/state_tracker/st_<wbr>context.c | 2 ++<br>
src/mesa/state_tracker/st_<wbr>extensions.c | 34 +++++++++++++++++++++++++++++<br>
3 files changed, 51 insertions(+)<br>
<br>
diff --git a/src/mesa/state_tracker/st_<wbr>atom_rasterizer.c b/src/mesa/state_tracker/st_<wbr>atom_rasterizer.c<br>
index 1be072e6e3..5b747a924e 100644<br>
--- a/src/mesa/state_tracker/st_<wbr>atom_rasterizer.c<br>
+++ b/src/mesa/state_tracker/st_<wbr>atom_rasterizer.c<br>
@@ -298,5 +298,20 @@ st_update_rasterizer(struct st_context *st)<br>
raster->clip_plane_enable = ctx->Transform.<wbr>ClipPlanesEnabled;<br>
raster->clip_halfz = (ctx->Transform.ClipDepthMode == GL_ZERO_TO_ONE);<br>
<br>
+ /* ST_NEW_RASTERIZER */<br>
+ if (ctx-><wbr>ConservativeRasterization) {<br>
+ if (ctx->ConservativeRasterMode == GL_CONSERVATIVE_RASTER_MODE_<wbr>POST_SNAP_NV)<br>
+ raster->conservative_raster_<wbr>mode = PIPE_CONSERVATIVE_RASTER_POST_<wbr>SNAP;<br>
+ else<br>
+ raster->conservative_raster_<wbr>mode = PIPE_CONSERVATIVE_RASTER_PRE_<wbr>SNAP;<br>
+ } else {<br>
+ raster->conservative_raster_<wbr>mode = PIPE_CONSERVATIVE_RASTER_OFF;<br>
+ }<br>
+<br>
+ raster->conservative_raster_<wbr>dilate = ctx->ConservativeRasterDilate;<br>
+<br>
+ raster->subpixel_precision_x = ctx->NvSubpixelPrecisionBias[<wbr>0];<br>
+ raster->subpixel_precision_y = ctx->NvSubpixelPrecisionBias[<wbr>1];<br>
+<br>
cso_set_rasterizer(st->cso_<wbr>context, raster);<br>
}<br>
diff --git a/src/mesa/state_tracker/st_<wbr>context.c b/src/mesa/state_tracker/st_<wbr>context.c<br>
index 90b7f9359a..0709681e16 100644<br>
--- a/src/mesa/state_tracker/st_<wbr>context.c<br>
+++ b/src/mesa/state_tracker/st_<wbr>context.c<br>
@@ -344,6 +344,8 @@ st_init_driver_flags(struct st_context *st)<br>
f->NewPolygonState = ST_NEW_RASTERIZER;<br>
f->NewPolygonStipple = ST_NEW_POLY_STIPPLE;<br>
f->NewViewport = ST_NEW_VIEWPORT;<br>
+ f-><wbr>NewNvConservativeRasterization = ST_NEW_RASTERIZER;<br>
+ f-><wbr>NewNvConservativeRasterization<wbr>Params = ST_NEW_RASTERIZER;<br>
}<br>
<br>
<br>
diff --git a/src/mesa/state_tracker/st_<wbr>extensions.c b/src/mesa/state_tracker/st_<wbr>extensions.c<br>
</div></div>index bea61f21cb..539ba7e245 100644<br>
<div class="HOEnZb"><div class="h5">--- a/src/mesa/state_tracker/st_<wbr>extensions.c<br>
+++ b/src/mesa/state_tracker/st_<wbr>extensions.c<br>
@@ -494,6 +494,16 @@ void st_init_limits(struct pipe_screen *screen,<br>
c->UseSTD430AsDefaultPacking =<br>
screen->get_param(screen, PIPE_CAP_LOAD_CONSTBUF);<br>
<br>
+ c-><wbr>MaxSubpixelPrecisionBiasBits =<br>
+ screen->get_param(screen, PIPE_CAP_MAX_CONSERVATIVE_<wbr>RASTER_SUBPIXEL_PRECISION_<wbr>BIAS);<br>
+<br>
+ c-><wbr>ConservativeRasterDilateRange[<wbr>0] =<br>
+ screen->get_paramf(screen, PIPE_CAPF_MIN_CONSERVATIVE_<wbr>RASTER_DILATE);<br>
+ c-><wbr>ConservativeRasterDilateRange[<wbr>1] =<br>
+ screen->get_paramf(screen, PIPE_CAPF_MAX_CONSERVATIVE_<wbr>RASTER_DILATE);<br>
+ c-><wbr>ConservativeRasterDilateGranul<wbr>arity =<br>
+ screen->get_paramf(screen, PIPE_CAPF_CONSERVATIVE_RASTER_<wbr>DILATE_GRANULARITY);<br>
+<br>
/* limit the max combined shader output resources to a driver limit */<br>
temp = screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SHADER_<wbr>OUTPUT_RESOURCES);<br>
if (temp > 0 && c-><wbr>MaxCombinedShaderOutputResourc<wbr>es > temp)<br>
@@ -1363,4 +1373,28 @@ void st_init_extensions(struct pipe_screen *screen,<br>
extensions->ARB_texture_cube_<wbr>map_array &&<br>
extensions->ARB_texture_<wbr>stencil8 &&<br>
extensions->ARB_texture_<wbr>multisample;<br>
+<br>
+ if (screen->get_param(screen, PIPE_CAP_CONSERVATIVE_RASTER_<wbr>POST_SNAP_TRIANGLES) &&<br>
+ screen->get_param(screen, PIPE_CAP_CONSERVATIVE_RASTER_<wbr>POST_SNAP_POINTS_LINES) &&<br>
+ screen->get_param(screen, PIPE_CAP_CONSERVATIVE_RASTER_<wbr>POST_DEPTH_COVERAGE)) {<br>
+ float max_dilate;<br>
+ bool pre_snap_triangles, pre_snap_points_lines;<br>
+<br>
+ max_dilate = screen->get_paramf(screen, PIPE_CAPF_MAX_CONSERVATIVE_<wbr>RASTER_DILATE);<br>
+<br>
+ pre_snap_triangles =<br>
+ screen->get_param(screen, PIPE_CAP_CONSERVATIVE_RASTER_<wbr>PRE_SNAP_TRIANGLES);<br>
+ pre_snap_points_lines =<br>
+ screen->get_param(screen, PIPE_CAP_CONSERVATIVE_RASTER_<wbr>PRE_SNAP_POINTS_LINES);<br>
+<br>
+ extensions->NV_conservative_<wbr>raster =<br>
+ screen->get_param(screen, PIPE_CAP_MAX_CONSERVATIVE_<wbr>RASTER_SUBPIXEL_PRECISION_<wbr>BIAS) > 1;<br>
+<br>
+ if (extensions->NV_conservative_<wbr>raster) {<br>
+ extensions->NV_conservative_<wbr>raster_dilate = max_dilate >= 0.75;<br>
</div></div><span class="im HOEnZb">+ extensions->NV_conservative_<wbr>raster_pre_snap_triangles = pre_snap_triangles;<br>
+ extensions->NV_conservative_<wbr>raster_pre_snap =<br>
+ pre_snap_triangles && pre_snap_points_lines;<br>
+ }<br>
+ }<br>
}<br>
</span><span class="HOEnZb"><font color="#888888">--<br>
2.14.3<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div>