<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">We suspect the remaining failure might be due to not quantizing the depth bounds min/max values.  That can be addressed in a future patch.</div>
<div class=""><br class="">
</div>
Reviewed-by: Tim Rowley <<a href="mailto:timothy.o.rowley@intel.com" class="">timothy.o.rowley@intel.com</a>>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Nov 1, 2016, at 3:45 PM, Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Signed-off-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>><br class="">
---<br class="">
<br class="">
This fails one sub-case of the piglit depth_bounds test:<br class="">
<br class="">
Test 10, bounds=(0.00, 0.50), z=(0.50, 0.50, 0.50, 0.50)<br class="">
Probe color at (0,20)<br class="">
 Expected: 255 255 255<br class="">
 Observed: 26 26 26<br class="">
<br class="">
I'm blaming it on the floating point boogey man.<br class="">
<br class="">
src/gallium/drivers/swr/swr_screen.cpp | 2 +-<br class="">
src/gallium/drivers/swr/swr_state.cpp  | 6 ++++++<br class="">
2 files changed, 7 insertions(+), 1 deletion(-)<br class="">
<br class="">
diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp<br class="">
index 704a684..fa16edd 100644<br class="">
--- a/src/gallium/drivers/swr/swr_screen.cpp<br class="">
+++ b/src/gallium/drivers/swr/swr_screen.cpp<br class="">
@@ -332,7 +332,7 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)<br class="">
   case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:<br class="">
      return 0;<br class="">
   case PIPE_CAP_DEPTH_BOUNDS_TEST:<br class="">
-      return 0; // xxx<br class="">
+      return 1;<br class="">
   case PIPE_CAP_TEXTURE_FLOAT_LINEAR:<br class="">
   case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:<br class="">
      return 1;<br class="">
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp<br class="">
index 3e02322..d8a8ee1 100644<br class="">
--- a/src/gallium/drivers/swr/swr_state.cpp<br class="">
+++ b/src/gallium/drivers/swr/swr_state.cpp<br class="">
@@ -1205,6 +1205,7 @@ swr_update_derived(struct pipe_context *pipe,<br class="">
      struct pipe_depth_state *depth = &(ctx->depth_stencil->depth);<br class="">
      struct pipe_stencil_state *stencil = ctx->depth_stencil->stencil;<br class="">
      SWR_DEPTH_STENCIL_STATE depthStencilState = {{0}};<br class="">
+      SWR_DEPTH_BOUNDS_STATE depthBoundsState = {0};<br class="">
<br class="">
      /* XXX, incomplete.  Need to flesh out stencil & alpha test state<br class="">
      struct pipe_stencil_state *front_stencil =<br class="">
@@ -1251,6 +1252,11 @@ swr_update_derived(struct pipe_context *pipe,<br class="">
      depthStencilState.depthTestFunc = swr_convert_depth_func(depth->func);<br class="">
      depthStencilState.depthWriteEnable = depth->writemask;<br class="">
      SwrSetDepthStencilState(ctx->swrContext, &depthStencilState);<br class="">
+<br class="">
+      depthBoundsState.depthBoundsTestEnable = depth->bounds_test;<br class="">
+      depthBoundsState.depthBoundsTestMinValue = depth->bounds_min;<br class="">
+      depthBoundsState.depthBoundsTestMaxValue = depth->bounds_max;<br class="">
+      SwrSetDepthBoundsState(ctx->swrContext, &depthBoundsState);<br class="">
   }<br class="">
<br class="">
   /* Blend State */<br class="">
-- <br class="">
2.7.3<br class="">
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>