[Mesa-dev] [PATCH] i965/gen4: Fix assertion failures in depthstencil piglit tests.

2012-10-31 Thread Eric Anholt
Don't forget to set depth_mt even if !hiz_mt.
---
 src/mesa/drivers/dri/i965/brw_misc_state.c |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c 
b/src/mesa/drivers/dri/i965/brw_misc_state.c
index ce23fa0..d4b4c75 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -416,11 +416,12 @@ static void emit_depthbuffer(struct brw_context *brw)
unsigned int len;
bool separate_stencil = false;
 
-   if (depth_irb &&
-   depth_irb->mt &&
-   depth_irb->mt->hiz_mt) {
+   if (depth_irb){
   depth_mt = depth_irb->mt;
-  hiz_region = depth_irb->mt->hiz_mt->region;
+  if (depth_mt &&
+  depth_mt->hiz_mt) {
+ hiz_region = depth_irb->mt->hiz_mt->region;
+  }
}
 
/* 3DSTATE_DEPTH_BUFFER, 3DSTATE_STENCIL_BUFFER are both
-- 
1.7.10.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965/gen4: Fix assertion failures in depthstencil piglit tests.

2012-10-31 Thread Kenneth Graunke

On 10/31/2012 07:25 PM, Eric Anholt wrote:

Don't forget to set depth_mt even if !hiz_mt.
---
  src/mesa/drivers/dri/i965/brw_misc_state.c |9 +
  1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c 
b/src/mesa/drivers/dri/i965/brw_misc_state.c
index ce23fa0..d4b4c75 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -416,11 +416,12 @@ static void emit_depthbuffer(struct brw_context *brw)
 unsigned int len;
 bool separate_stencil = false;

-   if (depth_irb &&
-   depth_irb->mt &&
-   depth_irb->mt->hiz_mt) {
+   if (depth_irb){
depth_mt = depth_irb->mt;
-  hiz_region = depth_irb->mt->hiz_mt->region;
+  if (depth_mt &&
+  depth_mt->hiz_mt) {
+ hiz_region = depth_irb->mt->hiz_mt->region;
+  }
 }

 /* 3DSTATE_DEPTH_BUFFER, 3DSTATE_STENCIL_BUFFER are both


Oh geez.  Yeah, that's obviously necessary.

Reviewed-by: Kenneth Graunke 

At some point, I think it would be wise to split gen4/5 out into their 
own function, as it doesn't have either HiZ or separate stencil, and 
could be a lot simpler.

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev