[virglrenderer-devel] [PATCH] renderer: Call glDepthRange if we move from default value

Elie Tournier tournier.elie at gmail.com
Fri Jun 1 14:53:09 UTC 2018


Virglrender holds the values in a structure vrend_sub_context that is zeroed
out when it is initialized.
So, when the first state change set the near_val and far_val to zero,
the check assumes it is the old state and doesn't call glDepthRange.

Fixes: dEQP-GLES2.functional.depth_range.write.zero_to_zero

Suggested-by: Gert Wollny <gert.wollny at collabora.com>
Signed-off-by: Elie Tournier <elie.tournier at collabora.com>
---
 src/vrend_renderer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index df575b1..ef4e483 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -1735,7 +1735,8 @@ void vrend_set_viewport_states(struct vrend_context *ctx,
       }
 
       if (ctx->sub->vps[idx].near_val != near_val ||
-          ctx->sub->vps[idx].far_val != far_val) {
+          ctx->sub->vps[idx].far_val != far_val ||
+          ctx->sub->vps[idx].far_val != 1.0) {
          ctx->sub->vps[idx].near_val = near_val;
          ctx->sub->vps[idx].far_val = far_val;
 
-- 
2.17.1



More information about the virglrenderer-devel mailing list