<div dir="auto">This will cause asserts on piglit and dEQP runs instead of failures. This is incredibly inconvenient, as e.g. dEQP runs everything in a single process.</div><div class="gmail_extra"><br><div class="gmail_quote">On Apr 25, 2017 7:29 PM, "George Kyriazis" <<a href="mailto:george.kyriazis@intel.com">george.kyriazis@intel.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Add logic for converting enums and also making sure stipple works.<br>
<br>
CC: <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.<wbr>freedesktop.org</a>><br>
<br>
---<br>
src/gallium/drivers/swr/swr_<wbr>state.cpp | 14 +++++++++++++-<br>
src/gallium/drivers/swr/swr_<wbr>state.h | 20 ++++++++++++++++++++<br>
2 files changed, 33 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/gallium/drivers/swr/swr_<wbr>state.cpp b/src/gallium/drivers/swr/swr_<wbr>state.cpp<br>
index 56b1374..24a6759 100644<br>
--- a/src/gallium/drivers/swr/swr_<wbr>state.cpp<br>
+++ b/src/gallium/drivers/swr/swr_<wbr>state.cpp<br>
@@ -201,6 +201,12 @@ swr_create_rasterizer_state(<wbr>struct pipe_context *pipe,<br>
struct pipe_rasterizer_state *state;<br>
state = (pipe_rasterizer_state *)mem_dup(rast, sizeof *rast);<br>
<br>
+ if (state) {<br>
+ if (state->fill_front != state->fill_back) {<br>
+ assert(0 && "front != back polygon mode not supported");<br>
+ }<br>
+ }<br>
+<br>
return state;<br>
}<br>
<br>
@@ -1153,6 +1159,10 @@ swr_update_derived(struct pipe_context *pipe,<br>
rastState-><wbr>slopeScaledDepthBias = 0;<br>
rastState->depthBiasClamp = 0;<br>
}<br>
+<br>
+ /* translate polygon mode, at least for the front==back case */<br>
+ rastState->fillMode = swr_convert_fill_mode(<wbr>rasterizer->fill_front);<br>
+<br>
struct pipe_surface *zb = fb->zsbuf;<br>
if (zb && swr_resource(zb->texture)-><wbr>has_depth)<br>
rastState->depthFormat = swr_resource(zb->texture)-><wbr>swr.format;<br>
@@ -1423,7 +1433,9 @@ swr_update_derived(struct pipe_context *pipe,<br>
/* and points, since we rasterize them as triangles, too */<br>
/* Has to be before fragment shader, since it sets SWR_NEW_FS */<br>
if (p_draw_info) {<br>
- bool new_prim_is_poly = (u_reduced_prim(p_draw_info-><wbr>mode) == PIPE_PRIM_TRIANGLES);<br>
+ bool new_prim_is_poly =<br>
+ (u_reduced_prim(p_draw_info-><wbr>mode) == PIPE_PRIM_TRIANGLES) &&<br>
+ (ctx->derived.rastState.<wbr>fillMode == SWR_FILLMODE_SOLID);<br>
if (new_prim_is_poly != ctx->poly_stipple.prim_is_<wbr>poly) {<br>
ctx->dirty |= SWR_NEW_FS;<br>
ctx->poly_stipple.prim_is_poly = new_prim_is_poly;<br>
diff --git a/src/gallium/drivers/swr/swr_<wbr>state.h b/src/gallium/drivers/swr/swr_<wbr>state.h<br>
index 9a8c4e1..7940a96 100644<br>
--- a/src/gallium/drivers/swr/swr_<wbr>state.h<br>
+++ b/src/gallium/drivers/swr/swr_<wbr>state.h<br>
@@ -376,4 +376,24 @@ swr_convert_prim_topology(<wbr>const unsigned mode)<br>
return TOP_UNKNOWN;<br>
}<br>
};<br>
+<br>
+/*<br>
+ * convert mesa PIPE_POLYGON_MODE_X to SWR enum SWR_FILLMODE<br>
+ */<br>
+static INLINE enum SWR_FILLMODE<br>
+swr_convert_fill_mode(const unsigned mode)<br>
+{<br>
+ switch(mode) {<br>
+ case PIPE_POLYGON_MODE_FILL:<br>
+ return SWR_FILLMODE_SOLID;<br>
+ case PIPE_POLYGON_MODE_LINE:<br>
+ return SWR_FILLMODE_WIREFRAME;<br>
+ case PIPE_POLYGON_MODE_POINT:<br>
+ return SWR_FILLMODE_POINT;<br>
+ default:<br>
+ assert(0 && "Unknown fillmode");<br>
+ return SWR_FILLMODE_SOLID; // at least do something sensible<br>
+ }<br>
+}<br>
+<br>
#endif<br>
--<br>
2.7.4<br>
<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>
</blockquote></div></div>