i915g: Fix polygon offset by telling draw the Z format.
authorEmma Anholt <emma@anholt.net>
Wed, 18 Aug 2021 23:50:39 +0000 (16:50 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 19 Aug 2021 17:28:14 +0000 (17:28 +0000)
This is what initializes the MRD for draw's polygon offset calculations.

Closes: #4976
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12436>

src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt
src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt
src/gallium/drivers/i915/ci/traces-i915.yml
src/gallium/drivers/i915/i915_state.c

index b4c8262..05ce50e 100644 (file)
@@ -20,8 +20,6 @@ dEQP-GLES2.functional.clipping.triangle_vertex.clip_two.clip_pos_y_pos_z_and_neg
 dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb10_a2,Fail
 dEQP-GLES2.functional.negative_api.shader.uniform_matrixfv_invalid_transpose,Fail
 dEQP-GLES2.functional.negative_api.texture.generatemipmap_zero_level_array_compressed,Fail
-dEQP-GLES2.functional.polygon_offset.default_displacement_with_units,Fail
-dEQP-GLES2.functional.polygon_offset.fixed16_displacement_with_units,Fail
 dEQP-GLES2.functional.rasterization.interpolation.basic.line_loop_wide,Fail
 dEQP-GLES2.functional.rasterization.interpolation.basic.line_strip_wide,Fail
 dEQP-GLES2.functional.rasterization.interpolation.basic.lines_wide,Fail
index e8a9dc8..b5ee53f 100644 (file)
@@ -54,10 +54,6 @@ spec@!opengl 1.1@linestipple@Line strip,Fail
 spec@!opengl 1.1@longprim,Crash
 spec@!opengl 1.1@point-line-no-cull,Crash
 spec@!opengl 1.1@polygon-mode-offset,Fail
-spec@!opengl 1.1@polygon-mode-offset@config 0: Expected white pixel on bottom edge,Fail
-spec@!opengl 1.1@polygon-mode-offset@config 0: Expected white pixel on left edge,Fail
-spec@!opengl 1.1@polygon-mode-offset@config 0: Expected white pixel on right edge,Fail
-spec@!opengl 1.1@polygon-mode-offset@config 0: Expected white pixel on top edge,Fail
 spec@!opengl 1.1@polygon-mode-offset@config 3: Expected white pixel on bottom edge,Fail
 spec@!opengl 1.1@polygon-mode-offset@config 3: Expected white pixel on left edge,Fail
 spec@!opengl 1.1@polygon-mode-offset@config 3: Expected white pixel on right edge,Fail
@@ -66,7 +62,6 @@ spec@!opengl 1.1@polygon-mode-offset@config 4: Expected white pixel on bottom ed
 spec@!opengl 1.1@polygon-mode-offset@config 4: Expected white pixel on left edge,Fail
 spec@!opengl 1.1@polygon-mode-offset@config 4: Expected white pixel on right edge,Fail
 spec@!opengl 1.1@polygon-mode-offset@config 4: Expected white pixel on top edge,Fail
-spec@!opengl 1.1@polygon-offset,Fail
 spec@!opengl 1.1@read-front,Fail
 spec@!opengl 1.1@read-front clear-front-first,Fail
 spec@!opengl 1.1@tex-upside-down-miptree,Fail
@@ -122,7 +117,6 @@ spec@!opengl 1.2@texwrap 3d proj,Fail
 spec@!opengl 1.2@texwrap 3d proj@GL_RGBA8- NPOT- projected,Fail
 spec@!opengl 1.2@texwrap 3d proj bordercolor,Fail
 spec@!opengl 1.2@texwrap 3d proj bordercolor@GL_RGBA8- projected- border color only,Fail
-spec@!opengl 1.4@gl-1.4-polygon-offset,Fail
 spec@!opengl 1.4@tex-miplevel-selection,Fail
 spec@!opengl 1.4@tex-miplevel-selection-lod,Fail
 spec@!opengl 1.4@tex-miplevel-selection-lod-bias,Fail
index f35d482..819a659 100644 (file)
@@ -12,7 +12,7 @@ traces:
   - path: gputest/plot3d.trace
     expectations:
       - device: i915-g33
-        checksum: dc187485584bc45b9050e88163e72c34
+        checksum: 6a3f62f1c6cc57c91188f93f37ebf9b4
   - path: gputest/triangle.trace
     expectations:
       # Weird white bar behind Tux's head.
@@ -27,7 +27,7 @@ traces:
     # The cel shading is pretty chunky, but maybe that's just precision stuff.
     expectations:
       - device: i915-g33
-        checksum: 2258848deb4052a3c19145fe524e2805
+        checksum: 7518414e4f1a4f1e07c04ec1500f53e7
   # Requires GLSL 1.30
   #- path: humus/DynamicBranching3.trace
   #  expectations:
index 947a67c..fe34edd 100644 (file)
@@ -815,6 +815,8 @@ i915_set_framebuffer_state(struct pipe_context *pipe,
       pipe_surface_reference(&i915->framebuffer.cbufs[0], NULL);
    }
    pipe_surface_reference(&i915->framebuffer.zsbuf, fb->zsbuf);
+   if (fb->zsbuf)
+      draw_set_zs_format(i915->draw, fb->zsbuf->format);
 
    i915->dirty |= I915_NEW_FRAMEBUFFER;
 }